Connectable vs. nonconnectable Advertisements.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Dear WICED BLE Forum,

According to "Bluetooth Low Energy: The Developer's Handbook", page 81, there are seven types of advertising packets:

ADV_IND, ADV_DIRECT_IND, ADV_NONCONN_IND, ADV_SCAN_IND, SCAN_REQ, SCAN_RSP, CONNECT_REQ.

How may I generate ADV_NONCONN_IND or ADV_SCAN_IND in my WICED-Smart application?  In particular I would

like to advertise/broadcast dynamic information at a low data rate while I am connected to a central device. 

--Blake.

0 Likes
1 Solution
Anonymous
Not applicable

Hello Blake,

We have several Apps in our SDK 2.1 that show the types of Advertising Packets:

Hello_Sensor is a Connectable Advertisement as you might have guessed.  It can also send Notifications and Indications from the Peripheral.

We also have a my_beacon app that uses a Non-connectable undirected advertisement.

We have an ibeacon_device with hard-coded UUID, Major/Minor Numbers and Xmit Power and you can easily advertise as a beacon and be in a connection with a Central to send dynamic data as you would with hello_sensor.c App.

But hello_sensor is a great place to start.

Hope this helps

JT

View solution in original post

4 Replies
Anonymous
Not applicable

Hello Blake,

We have several Apps in our SDK 2.1 that show the types of Advertising Packets:

Hello_Sensor is a Connectable Advertisement as you might have guessed.  It can also send Notifications and Indications from the Peripheral.

We also have a my_beacon app that uses a Non-connectable undirected advertisement.

We have an ibeacon_device with hard-coded UUID, Major/Minor Numbers and Xmit Power and you can easily advertise as a beacon and be in a connection with a Central to send dynamic data as you would with hello_sensor.c App.

But hello_sensor is a great place to start.

Hope this helps

JT

Anonymous
Not applicable

Thank you J.T., that is an excellent and concise example which emits a non-connectable undirected advertisement.  However, I would like to have more information about the blecm_startAdv() function, which seems to be key to this application.  I'm wondering whether I may call it while connected as a peripheral device, and about any caveats or requirements for using it properly.  I'm also very curious about the blecm_generate_advCb() function.  When should I call it?

--Blake.

0 Likes

blecm_startAdv() and its parameters map to BT spec Set Advertising Parameters and Set Advertise Enable.

/// \param advType Type of advertisement.  0 : ADV_IND; 1 : ADV_DIRECT_IND; 2 : ADV_SCAN_IND; 3 : ADV_NONCONN_IND; others are invalid.

/// \param adcInterval Min and Max advertisement interval in BT slots. Min = 20mS; Max = 10.24s. Not valid for ADV_DIRECT_IND

/// \param advChannel  Mask of channels to advertise (bitwise set to enable). 1 = Ch 37; 2 = Ch 38; 4 = Ch 39.

/// \param advAdrType Own address type. 0 : Public; 1 : Random device address; Others are reserved.

/// \param advFilterPolicy ADV filter policy. 0 : Allow scan and connect from any; 1 : Allow scan from whitelist, connect from any; 2 : Allow scan from any, connect from whitelist; 3 : Allow scan and connect from whitelist only.

/// \param initiatorAdrType Direct address type. 0 : Public; 1 : Random device address; Others are reserved.

/// \param initiatorAdr Address of the device to be connected when ADV_DIRECT_IND

void blecm_startAdv(int advType,  int advInterval, int advChannel, int advAdrType, int advFilterPolicy, int initiatorAdrType, UINT8 *initiatorAdr );

blecm_generate_advCb() is a test function that got left in the ROM. It does not do serve any useful purpose as far as I can tell.

EDIT: Add more responses below. I forgot that ^S posts instead of saving.

> I 'm wondering whether I may call it while connected as a peripheral device, and about any caveats or requirements for using it properly.

Yes, but you need to do a few things before that. Like calling blecm_enableConMux(if you intend to do connectable advs) and blecm_enablescatternet(). See hello_client sample app. The other thing to keep in mind is that bleprofile_Discoverable() uses this in its state machine. So if you use blecm_startAdv(), don't use bleprofile_Discoverable() .

Anonymous
Not applicable

Thank you so much.  I appreciate your quick and detailed response.  We will be sure to call blecm_enableConMux if we send connectable advertisements while in a connection.  Our plan is to send connectable advertisements only while not in a connection, so we will not call blecm_enableConMux unless that plan changes.