2017-02-11 11:12 AM
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:
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 12Which according to BT specification:
https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439
Data(hex):
0x04 - HCI event0x0e - 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-f401Solved! Go to Solution.
2017-02-12 04:01 AM
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
2017-02-12 04:01 AM
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
2017-12-01 04:13 PM
I have the same problem when setting the device as discoverable after disconnection.