Hi,
I have a BLE characteristic that is available in READ / NOTIFY mode.
我使用一个定制的ble_peripheral_app的基地my tests.
//characteristic
ble_uuid_from_string(xxx_UUID, &uuid);
ble_gatts_add_characteristic(&uuid, GATT_PROP_NOTIFY | GATT_PROP_READ, ATT_PERM_READ,
xxx_SIZE, 0, NULL, &service->xxx);
//descriptor
ble_uuid_create16(UUID_GATT_CLIENT_CHAR_CONFIGURATION, &uuid);
ble_gatts_add_descriptor(&uuid, ATT_PERM_RW, sizeof(uint16_t), 0,
&service->xxx_desc);
On a regular basis I am updating this value
if (m_conn_idx != BLE_CONN_IDX_INVALID) {
ble_gatts_send_event(m_conn_idx, type, GATT_EVENT_NOTIFICATION,
xxx_SIZE, &data);
}
Notification and read are working well for the first 30 seconds then my android application is disconnected.
I am using a setup similar to wrbl project for BLE configuration
#define BLE_ADV_INTERVAL (320)
#define BLE_CONN_FAST_INTV_MAX (15)
#define BLE_CONN_FAST_INTV_MIN (15)
#define BLE_CONN_SLOW_INTV_MAX (520)
#define BLE_CONN_SLOW_INTV_MIN (480)
#define BLE_MTU_SIZE (131)
Any idea on which setting I need to modify to ensure I can read my notification more than 30 seconds?
Thanks a lot,
Hi BVR,
If you android device gets disconnected then you will have to check the reason of the disconnection, for starters, you will have to check if the device is still operational when you get the disconnection. Are you able to see the device advertising right after the disconnection from the device occurs ? If the device is still operational you will have to check the reason of the disconnection, so when the disconnection occurs you should get a BLE_EVT_GAP_DISCONNECTED the event comes with a reason for the disconnection, so checking the reason is a start to debug this.
Thanks MT_dialog
Thanks for your reply.
Based on the following test:
- ble_peripheral project from DA1468x_DA15xxx_SDK_1.0.12.1078.zip
- DA14681 Development Kit - Pro
- updates as in ble_peripheral_task.c (see attachment). Custom part is in the #if CFG_USER_SERVICE part to ease the debug + handle_evt_gap_connected method
- notification reader application : B-BLE android (https://play.google.com/store/apps/details?id=com.billy.billylightblue) for testing my characteristic (also tested with our own software).
- I do not have the problem with the notifications from wrbl firmware.
I still have the disconnect issue 0x13 :
Name : evt
Details:0x7fd36f0
Hex:0x7fd36f0
Name : hdr
Details:{evt_code = 258, length = 10}
Name : evt_code
Details:258
Hex:0x102
Name : length
Details:10
Hex:0xa
Name : conn_idx
Details:0
Hex:0x0
Name : address
Details:{addr_type = PRIVATE_ADDRESS, addr = "çH\217xkr"}
Name : addr_type
Details:PRIVATE_ADDRESS
Hex:0x1
Name : addr
Details:"çH\217xkr"
Hex:0x7fd36f7
Name : reason
Details:19 '\023'
Hex:0x13
Of course, the device is still operational afterward and can be connected again directly.
Thanks for your support.
I just forgot the handle_write_request for the descriptor at the end.
Everything's ok now.
Adding the final sample file might be useful :)
Hi BVR,
Thank you for the indication, also you might want to have a look at the Tutorial section of the 681, there is a tutorial regarding the custom profiles on the 68x family.
Thanks MT_dialog