# Steering Data

# Steering Data

This module includes helper functions for the MeshCoP Steering Data.

## Summary

All the functions in this header require `OPENTHREAD_CONFIG_MESHCOP_STEERING_DATA_API_ENABLE` to be enabled.

| ### Typedefs ||
|---|---|
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1gac8fb951ebcdf31912d821a3021e71c1c` | typedef `struct https://openthread.io/reference/struct/ot-steering-data` Represents the steering data. |

| ### Functions ||
|---|---|
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1gaae8f40bf3b84d32b8f96a9f4f0792677(const https://openthread.io/reference/struct/ot-steering-data *aSteeringData, const https://openthread.io/reference/struct/ot-joiner-discerner *aDiscerner)` | `bool` Checks if the Steering Data contains a Joiner Discerner. |
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1gac49ca7d8a4aef78d7d3c8ae843266dc3(const https://openthread.io/reference/struct/ot-steering-data *aSteeringData, const https://openthread.io/reference/struct/ot-ext-address *aJoinerId)` | `bool` Checks if the Steering Data contains a Joiner ID. |
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1ga77390d3eca250ad6ba8e00dde338e63f(https://openthread.io/reference/struct/ot-steering-data *aSteeringData, uint8_t aLength)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Initializes the Steering Data. |
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1gafe7d78fafdbeaebbf274c8fb29320d2c(const https://openthread.io/reference/struct/ot-steering-data *aSteeringData)` | `bool` Checks if the Steering Data is empty. |
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1ga6a82a966fdfe752b1032e403d85ab74e(const https://openthread.io/reference/struct/ot-steering-data *aSteeringData)` | `bool` Checks whether the Steering Data has a valid length. |
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1gaf3976fb1a0b2ed0eef18b4e6c425428b(https://openthread.io/reference/struct/ot-steering-data *aSteeringData, const https://openthread.io/reference/struct/ot-steering-data *aOtherSteeringData)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Merges two Steering Data bloom filters. |
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1gaf6081d31288926a6495811f547e66784(const https://openthread.io/reference/struct/ot-steering-data *aSteeringData)` | `bool` Checks if the Steering Data permits all joiners. |
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1ga560924b3919956c402f8e54d537d9556(https://openthread.io/reference/struct/ot-steering-data *aSteeringData)` | `void` Sets the Steering Data to permit all joiners. |
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1ga5947840c12242564050af0b9292733e5(https://openthread.io/reference/struct/ot-steering-data *aSteeringData, const https://openthread.io/reference/struct/ot-joiner-discerner *aDiscerner)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Updates the Steering Data's bloom filter with a Joiner Discerner. |
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1ga138d9b908fefabbce4f28ea308c22d4d(https://openthread.io/reference/struct/ot-steering-data *aSteeringData, const https://openthread.io/reference/struct/ot-ext-address *aJoinerId)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Updates the Steering Data's bloom filter with a Joiner ID. |

| ### Macros ||
|---|---|
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1ga1ebabebe4437a27d5b3c9b070fa15b2f 16` | Max Steering Data length (bytes) |
| `https://openthread.io/reference/group/api-steering-data#group__api-steering-data_1ga62088ff857d774c9eb0a6c877eafd1c5 1` | Min Steering Data length (bytes) |

| ### Structs ||
|---|---|
| [otSteeringData](https://openthread.io/reference/struct/ot-steering-data) | Represents the steering data. |

## Typedefs

### otSteeringData

```
struct otSteeringData otSteeringData
```
Represents the steering data.

## Functions

### otSteeringDataContainsDiscerner

```
bool otSteeringDataContainsDiscerner(
  const otSteeringData *aSteeringData,
  const otJoinerDiscerner *aDiscerner
)
```
Checks if the Steering Data contains a Joiner Discerner.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aSteeringData` | The Steering Data to check. | | `[in] aDiscerner` | The Joiner Discerner. | |
| Return Values | |---|---| | `TRUE` | If the Steering Data contains the Joiner Discerner. | | `FALSE` | If the Steering Data does not contain the Joiner Discerner. | |

### otSteeringDataContainsJoinerId

```
bool otSteeringDataContainsJoinerId(
  const otSteeringData *aSteeringData,
  const otExtAddress *aJoinerId
)
```
Checks if the Steering Data contains a Joiner ID.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aSteeringData` | The Steering Data to check. | | `[in] aJoinerId` | The Joiner ID. | |
| Return Values | |---|---| | `TRUE` | If the Steering Data contains the Joiner ID. | | `FALSE` | If the Steering Data does not contain the Joiner ID. | |

### otSteeringDataInit

```
otError otSteeringDataInit(
  otSteeringData *aSteeringData,
  uint8_t aLength
)
```
Initializes the Steering Data.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[out] aSteeringData` | The Steering Data to initialize. | | `[in] aLength` | The length of the Steering Data in bytes. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully initialized the Steering Data. | | `OT_ERROR_INVALID_ARGS` | The `aLength` is invalid. | |

### otSteeringDataIsEmpty

```
bool otSteeringDataIsEmpty(
  const otSteeringData *aSteeringData
)
```
Checks if the Steering Data is empty.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aSteeringData` | The Steering Data to check. | |
| Return Values | |---|---| | `TRUE` | If the Steering Data is empty. | | `FALSE` | If the Steering Data is not empty. | |

### otSteeringDataIsValid

```
bool otSteeringDataIsValid(
  const otSteeringData *aSteeringData
)
```
Checks whether the Steering Data has a valid length.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aSteeringData` | The Steering Data to check. | |
| Return Values | |---|---| | `TRUE` | If the Steering Data's length is valid. | | `FALSE` | If the Steering Data's length is not valid. | |

### otSteeringDataMerge

```
otError otSteeringDataMerge(
  otSteeringData *aSteeringData,
  const otSteeringData *aOtherSteeringData
)
```
Merges two Steering Data bloom filters.

The `aOtherSteeringData` must have a length that is a divisor of the `aSteeringData` length.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[out] aSteeringData` | The Steering Data to merge into. | | `[in] aOtherSteeringData` | The other Steering Data to merge from. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully merged the Steering Data. | | `OT_ERROR_INVALID_ARGS` | The Steering Data lengths are not valid or they cannot be merged. | |

### otSteeringDataPermitsAllJoiners

```
bool otSteeringDataPermitsAllJoiners(
  const otSteeringData *aSteeringData
)
```
Checks if the Steering Data permits all joiners.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aSteeringData` | The Steering Data to check. | |
| Return Values | |---|---| | `TRUE` | If the Steering Data permits all joiners. | | `FALSE` | If the Steering Data does not permit all joiners. | |

### otSteeringDataSetToPermitAllJoiners

```
void otSteeringDataSetToPermitAllJoiners(
  otSteeringData *aSteeringData
)
```
Sets the Steering Data to permit all joiners.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[out] aSteeringData` | The Steering Data to update. | |

### otSteeringDataUpdateWithDiscerner

```
otError otSteeringDataUpdateWithDiscerner(
  otSteeringData *aSteeringData,
  const otJoinerDiscerner *aDiscerner
)
```
Updates the Steering Data's bloom filter with a Joiner Discerner.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[out] aSteeringData` | The Steering Data to update | | `[in] aDiscerner` | The Joiner Discerner to add. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully updated the Steering Data. | | `OT_ERROR_INVALID_ARGS` | The Steering Data is not valid (incorrect length). | |

### otSteeringDataUpdateWithJoinerId

```
otError otSteeringDataUpdateWithJoinerId(
  otSteeringData *aSteeringData,
  const otExtAddress *aJoinerId
)
```
Updates the Steering Data's bloom filter with a Joiner ID.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[out] aSteeringData` | The Steering Data to update. | | `[in] aJoinerId` | The Joiner ID to add. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully updated the Steering Data. | | `OT_ERROR_INVALID_ARGS` | The Steering Data is not valid (incorrect length). | |

## Macros

### OT_STEERING_DATA_MAX_LENGTH

```
 OT_STEERING_DATA_MAX_LENGTH 16
```
Max Steering Data length (bytes)

### OT_STEERING_DATA_MIN_LENGTH

```
 OT_STEERING_DATA_MIN_LENGTH 1
```
Min Steering Data length (bytes)

## 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).