Skip to content

Commit 841dcbe

Browse files
author
Jarkko Paso
authored
MAC: Configurable data whitening (ARMmbed#2393)
1 parent 9a10d66 commit 841dcbe

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

nanostack/mlme.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ typedef enum {
264264
macAutoRequestKeyIndex = 0x7b, /*<The index of the key used for automatic data*/
265265
macDefaultKeySource = 0x7c, /*<Default key source*/
266266
//NON standard extension
267+
macSetDataWhitening = 0xf3, /*< Enable or disable data whitening, boolean true for enable, false for disable */
267268
macCCAThresholdStart = 0xf4, /*< Start automatic CCA threshold */
268269
macDevicePendingAckTrig = 0xf5, /*< Trig Pending ACK for Accepted Data packet for temporary neighbour */
269270
mac802_15_4Mode = 0xf6, /*<IEEE 802.15.4 mode*/

nanostack/platform/arm_hal_phy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ typedef enum {
8181
PHY_EXTENSION_SET_TX_POWER, /**< Set TX output power which is given as percentage of maximum. 0 is the lowest possible TX power and 100 is the highest possible TX power */
8282
PHY_EXTENSION_SET_CCA_THRESHOLD, /**< Set CCA threshold which is given as percentage of maximum threshold. 0 is the lowest(strictest) possible threshold and 100 is the highest possible threshold */
8383
PHY_EXTENSION_SET_CHANNEL_CCA_THRESHOLD, /**< Set CCA threshold which is given as dBm. This value is set in PHY_LINK_CCA_PREPARE callback and PHY driver should update the CCA threshold configuration */
84+
PHY_EXTENSION_SET_DATA_WHITENING, /**< Enable or disable data whitening. Boolean true for enable, false for disable */
8485
PHY_EXTENSION_SET_802_15_4_MODE /**< Set IEEE 802.15.4 mode as defined by phy_802_15_4_mode_t*/
8586
} phy_extension_type_e;
8687

source/MAC/IEEE802_15_4/mac_mlme.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,11 @@ int8_t mac_mlme_set_req(protocol_interface_rf_mac_setup_s *rf_mac_setup, const m
807807
memcpy(rf_mac_setup->coord_long_address, set_req->value_pointer, 8);
808808
}
809809
return 0;
810+
case macSetDataWhitening:
811+
pu8 = (uint8_t *) set_req->value_pointer;
812+
rf_mac_setup->dev_driver->phy_driver->extension(PHY_EXTENSION_SET_DATA_WHITENING, pu8);
813+
tr_debug("%s data whitening", *pu8 == (bool) true ? "Enable" : "Disable");
814+
return 0;
810815
case macCCAThresholdStart:
811816
pu8 = (uint8_t *) set_req->value_pointer;
812817
mac_cca_thr_init(rf_mac_setup, *pu8, *((int8_t *)pu8 + 1), *((int8_t *)pu8 + 2), *((int8_t *)pu8 + 3));

0 commit comments

Comments
 (0)