# otRadioAvailability


`#include <openthread/platform/radio.h>`

Represents the radio availability schedule.

## Summary

The radio availability schedule is a periodic map of `mNumSlots` slots, each lasting `mSlotDuration`. The schedule starts at `mStartTime` and repeats every `mNumSlots` slots. The schedule duration (`mNumSlots` multiplied by `mSlotDuration`) MUST NOT be longer than `OT_RADIO_AVAILABILITY_MAX_DURATION_US`.

The bitmaps are MSB-first: slot `i` corresponds to bit `7 - (i % 8)` of byte `i / 8`, i.e., `(bitmap[i / 8] >> (7 - (i % 8))) & 1`. Only the first `mNumSlots` bits of each bitmap are used. The remaining bits SHOULD be set to 0 and are ignored by OpenThread.

In `mAvailableSlots`, a bit value of 1 indicates that the slot is available for Thread, and 0 indicates that it is unavailable (e.g., occupied by BT or 2.4GHz WiFi).

In `mPreferredSlots`, a bit value of 1 indicates that the slot is preferred for Thread, and 0 indicates that it is not preferred. The preferred slots MUST be a subset of the available slots, i.e., a bit MUST be 0 in `mPreferredSlots` if the corresponding bit is 0 in `mAvailableSlots`. OpenThread treats a slot as preferred only if it is set in both bitmaps. If there is no preference among the available slots, `mPreferredSlots` MUST be set to the same value as `mAvailableSlots`.

| ### Public attributes ||
|---|---|
| `https://openthread.io/reference/struct/ot-radio-availability#structot_radio_availability_1ababaa5c47a214c2d8c90f69b16d27241[OT_RADIO_AVAILABILITY_MAX_BITMAP_SIZE]` | `uint8_t` The available radio slots bitmap. |
| `https://openthread.io/reference/struct/ot-radio-availability#structot_radio_availability_1a02157d02c7a29bb6c08b1fe19e8f2150` | `uint8_t` The number of slots. Value 0 indicates always available. |
| `https://openthread.io/reference/struct/ot-radio-availability#structot_radio_availability_1affa691f17b3ea787b1e9ddbbdd11f51e[OT_RADIO_AVAILABILITY_MAX_BITMAP_SIZE]` | `uint8_t` The preferred radio slots bitmap. |
| `https://openthread.io/reference/struct/ot-radio-availability#structot_radio_availability_1ab8c282a6a88db726cb4a523d88cadab4` | `https://openthread.io/reference/group/radio-types#group__radio-types_1gaa0442c7152f84578641925a2df5f87b9` The duration of each slot. |
| `https://openthread.io/reference/struct/ot-radio-availability#structot_radio_availability_1afbc015ac74ba6dbaa6de4433bc2a4f74` | `https://openthread.io/reference/group/radio-types#group__radio-types_1ga4b1723679c73d4b1cb45146bb29e8402` Local radio clock time in microseconds when the schedule starts. |

## Public attributes

### mAvailableSlots

```
uint8_t otRadioAvailability::mAvailableSlots[OT_RADIO_AVAILABILITY_MAX_BITMAP_SIZE]
```
The available radio slots bitmap.

### mNumSlots

```
uint8_t otRadioAvailability::mNumSlots
```
The number of slots. Value 0 indicates always available.

### mPreferredSlots

```
uint8_t otRadioAvailability::mPreferredSlots[OT_RADIO_AVAILABILITY_MAX_BITMAP_SIZE]
```
The preferred radio slots bitmap.

### mSlotDuration

```
otRadioAvailabilitySlotDuration otRadioAvailability::mSlotDuration
```
The duration of each slot.

### mStartTime

```
otRadioTime64 otRadioAvailability::mStartTime
```
Local radio clock time in microseconds when the schedule starts.

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).