Showing 2 of 4 files from the diff.

@@ -1881,13 +1881,13 @@
Loading
1881 1881
1882 1882
    if (aMetricsValues->mMetrics.mLinkMargin)
1883 1883
    {
1884 -
        OutputFormat(" - Margin: %d %s\r\n", aMetricsValues->mLinkMarginValue,
1884 +
        OutputFormat(" - Margin: %d (dB) %s\r\n", aMetricsValues->mLinkMarginValue,
1885 1885
                     otLinkMetricsTypeEnumToString(OT_LINK_METRICS_TYPE_EXPONENTIAL));
1886 1886
    }
1887 1887
1888 1888
    if (aMetricsValues->mMetrics.mRssi)
1889 1889
    {
1890 -
        OutputFormat(" - RSSI: %d %s\r\n", aMetricsValues->mRssiValue,
1890 +
        OutputFormat(" - RSSI: %d (dBm) %s\r\n", aMetricsValues->mRssiValue,
1891 1891
                     otLinkMetricsTypeEnumToString(OT_LINK_METRICS_TYPE_EXPONENTIAL));
1892 1892
    }
1893 1893
}

@@ -133,6 +133,7 @@
Loading
133 133
                                          const Ip6::Address &aAddress)
134 134
{
135 135
    otLinkMetricsValues    metricsValues;
136 +
    uint8_t                metricsRawValue;
136 137
    uint16_t               pos    = aOffset;
137 138
    uint16_t               endPos = aOffset + aLength;
138 139
    Tlv                    tlv;
@@ -178,18 +179,22 @@
Loading
178 179
        case OT_LINK_METRICS_MARGIN:
179 180
            VerifyOrExit(!typeIdFlags.IsLengthFlagSet(), OT_NOOP);
180 181
            metricsValues.mMetrics.mLinkMargin = true;
181 -
            aMessage.Read(pos, sizeof(uint8_t), &metricsValues.mLinkMarginValue);
182 +
            aMessage.Read(pos, sizeof(uint8_t), &metricsRawValue);
183 +
            metricsValues.mLinkMarginValue =
184 +
                metricsRawValue * 130 / 255; // Reverse operation for linear scale, map from [0, 255] to [0, 130]
182 185
            pos += sizeof(uint8_t);
183 -
            otLogDebgMle(" - Margin: %d %s", metricsValues.mLinkMarginValue,
186 +
            otLogDebgMle(" - Margin: %d (dB) %s", metricsValues.mLinkMarginValue,
184 187
                         otLinkMetricsTypeEnumToString(OT_LINK_METRICS_TYPE_EXPONENTIAL));
185 188
            break;
186 189
187 190
        case OT_LINK_METRICS_RSSI:
188 191
            VerifyOrExit(!typeIdFlags.IsLengthFlagSet(), OT_NOOP);
189 192
            metricsValues.mMetrics.mRssi = true;
190 -
            aMessage.Read(pos, sizeof(uint8_t), &metricsValues.mRssiValue);
193 +
            aMessage.Read(pos, sizeof(uint8_t), &metricsRawValue);
194 +
            metricsValues.mRssiValue =
195 +
                metricsRawValue * 130 / 255 - 130; // Reverse operation for linear scale, map from [0, 255] to [-130, 0]
191 196
            pos += sizeof(uint8_t);
192 -
            otLogDebgMle(" - RSSI: %d %s", metricsValues.mRssiValue,
197 +
            otLogDebgMle(" - RSSI: %d (dBm) %s", metricsValues.mRssiValue,
193 198
                         otLinkMetricsTypeEnumToString(OT_LINK_METRICS_TYPE_EXPONENTIAL));
194 199
            break;
195 200
@@ -295,7 +300,7 @@
Loading
295 300
        case OT_LINK_METRICS_RSSI:
296 301
            VerifyOrExit(!linkMetricsTypeIds[i].IsLengthFlagSet(), error = OT_ERROR_INVALID_ARGS);
297 302
            metric.SetMetricsValue8((aRequestMessage.GetAverageRss() + 130) * 255 /
298 -
                                    130); // Linear scale rss from [-130, 0] to [0 to 255]
303 +
                                    130); // Linear scale rss from [-130, 0] to [0, 255]
299 304
            break;
300 305
301 306
        default:
Files Coverage
examples 80.11%
src 85.38%
tests/unit 90.22%
include/openthread/coap.h 100.00%
tools/spi-hdlc-adapter/spi-hdlc-adapter.c 0.00%
Project Totals (369 files) 84.45%
1
coverage:
2
  status:
3
    project: off
4
    patch: off
5

6
ignore:
7
  - "tests/*"
8
  - "third_party/**/*"
9

10
comment:
11
  layout: "diff, flags, files"
12
  after_n_builds: 16
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading