NimBLE-Arduino 2.1.2
|
Macros | |
#define | BLE_ATT_OP_ERROR_RSP 0x01 |
#define | BLE_ATT_OP_READ_MULT_VAR_REQ 0x20 |
#define | BLE_ATT_OP_READ_MULT_VAR_RSP 0x21 |
#define | BLE_ATT_MTU_DFLT 23 |
#define | BLE_ATT_MTU_MAX 527 |
Functions | |
int | ble_att_svr_read_local (uint16_t attr_handle, struct os_mbuf **out_om) |
int | ble_att_svr_write_local (uint16_t attr_handle, struct os_mbuf *om) |
uint16_t | ble_att_mtu (uint16_t conn_handle) |
uint16_t | ble_att_preferred_mtu (void) |
int | ble_att_set_preferred_mtu (uint16_t mtu) |
#define BLE_ATT_MTU_DFLT 23 |
Default ATT MTU. Also the minimum.
#define BLE_ATT_MTU_MAX 527 |
An ATT MTU of 527 allows the largest ATT command (signed write) to contain a 512-byte attribute value.
#define BLE_ATT_OP_ERROR_RSP 0x01 |
Error Response.
#define BLE_ATT_OP_READ_MULT_VAR_REQ 0x20 |
Read Multiple Variable Lenght Request
#define BLE_ATT_OP_READ_MULT_VAR_RSP 0x21 |
Read Multiple Variable Lenght Response
uint16_t ble_att_mtu | ( | uint16_t | conn_handle | ) |
Retrieves the ATT MTU of the specified connection. If an MTU exchange for this connection has occurred, the MTU is the lower of the two peers' preferred values. Otherwise, the MTU is the default value of 23.
conn_handle | The handle of the connection to query. |
uint16_t ble_att_preferred_mtu | ( | void | ) |
Retrieves the preferred ATT MTU. This is the value indicated by the device during an ATT MTU exchange.
int ble_att_set_preferred_mtu | ( | uint16_t | mtu | ) |
Sets the preferred ATT MTU; the device will indicate this value in all subsequent ATT MTU exchanges. The ATT MTU of a connection is equal to the lower of the two peers' preferred MTU values. The ATT MTU is what dictates the maximum size of any message sent during a GATT procedure.
The specified MTU must be within the following range: [23, BLE_ATT_MTU_MAX]. 23 is a minimum imposed by the Bluetooth specification; BLE_ATT_MTU_MAX is a NimBLE compile-time setting.
mtu | The preferred ATT MTU. |
int ble_att_svr_read_local | ( | uint16_t | attr_handle, |
struct os_mbuf ** | out_om | ||
) |
Reads a locally registered attribute. If the specified attribute handle corresponds to a GATT characteristic value or descriptor, the read is performed by calling the registered GATT access callback.
attr_handle | The 16-bit handle of the attribute to read. |
out_om | On success, this is made to point to a newly-allocated mbuf containing the attribute data read. |
int ble_att_svr_write_local | ( | uint16_t | attr_handle, |
struct os_mbuf * | om | ||
) |
Writes a locally registered attribute. This function consumes the supplied mbuf regardless of the outcome. If the specified attribute handle corresponds to a GATT characteristic value or descriptor, the write is performed by calling the registered GATT access callback.
attr_handle | The 16-bit handle of the attribute to write. |
om | The value to write to the attribute. |