BGAPI Types#

Common types in BGAPI protocol.

Modules#

uint8array

byte_array_s

bd_addr

uuid_128

aes_key_128

sl_bt_uuid_16_t

sl_bt_uuid_64_t

Typedefs#

typedef struct byte_array_s

Macros#

#define

The length of a BGAPI message header which is 4 bytes.

#define

The length of the BGAPI message payload of a generic error response.

#define

Get the device type of a BGAPI message.

#define

Get the identifier of a BGAPI message including device type, class ID, message type and message ID.

#define

The maximum value the BGAPI header payload length field can store.

#define

Get the data payload length in a BGAPI message.

#define

The bit indicating whether data of a BGAPI message is encrypted.

#define

Check whether data of a BGAPI message is encrypted.

#define

Construct a BGAPI message header from an event ID and payload length.

Typedef Documentation#

byte_array#

typedef struct byte_array_s byte_array

Macro Definition Documentation#

SL_BT_TYPE_UINT8ARRARY#

#define SL_BT_TYPE_UINT8ARRARY

SL_BT_TYPE_BYTE_ARRARY#

#define SL_BT_TYPE_BYTE_ARRARY

SL_BT_TYPE_BDADDR#

#define SL_BT_TYPE_BDADDR

SL_BT_TYPE_UUID128#

#define SL_BT_TYPE_UUID128

SL_BT_TYPE_AES_KEY128#

#define SL_BT_TYPE_AES_KEY128

SL_BT_TYPE_UUID16#

#define SL_BT_TYPE_UUID16

SL_BT_TYPE_UUID64#

#define SL_BT_TYPE_UUID64

SL_BGAPI_MSG_HEADER_LEN#

#define SL_BGAPI_MSG_HEADER_LEN
Value:
(4)

The length of a BGAPI message header which is 4 bytes.


SL_BGAPI_MSG_ERROR_PAYLOAD_LEN#

#define SL_BGAPI_MSG_ERROR_PAYLOAD_LEN
Value:
(2)

The length of the BGAPI message payload of a generic error response.

See function sl_bgapi_set_error_response for how to generate a generic error response.


SL_BGAPI_MSG_DEVICE_TYPE#

#define SL_BGAPI_MSG_DEVICE_TYPE
Value:
(HDR)

Get the device type of a BGAPI message.


SL_BGAPI_MSG_ID#

#define SL_BGAPI_MSG_ID
Value:
(HDR)

Get the identifier of a BGAPI message including device type, class ID, message type and message ID.


SL_BGAPI_HEADER_MAX_PAYLOAD_LEN#

#define SL_BGAPI_HEADER_MAX_PAYLOAD_LEN
Value:
(0x7FF)

The maximum value the BGAPI header payload length field can store.


SL_BGAPI_MSG_LEN#

#define SL_BGAPI_MSG_LEN
Value:
(HDR)

Get the data payload length in a BGAPI message.


SL_BGAPI_BIT_ENCRYPTED#

#define SL_BGAPI_BIT_ENCRYPTED
Value:
(1 << 6)

The bit indicating whether data of a BGAPI message is encrypted.


SL_BGAPI_MSG_ENCRYPTED#

#define SL_BGAPI_MSG_ENCRYPTED
Value:
(HDR)

Check whether data of a BGAPI message is encrypted.


SL_BGAPI_MSG_HEADER_FROM_ID_AND_LEN#

#define SL_BGAPI_MSG_HEADER_FROM_ID_AND_LEN
Value:
((uint32_t) (((uint32_t) (evt_id)) \
| (((uint32_t) (payload_len) & 0x00FF) << 8) \
| (((uint32_t) (payload_len) & 0x0700) >> 8))) \

Construct a BGAPI message header from an event ID and payload length.

It is the caller's responsibility to verify that the input values are within valid range.

Returns

  • The header as a uint32_t value