2024-02-21 03:20 AM
Hello,
i need to configure the same device as Server, Client and observer simultaneously
is it right to initialise like this ?
//GAP Init
uint8_t bluetooth_role = 0;
bluetooth_role |= GAP_PERIPHERAL_ROLE;
bluetooth_role |= GAP_CENTRAL_ROLE;
bluetooth_role |= GAP_OBSERVER_ROLE;
ret = aci_gap_init(bluetooth_role, 0x00, sizeof(device_name), &generic_service_handle, &dev_name_char_handle, &appearance_char_handle);
and what is the rule to manage scanning and advertising intervals ?
Thank you,
Sincerely.
2024-05-16 02:21 AM
i use finaly just Server and Client
uint8_t bluetooth_role = 0;
bluetooth_role |= GAP_PERIPHERAL_ROLE;
bluetooth_role |= GAP_CENTRAL_ROLE;
ret = aci_gap_init(bluetooth_role, 0x00, sizeof(device_name), &generic_service_handle, &dev_name_char_handle, &appearance_char_handle);
i have 4 slave to connect with them, for every slave :
ret = aci_gap_create_connection(SCAN_P, SCAN_L,
0x00, //0x00 Public Device Address
bdadrr,
PUBLIC_ADDR, 160, 240, 0, 500, 10 , 40);
for server :
hci_le_set_scan_response_data(0,NULL);
//Set General Discoverable Mode
ret = aci_gap_set_discoverable(ADV_DATA_TYPE,
ADV_INTERV_MIN, ADV_INTERV_MAX,
PUBLIC_ADDR,
NO_WHITE_LIST_USE,
(ble_device_name_len+1), local_name, 0, NULL, 0, 0);
.....
macros :
#define SCAN_P 2048
#define SCAN_L 1024
#define ADV_INTERV_MIN 512
#define ADV_INTERV_MAX 1024
for connection every think is ok,
the connection/disconnection of all devices can be maintained and work correctly if don't make any data transfer
but when i start the data transfer (for know just from the BlueNRG to mobile app), i have the most of time issues !
and the device disconnect without receiving
hci_disconnection_complete_event
Note : if i don't have a connection with the slaves, the data transfer from the BlueNRG to the mobile app work without any problem
is there is something to adjust of intervals ?