[api] include Thread version in neighbor info (#8435)

This commit is contained in:
jinran-google
2022-11-23 21:34:13 -08:00
committed by GitHub
parent eeb6ab0c8e
commit e66c21c3da
5 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ extern "C" {
* @note This number versions both OpenThread platform and user APIs.
*
*/
#define OPENTHREAD_API_VERSION (264)
#define OPENTHREAD_API_VERSION (265)
/**
* @addtogroup api-instance
+1
View File
@@ -99,6 +99,7 @@ typedef struct
int8_t mLastRssi; ///< Last observed RSSI
uint16_t mFrameErrorRate; ///< Frame error rate (0xffff->100%). Requires error tracking feature.
uint16_t mMessageErrorRate; ///< (IPv6) msg error rate (0xffff->100%). Requires error tracking feature.
uint16_t mVersion; ///< Thread version of the neighbor
bool mRxOnWhenIdle : 1; ///< rx-on-when-idle
bool mFullThreadDevice : 1; ///< Full Thread Device
bool mFullNetworkData : 1; ///< Full Network Data
+3 -3
View File
@@ -4960,11 +4960,11 @@ template <> otError Interpreter::Process<Cmd("neighbor")>(Arg aArgs[])
if (isTable)
{
static const char *const kNeighborTableTitles[] = {
"Role", "RLOC16", "Age", "Avg RSSI", "Last RSSI", "R", "D", "N", "Extended MAC",
"Role", "RLOC16", "Age", "Avg RSSI", "Last RSSI", "R", "D", "N", "Extended MAC", "Version",
};
static const uint8_t kNeighborTableColumnWidths[] = {
6, 8, 5, 10, 11, 1, 1, 1, 18,
6, 8, 5, 10, 11, 1, 1, 1, 18, 9,
};
OutputTableHeader(kNeighborTableTitles, kNeighborTableColumnWidths);
@@ -4984,7 +4984,7 @@ template <> otError Interpreter::Process<Cmd("neighbor")>(Arg aArgs[])
OutputFormat("|%1d", neighborInfo.mFullNetworkData);
OutputFormat("| ");
OutputExtAddress(neighborInfo.mExtAddress);
OutputLine(" |");
OutputLine(" | %7d |", neighborInfo.mVersion);
}
else
{
+1
View File
@@ -81,6 +81,7 @@ void Neighbor::Info::SetFrom(const Neighbor &aNeighbor)
mRxOnWhenIdle = aNeighbor.IsRxOnWhenIdle();
mFullThreadDevice = aNeighbor.IsFullThreadDevice();
mFullNetworkData = (aNeighbor.GetNetworkDataType() == NetworkData::kFullSet);
mVersion = aNeighbor.GetVersion();
}
void Neighbor::Init(Instance &aInstance)
+3 -3
View File
@@ -38,9 +38,9 @@ set extaddr [get_extaddr]
switch_node 1
send "neighbor table\n"
expect "| Role | RLOC16 | Age | Avg RSSI | Last RSSI |R|D|N| Extended MAC |"
expect "+------+--------+-----+----------+-----------+-+-+-+------------------+"
expect -re "\\| +C +\\| 0x$rloc \\| +\\d+ \\| +-?\\d+ \\| +-?\\d+ \\|1\\|0\\|0\\| $extaddr \\|"
expect "| Role | RLOC16 | Age | Avg RSSI | Last RSSI |R|D|N| Extended MAC | Version |"
expect "+------+--------+-----+----------+-----------+-+-+-+------------------+---------+"
expect -re "\\| +C +\\| 0x$rloc \\| +\\d+ \\| +-?\\d+ \\| +-?\\d+ \\|1\\|0\\|0\\| $extaddr \\| +\\d+ \\|"
expect_line "Done"
send "neighbor list\n"
expect "0x$rloc"