cancel
Showing results for 
Search instead for 
Did you mean: 

IDB05A1 - What commands are needed to make device discoverable by phone

bjornpaulstrom
Associate III
Posted on February 11, 2017 at 20:12

Hello, I am using a IDB05A1 woth a Nucleo64-F401RE, and writing commands to it via SPI.

I am wondering though, which commands do I need to send to make the device discoverable for other devices?

I tried issuing the Aci_Gap_Set_Discoverable command detailed here: 

http://www.st.com/content/ccc/resource/technical/document/user_manual/6d/a1/5b/6c/dc/ab/48/76/DM00162667.pdf/files/DM00162667.pdf/jcr:content/translations/en.DM00162667.pdf

This is what I send over SPI to the BT device:

0x01, //HCI Command

0xfc, 0x83, //Opcode

0x0f, //Parameter length = 15 

0x00, //Advertising_Event_Type, 0x00: Connectable undirected advertising (default)

0x08, 0x00, //Adv_Interval_Min    Default: N = 0x0800 (1.28 seconds)

0x08, 0x00, //Adv_Interval_Max   Default: N = 0x0800 (1.28 seconds)

0x00, //Address_Type   0x00: Public device address (default)

0x00, //Adv_Filter_Policy  0x00: Allow scan request from any, allow connect request from any (default).

0x02, //Local_Name_Length

0x42, //'B'

0x50, //'P'

0x00, //Service_UUID_Length    If there is no service to be advertised, set this field to 0x00.

0xff, 0xff, //Slave_Conn_Interval_Min   Value of 0xFFFF indicates no specific minimum.

0xff, 0xff //Slave_Conn_Interval_Max   Value of 0xFFFF indicates no specific maximum

And this is the response in hex and int form:

Data(hex):

   0x04    0x0e    0x04    0x01    0x83    0xfc    0x0c

Data(int):

   04    14    04    01    131    252    12

Which according to BT specification: 

https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439

Data(hex):

0x04            -   HCI event

0x0e            -   Command complete

0x04            -   Num_HCI_Command_Packets:

0x01            -   Not mentioned in the spec, what is this?

0x83 0xfc    -   Opcode

0x0c            -   Result, command disallowed

It says command is disallowed.

I send this as my first command, but I am guessing I need to do something else before

Any help is appreciated.

#spi #stm32 #idb05a1 #bluetooth #nucleo-f401
1 ACCEPTED SOLUTION

Accepted Solutions
bjornpaulstrom
Associate III
Posted on February 12, 2017 at 13:01

I managed to solve this, the commands needed to make the device discoverable are:

1. Set BD address

2. Init GATT command

3. Init GAP command

4. Set discoverable

View solution in original post

2 REPLIES 2
bjornpaulstrom
Associate III
Posted on February 12, 2017 at 13:01

I managed to solve this, the commands needed to make the device discoverable are:

1. Set BD address

2. Init GATT command

3. Init GAP command

4. Set discoverable

Posted on December 02, 2017 at 00:13

I have the same problem when setting the device as discoverable after disconnection.