From a0c6f5005102f782d46e325b0175242e0662c269 Mon Sep 17 00:00:00 2001 From: Marcin K Szczodrak Date: Wed, 17 Aug 2016 16:11:06 -0700 Subject: [PATCH] Feature/ot plat rssi (#411) * rename otPlatRadioGetNoiseFloor to otPlatRadioGetRssi * update cli README with singleton command --- examples/platforms/cc2538/radio.c | 2 +- examples/platforms/posix/radio.c | 2 +- include/platform/radio.h | 4 ++-- src/cli/README.md | 10 ++++++++++ src/ncp/ncp_base.cpp | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/examples/platforms/cc2538/radio.c b/examples/platforms/cc2538/radio.c index fd5a62000..f46e9756f 100644 --- a/examples/platforms/cc2538/radio.c +++ b/examples/platforms/cc2538/radio.c @@ -300,7 +300,7 @@ RadioPacket *otPlatRadioGetTransmitBuffer(void) return &sTransmitFrame; } -int8_t otPlatRadioGetNoiseFloor(void) +int8_t otPlatRadioGetRssi(void) { return 0; } diff --git a/examples/platforms/posix/radio.c b/examples/platforms/posix/radio.c index a57c9a9e8..16cb9c7a3 100644 --- a/examples/platforms/posix/radio.c +++ b/examples/platforms/posix/radio.c @@ -423,7 +423,7 @@ RadioPacket *otPlatRadioGetTransmitBuffer(void) return &sTransmitFrame; } -int8_t otPlatRadioGetNoiseFloor(void) +int8_t otPlatRadioGetRssi(void) { return 0; } diff --git a/include/platform/radio.h b/include/platform/radio.h index 0d769ad8f..83524d7da 100644 --- a/include/platform/radio.h +++ b/include/platform/radio.h @@ -272,9 +272,9 @@ extern void otPlatRadioTransmitDone(bool aFramePending, ThreadError aError); /** * Get the most recent RSSI measurement. * - * @returns The noise floor value in dBm when the noise floor value is valid. 127 when noise floor value is invalid. + * @returns The RSSI in dBm when it is valid. 127 when RSSI is invalid. */ -int8_t otPlatRadioGetNoiseFloor(void); +int8_t otPlatRadioGetRssi(void); /** * Get the radio capabilities. diff --git a/src/cli/README.md b/src/cli/README.md index d990b5465..d608af4fb 100644 --- a/src/cli/README.md +++ b/src/cli/README.md @@ -40,6 +40,7 @@ OpenThread test scripts use the CLI to execute test cases. * [router](#router) * [routerupgradethreshold](#routerupgradethreshold) * [scan](#scan) +* [singleton](#singleton) * [state](#state) * [thread](#thread) * [version](#version) @@ -734,6 +735,15 @@ Perform an IEEE 802.15.4 Active Scan. Done ``` +### singleton +Return true when there are no other nodes in the network, otherwise return false. + +```bash +> singleton +true or false +Done +``` + ### thread start Enable Thread protocol operation and attach to a Thread network. diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index 963c82a5e..d4877f815 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -1264,7 +1264,7 @@ ThreadError NcpBase::GetPropertyHandler_PHY_RSSI(uint8_t header, spinel_prop_key SPINEL_CMD_PROP_VALUE_IS, key, SPINEL_DATATYPE_INT8_S, - otPlatRadioGetNoiseFloor() + otPlatRadioGetRssi() ); }