|
82 | 82 | OT_RADIO_LQI_NONE = 0, ///< LQI measurement not supported |
83 | 83 | OT_RADIO_RSSI_INVALID = 127, ///< Invalid or unknown RSSI value |
84 | 84 | OT_RADIO_POWER_INVALID = 127, ///< Invalid or unknown power value |
| 85 | + |
| 86 | + OT_RADIO_INVALID_SHORT_ADDR = 0xfffe, ///< Invalid short address. |
| 87 | + OT_RADIO_BROADCAST_SHORT_ADDR = 0xffff, ///< Broadcast short address. |
85 | 88 | }; |
86 | 89 |
|
87 | 90 | /** |
@@ -120,17 +123,18 @@ typedef uint16_t otRadioCaps; |
120 | 123 | */ |
121 | 124 | enum |
122 | 125 | { |
123 | | - OT_RADIO_CAPS_NONE = 0, ///< Radio supports no capability. |
124 | | - OT_RADIO_CAPS_ACK_TIMEOUT = 1 << 0, ///< Radio supports AckTime event. |
125 | | - OT_RADIO_CAPS_ENERGY_SCAN = 1 << 1, ///< Radio supports Energy Scans. |
126 | | - OT_RADIO_CAPS_TRANSMIT_RETRIES = 1 << 2, ///< Radio supports tx retry logic with collision avoidance (CSMA). |
127 | | - OT_RADIO_CAPS_CSMA_BACKOFF = 1 << 3, ///< Radio supports CSMA backoff for frame transmission (but no retry). |
128 | | - OT_RADIO_CAPS_SLEEP_TO_TX = 1 << 4, ///< Radio supports direct transition from sleep to TX with CSMA. |
129 | | - OT_RADIO_CAPS_TRANSMIT_SEC = 1 << 5, ///< Radio supports tx security. |
130 | | - OT_RADIO_CAPS_TRANSMIT_TIMING = 1 << 6, ///< Radio supports tx at specific time. |
131 | | - OT_RADIO_CAPS_RECEIVE_TIMING = 1 << 7, ///< Radio supports rx at specific time. |
132 | | - OT_RADIO_CAPS_RX_ON_WHEN_IDLE = 1 << 8, ///< Radio supports RxOnWhenIdle handling. |
133 | | - OT_RADIO_CAPS_TRANSMIT_FRAME_POWER = 1 << 9, ///< Radio supports setting per-frame transmit power. |
| 126 | + OT_RADIO_CAPS_NONE = 0, ///< Radio supports no capability. |
| 127 | + OT_RADIO_CAPS_ACK_TIMEOUT = 1 << 0, ///< Radio supports AckTime event. |
| 128 | + OT_RADIO_CAPS_ENERGY_SCAN = 1 << 1, ///< Radio supports Energy Scans. |
| 129 | + OT_RADIO_CAPS_TRANSMIT_RETRIES = 1 << 2, ///< Radio supports tx retry logic with collision avoidance (CSMA). |
| 130 | + OT_RADIO_CAPS_CSMA_BACKOFF = 1 << 3, ///< Radio supports CSMA backoff for frame tx (but no retry). |
| 131 | + OT_RADIO_CAPS_SLEEP_TO_TX = 1 << 4, ///< Radio supports direct transition from sleep to TX with CSMA. |
| 132 | + OT_RADIO_CAPS_TRANSMIT_SEC = 1 << 5, ///< Radio supports tx security. |
| 133 | + OT_RADIO_CAPS_TRANSMIT_TIMING = 1 << 6, ///< Radio supports tx at specific time. |
| 134 | + OT_RADIO_CAPS_RECEIVE_TIMING = 1 << 7, ///< Radio supports rx at specific time. |
| 135 | + OT_RADIO_CAPS_RX_ON_WHEN_IDLE = 1 << 8, ///< Radio supports RxOnWhenIdle handling. |
| 136 | + OT_RADIO_CAPS_TRANSMIT_FRAME_POWER = 1 << 9, ///< Radio supports setting per-frame transmit power. |
| 137 | + OT_RADIO_CAPS_ALT_SHORT_ADDR = 1 << 10, ///< Radio supports setting alternate short address. |
134 | 138 | }; |
135 | 139 |
|
136 | 140 | #define OT_PANID_BROADCAST 0xffff ///< IEEE 802.15.4 Broadcast PAN ID |
@@ -517,6 +521,26 @@ void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aE |
517 | 521 | */ |
518 | 522 | void otPlatRadioSetShortAddress(otInstance *aInstance, otShortAddress aShortAddress); |
519 | 523 |
|
| 524 | +/** |
| 525 | + * Set the alternate short address. |
| 526 | + * |
| 527 | + * This is an optional radio platform API. The radio platform MUST indicate support for this API by including the |
| 528 | + * capability `OT_RADIO_CAPS_ALT_SHORT_ADDR` in `otPlatRadioGetCaps()`. |
| 529 | + * |
| 530 | + * When supported, the radio should accept received frames destined to the specified alternate short address in |
| 531 | + * addition to the short address provided in `otPlatRadioSetShortAddress()`. |
| 532 | + * |
| 533 | + * The @p aShortAddress can be set to `OT_RADIO_INVALID_SHORT_ADDR` (0xfffe) to clear any previously set alternate |
| 534 | + * short address. |
| 535 | + * |
| 536 | + * This function is used by OpenThread stack during child-to-router role transitions, allowing the device to continue |
| 537 | + * receiving frames addressed to its previous short address for a short period. |
| 538 | + * |
| 539 | + * @param[in] aInstance The OpenThread instance structure. |
| 540 | + * @param[in] aShortAddress The alternate IEEE 802.15.4 short address. `OT_RADIO_INVALID_SHORT_ADDR` to clear. |
| 541 | + */ |
| 542 | +void otPlatRadioSetAlternateShortAddress(otInstance *aInstance, otShortAddress aShortAddress); |
| 543 | + |
520 | 544 | /** |
521 | 545 | * Get the radio's transmit power in dBm. |
522 | 546 | * |
|
0 commit comments