samples: Bluetooth: peripheral: add MTU callback
Add a demonstration of the updated ATT MTU callback to the Bluetooth peripheral sample. Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This commit is contained in:
parent
43b2400688
commit
cea80d0ccb
1 changed files with 10 additions and 0 deletions
|
@ -230,6 +230,15 @@ static const struct bt_data ad[] = {
|
|||
0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12),
|
||||
};
|
||||
|
||||
void mtu_updated(struct bt_conn *conn, uint16_t tx, uint16_t rx)
|
||||
{
|
||||
printk("Updated MTU: TX: %d RX: %d bytes\n", tx, rx);
|
||||
}
|
||||
|
||||
static struct bt_gatt_cb gatt_callbacks = {
|
||||
.att_mtu_updated = mtu_updated
|
||||
};
|
||||
|
||||
static void connected(struct bt_conn *conn, uint8_t err)
|
||||
{
|
||||
if (err) {
|
||||
|
@ -332,6 +341,7 @@ void main(void)
|
|||
|
||||
bt_ready();
|
||||
|
||||
bt_gatt_cb_register(&gatt_callbacks);
|
||||
bt_conn_cb_register(&conn_callbacks);
|
||||
bt_conn_auth_cb_register(&auth_cb_display);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue