Skip to main content
allard
Senior
January 17, 2022
Question

BlueNRG advertise while having a connection

  • January 17, 2022
  • 2 replies
  • 1257 views

I'm trying to create a peripheral device that allows one Bluetooth central to connect to it, this part is working. Now I want the device to re-start advertisements when a central has made a connection. The advertisements should be non-connectable one's in this case, so I'm not trying to create a device that allows multiple concurrent connections.

I was assuming this would be as simple as just restarting the advertisements with:

 ret = aci_gap_set_discoverable(ADV_NONCONN_IND, 160, 160, PUBLIC_ADDR,NO_WHITE_LIST_USE, 0, NULL, 0, NULL, 0, 0); 

after the connection has been made, so after a call to hci_le_connection_complete_event, but the function returns 0x0C -> BLE_ERROR_COMMAND_DISALLOWED. What am I doing wrong? Why is the command not allowed?

This topic has been closed for replies.

2 replies

allard
allardAuthor
Senior
January 27, 2022

Anyone here?

AndyR1
Senior
February 4, 2022

Hello,

I don't know if it's possible, but if yes look for aci_gap_init(), with the gap roles

/**
 * @anchor gap_roles
 * @name GAP Roles
 * @{
*/
#define GAP_PERIPHERAL_ROLE (0x01)
#define GAP_BROADCASTER_ROLE (0x02)
#define GAP_CENTRAL_ROLE (0x04)
#define GAP_OBSERVER_ROLE (0x08)