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.

HCI commands needed to setup peripheral

Other Parts Discussed in Thread: CC2540

Hi

What HCI commands are required to be able to setup a simple BLE peripheral advertising, connecting and having one or two characteristics or services that can be read from or written to? The Btool is great for seeing how to setup a master, but I am unable to find any examples or illustrations on setting up a peripheral. I have tried some cionfigurations and initialisations, but cant even get my CC2540 to advertise so that a central can see it.

Any help will greatly be appreciated

Regards

Tielman

  • Oh, and I am running the hostTestRelease on my CC2540 using a SmartRF05 EK

  • Hi Tielman,

    You will find the steps you are looking for in this post: http://e2e.ti.com/support/low_power_rf/f/538/p/187762/732079.aspx#732079. Essentially you need to issue three commands from the Adv. commands tab of BTool:

    • GAP_DeviceInit, set profileRole to Peripheral and hit Send Command
    • GAP_UpdateAdvertisingData, set adType toGAPADVERT_ADVERTISEMENT_DATA and set dataLen to 3 and hit Send Command.
    • GAP_MakeDiscoverable, make sure that you see the available options for it (no need to make changes) and hit Send Command.

    Best Regards

  • Hi Nick

    Thank you very much, that worked 100%

    Best Regards

    Tielman

  • Hi Nick

    Just for the sake of future reader of this post or anyone else that come across this request, I did initially follow these steps exactly the same, but could not get it to work. After looking at the serial protocol of BTool vs. what I used according to the "TI_BLE_Vendor_Specific_HCI_Guide.pdf". The only difference that I found was the last step where the above mentioned document shows the "12.5 GAP Make Discoverable" command to have a data length of of 10 octets, where the BTool added an additional 4 "00" 's to the end. Adding these four octets to my original design got it working as well.

    I downloaded this document last week from the BLE stack download. Is there a more updated version of this doc that I can get somewhere? What is the function of these additional octets added at the end?

    Sincere Thanks