hi
Does a simple BLE peripheral can be connected and still send a 'non-connectable advertising'?
When the peripheral is not connected, it will send the 'connectable advertising' as before the connectionn started
Thanks
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
hi
Does a simple BLE peripheral can be connected and still send a 'non-connectable advertising'?
When the peripheral is not connected, it will send the 'connectable advertising' as before the connectionn started
Thanks
Hi
Thanks for the quick answer,
But, I already defined PLUS_BROADCASTER and nothing changed, it still not sending any thing
The code added is mainly:
in case GAPROLE_CONNECTED:
#ifdef PLUS_BROADCASTER
// Only turn advertising on for this state when we first connect
// otherwise, when we go from connected_advertising back to this state
// we will be turning advertising back on.
if (firstConnFlag == false)
{
uint8_t advertEnabled = FALSE; // Turn on Advertising
// Disable connectable advertising.
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t),
&advertEnabled);
// Set to true for non-connectabel advertising.
advertEnabled = TRUE;
// Enable non-connectable advertising.
GAPRole_SetParameter(GAPROLE_ADV_NONCONN_ENABLED, sizeof(uint8_t),
&advertEnabled);
firstConnFlag = true;
}
#endif // PLUS_BROADCASTER
AND
#ifdef PLUS_BROADCASTER
/* After a connection is dropped a device in PLUS_BROADCASTER will continue
* sending non-connectable advertisements and shall sending this change of
* state to the application. These are then disabled here so that sending
* connectable advertisements can resume.
*/
case GAPROLE_ADVERTISING_NONCONN:
{
uint8_t advertEnabled = FALSE;
// Disable non-connectable advertising.
GAPRole_SetParameter(GAPROLE_ADV_NONCONN_ENABLED, sizeof(uint8_t),
&advertEnabled);
advertEnabled = TRUE;
// Enabled connectable advertising.
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t),
&advertEnabled);
// Reset flag for next connection.
firstConnFlag = false;
SimpleBLEPeripheral_freeAttRsp(bleNotConnected);
}
break;
#endif //PLUS_BROADCASTER
Although the code set the GAPROLE_ADV_NONCONN_ENABLED to TRUE, the code do advertise anything while connected, and the code never reach the case GAPROLE_ADVERTISING_NONCONN - is something missing?
BTW - I'm working on CC2640
Thanks
Asher
Hi
Yes, I'm using simpleBLEPeripheral.
The code above is from this project, the PLUS_BROADCASTER didn't solve me the problem, GAPROLE_ADV_NONCONN_ENABLED=true OR GAPROLE_ADVERT_ENABLED = true , didn't help me to advertise while the peripheral is connected
Thanks
Asher