Home
UM1755 User manual - STMicroelectronics
Contents
1. Vendor specific commands UM1755 4 3 2 GAP VS Commands Table 17 GAP VS commands Item Command CGID CID OpCode 1 Aci_Gap_Set_Non_Discoverable 0x01 0x01 OxFC81 2 Aci Gap Set Limited Discoverable 0x01 0x02 OxFC82 3 Aci Gap Set Discoverable 0x01 0x03 OxFC83 4 Aci Gap Set Direct Connectable 0x01 0x04 OxFC84 5 Aci Gap Set IO Capability 0x01 0x05 OxFC85 6 Aci Gap Set Auth Requirement 0x01 0x06 OxFC86 7 Aci Gap Set Author Requirement 0x01 0x07 OxFC87 8 Aci Gap Pass Key Response 0x01 0x08 OxFC88 9 Aci Gap Authorization Response 0x01 0x09 OxFC89 10 Aci Gap Init 0x01 OXOA OxFC8A 11 Aci Gap Set Non Connectable 0x01 OxOB OxFC8B 12 Aci Gap Set Undirected Connectable 0x01 OxOC OxFC8C 13 Aci Gap Slave Security request 0x01 OXOD OxFC8D 14 Aci Gap Update Adv Data 0x01 OxOE OxFC8E 15 Aci_Gap_Delete_AD_Type 0x01 OXOF OxFC8F 16 Aci Gap Get Security Level 0x01 0x10 OxFC90 17 Aci Gap Set Event Mask 0x01 0x11 OxFC91 18 Aci Gap Configure WhiteList 0x01 0x12 OxFC92 19 Aci Gap Terminate 0x01 0x13 OxFC93 20 Aci Gap Clear Security Database 0x01 0x14 OxFC94 21 Aci Allow Rebond 0x01 0x15 OxFC95 22 Aci Gap Start Limited Discovery Proc 0x01 0x16 OxFC96 23 Aci Gap Start General Discovery Proc 0x01 0x17 OxFC97 24 Aci Gap Start Name Discovery Proc 0x01 0x18 OxFC98 25 Aci Gap Start Auto Conn Establishment 0x01 0x19 OxFC99 26 Aci Gap Start General Conn Establishment 0x01 Ox1A OxFC9A 27 Aci Gap Start Selective Con
2. Description Post the Read Multiple request Table 197 Aci_Gatt_Read_Multiple_Charac_Values command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given numHandles 1 byte The number of handles for which the value has to be read setOfHandles E The handles for which the attribute value has to be read Table 198 Aci Gatt Read Multiple Charac Values return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Status 1 byte Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt Blue Gatt Procedure Cmplt event is generated Before procedure completion the response packets are given through Evt Blue Att Read Multiple Resp event d DoclD026257 Rev 3 97 131 Vendor specific commands UM1755 4 5 29 Aci_Gatt_Write_Charac_Val Table 199 Aci_Gatt_Write_Charac_Val Command name Parameters Return Connection handle attrHandle Aci Gatt Write Charac Val OXFD1C ValLen Status AttrVal Description Start the procedure to write a characteristic value Table 200
3. 50 Aci Gap Start General Discovery Proc return parameters 50 Aci Gap Start Name Discovery Proc EE EE EE EE EG ee eae 51 Aci Gap Start Name Discovery Proc command parameters EE Es Ese 51 Aci Gap Start Name Discovery Proc return parameters iss Es ee Ee 52 Aci Gap Start Auto Conn Establishment ie EE EE EE Ee se ee ee ee ee ee 53 Aci Gap Start Auto Conn Establishment command parameters 53 Aci Gap Start Auto Conn Establishment return parameters suus 54 Aci Gap Start General Conn Establishment SS SS SS SS eens 55 Aci Gap Start General Conn Establishment command parameters 55 Aci Gap Start General Conn Establishment return parameters 56 Aci Gap Start Selective Conn Establishment SS SS SS SS SS eee 56 Aci Gap Start Selective Conn Establishment command parameters 56 Aci Gap Start General Conn Establishment return parameters 57 Aci Gap Create Comnection 2 ras 58 Aci Gap Create Connection command parameter S SS SS SS eee eee 58 Aci Gap Create Connection return parameters ESE SS SS ees 59 Aci Gap Terminate Gap Procedure 0 SS SS SS EES Se eens 59 Aci Gap Terminate Gap Procedure command parameters SS SS SS SS ee 60 Aci Gap Terminate Gap Procedure return parameterS SS SS SS SS See 60 Aci Gap Start Connection Update
4. Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given attrHandle 2 bytes Handle of the attribute to be written ValOffset 2 bytes Offset at which the attribute has to be written ValLen 1 byte Length of the value to be written AttrVal O N bytes Value to be written Table 210 Aci Gatt Write Long Charac Descriptor return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Status 1 byte Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt_Blue_Gatt_Procedure_Cmplt event is generated Before procedure completion the response packets are given through and Evt_Blue_Att_Prepare_Write_Resp and Evt_Blue_Att_Exec_Write_Resp event d DoclD026257 Rev 3 101 131 Vendor specific commands UM1755 4 5 33 Aci_Gatt_Read_Long_Charac_Descriptor Table 211 Aci_Gatt_Read_Long_Charac_Descriptor Command name Parameters Return Connection handle Aci_Gatt_Read_Long_Charac_Descriptor OxFD20 attrHandle Status valOffset Description Start the procedure to read a long characteristic value Table 212
5. SS SEE EE SS eens 61 DocID026257 Rev 3 Ly UM1755 List of tables Table 101 Aci Gap Start Connection Update command parameters 61 Table 102 Aci Gap Start Connection Update return parameterS nnana SESSE cee ee 62 Table 103 Aci Gap Send Pairing Reguest EE cect 62 Table 104 Aci Gap Send Pairing Request command parameters EE EE EE EE ee 62 Table 105 Aci Gap Send Pairing Request return parameters EE EE EE EE ee ee ee 63 Table 106 Aci Gap Resolve Private AddresS EES ccc eee eens 63 Table 107 Aci Gap Resolve Private Address command parameters 63 Table 108 Aci Gap Resolve Private Address return parameters 63 Table 109 Aci Gap Get Bonded Devices SS SS SE SS SE SS eens 64 Table 110 Aci Gap Get Bonded Devices return parameters SS SES SS SES ee 64 Table 111 GAP VS events sies bos BES DAE DAA Dog NT RR ise PAAR UPS 64 Table 112 Evt Blue Gap Pairing Complete EE EE ES SEE ee ee ee ee 65 Table 113 Evt Blue Pass Key Reduest ii se EE Ee ee ee s 66 Table 114 Evt Blue Authorization Reguest EE EE SE ee ee ee ese 67 Table 115 Evt Blue Gap Device Found 2 EE EE cece eee 67 Table 116 Evt Blue Gap Procedure Complete EE 00 cece eee eee eee 68 Table 117 Evt Blue Gap Reconnection Address 2G 69 Table 118 G
6. 22 2 eee 100 Table 206 Aci Gatt Write Charac Reliable command parameters a 100 Table 207 Aci Gatt Write Charac Reliable return parameters EE EE EE ee ee ee 100 Table 208 Aci Gatt Write Long Charac Descriptor EE SE GE SR ee eee 101 Table 209 Aci Gatt Write Long Charac Descriptor command parameters 101 Table 210 Aci Gatt Write Long Charac Descriptor return parameters 101 Table 211 Aci Gatt Read Long Charac Descriptor aaaea EE EE Ee EE ee 102 Table 212 Aci Gatt Read Long Charac Descriptor command parameters 102 Table 213 Aci Gatt Read Long Charac Descriptor return parameters 102 Table 214 Aci Gatt Write Charac Descriptor EE EE EE 00 cee EE EE ee ee ee ee ee 103 Table 215 Aci Gatt Write Charac Descriptor command parameters EE EE EE Ee 103 Table 216 Aci Gatt Write Charac Descriptor return parameters EE EE EE Ee ee 103 Table 217 Aci Gatt Read Charac DescriptOF EE EE EE EE ee eee 104 Table 218 Aci Gatt Read Charac Descriptor command parameters EE EE Ee 104 Table 219 Aci Gatt Read Charac Descriptor return parameters EE EE EE Ee ee 104 Table 220 Aci Gatt Write Without Response EE EE EE eee eee eee 104 Table 221 Aci Gatt Write Without Response command parameters is EE EE ee 105 Table 222 Aci Gatt Write Without Response return parameters EE SE Ee lu
7. EE EE EE SE EE Ee ee eee 123 Number Of Packet Sent in DirectTX return parameters EE a 123 Toer Stark GE aig uen RE DR ME AE DE MAR EE EE MT eaten De 123 Tone Start command parameters EE EE EE GE Ge eee 124 Tone Start return parameters EE EE ee EE ee tte eee 124 eo eo RE EE OR HE EER ENE 124 Tone Stop return parameters EE GE ee eee eee 124 ak RE OE ER LE OR AR OE FA 125 Document revision history ee EE eee 130 DoclD026257 Rev 3 Ly UM1755 List of figures List of figures Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 d Bluetooth LE system with separate host and controller ies aaa 14 Bluetooth LE system with combined host and controller a 15 BlueNRG ACI architecture llli 15 HCl command packet EE EE ES ee ee Ge ln 16 HCl event packet Es NG besa pasa ERR bed ABALA coeds RE Va ER 18 HCI ACL data packet ie EE EE EE ee ee ee ee le 18 OpCode format for VS CommandsS EE EE EE EE Ge ee eee 21 Event parameter 0 format for VS events EE EE GE teens 22 SPI wire connection 22 ser ug seed ded ba ead Pad DEDE Ad n ER GE dae RR x 126 SPI header format anaana EE EE EE EG eee 127 DoclD026257 Rev 3 13 131 Overview UM1755 14 131 Overview Bluetooth LE technology was adopted by the Bluetooth SIG starting from the Bluetooth core specification v4 0 Bluetooth
8. Information in this document supersedes and replaces information previously supplied in any prior versions of this document 2015 STMicroelectronics All rights reserved d DoclD026257 Rev 3 131 131
9. Table 111 GAP VS events Item Command CGID CID OpCode 1 Evt_Blue_Gap_Limited_Discoverable 0x01 0x00 0x0400 2 Evt Blue Gap Pairing Complete 0x01 0x01 0x0401 3 Evt Blue Pass Key Request 0x01 0x02 0x0402 4 Evt_Blue_Authorization_Request 0x01 0x03 0x0403 5 Evt Blue Slave Security Initiated 0x01 0x04 0x0404 6 Evt_Blue_Gap_Bond_Lost 0x01 0x05 0x0405 7 Evt Blue Gap Device Found 0x01 0x06 0x0406 64 131 DoclD026257 Rev 3 Ly UM1755 Vendor specific commands Table 111 GAP VS events continued Item Command CGID CID OpCode 8 Evt_Blue_Gap_Procedure_Complete 0x01 0x07 0x0407 9 Evt_Blue_Gap_Reconnection_Address 0x01 0x08 0x0408 4 4 1 Evt_Blue_Gap_Limited_Discoverable This event is generated by the controller when the limited discoverable mode ends due to timeout The timeout is 180 seconds 4 4 2 Evt_Blue_Gap_Pairing_Complete This event is generated when the pairing process has completed successfully or a pairing procedure timeout has occurred or the pairing has failed This is to notify the application that we have paired with a remote device so that it can take further actions or to notify that a timeout has occurred so that the upper layer can decide to disconnect the link Table 112 Evt_Blue_Gap_Pairing_Complete Parameter Size Description Event code 2 bytes 0x0401 Connection handle 2 bytes Connection handle on which the pairing procedu
10. This event is generated when the master responds to the connection update request packet with a connection update response packet or a command reject packet Table 14 Evt Blue L2CAP Connection Update Resp Parameter Size Description Event code 2 bytes The event code for connection update response event Connection handle 2bytes Connection handle for which the command is given Datalen 1 byte Length of the data to follow Contains data is in the form described in Bluetooth Core v4 0 vol 3 Part A ch 4 21 Datalen Data bvtes 1 command reject packet if the request was rejected by the y master or 2 connection update response packet d DoclD026257 Rev 3 25 131 Vendor specific commands UM1755 4 2 6 4 2 7 26 131 Evt_Blue_L2CAP_Procedure_Timeout This event is generated when the master does not respond to the connection update request packet with a connection update response packet or a command reject packet within 30 seconds Table 15 Evt_Blue_L2CAP_Procedure_Timeout Parameter Size Description Event code 2 bytes The event code for L2CAP procedure timeout event Datalen 1 byte Length of the data to follow Data Dalen Status 0x0000 Success bytes Evt_Blue_L2CAP_Connection_Update_Request The event is given by the L2CAP layer when a connection update request is received from the slave The upper layer which receives this event has to respond by sendin
11. Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Event s generated A command complete event is generated when this command is processed Aci_Gatt_Confirm_Indication Table 226 Aci_Gatt_Confirm_Indication Command name Aci Gatt Confirm Indication OXFD25 Parameters Return Connection handle Status Description Allow application to confirm indication This command has to be sent when the application receives the event Evt Blue Gatt Indication Table 227 Aci Gatt Confirm Indication command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given DoclD026257 Rev 3 d UM1755 Vendor specific commands Table 228 Aci Gatt Confirm Indication return parameters Parameter Size Description 0x00 Success 0x46 Not allowed If the exchange has already taken place Channel not open Status 1 byte Event s generated A command complete event is generated when this command is processed 4 5 39 Aci_Gatt_Write_Resp Table 229 Aci_Gatt_Write_Resp Command name Parameters Return Connection handle Attribute handle Status Aci Gatt Write Resp OxFD26 Error Code Status Att Val Len At Val Description This command has to be sent by the application when it receives the Evt Blue Gatt Write Perm
12. Ger UM1755 y life augmented User man ual BlueNRG Bluetooth LE stack application command interface ACI Introduction The purpose of this document is to describe the design of the application command interface ACI of the BlueNRG Bluetooth low energy LE stack This document specifies the list of commands supported by the BlueNRG ACI July 2015 DoclD026257 Rev 3 1 131 www st com Contents UM1755 Contents 1 OVEIVIBW as Seep ARNAN bbe Qa EERDER OR WR a BEER E DE 14 1 1 BlueNRG ACI architecture llle 15 2 ACI command data format ee EE ER RR RR RR RR RR RR Re 16 2 1 Uc s AL 16 2 2 HCI command packet uaaa aaaea ea 16 2 3 HCI event packet ss ss ss nnana 18 2 4 HCI ACL data packet ss aasa EE SE ees 18 3 Standard HCI commands esse sesse ee ee Re RR RR RR Re ei 19 3 1 Supported HCI commands 0000 19 3 2 Supported HCl events Ee Ge Ge ee ee ee 20 4 Vendor specific commands 00 cece eee eee eee 21 4 1 VS command and VS event format a 21 4 2 L2CAP VS commands and events ee EE RE ER Re ER eee eee 23 4 2 1 L2CAP VS commands 0 0000 eee eee 23 4 2 2 Aci L2CAP Connection Parameter Update Request 23 4 2 3 Aci L2CAP Connection Parameter Update Response 24 4 2 4 L2CAP VS events AG 25 4 2 5 Evt Blue L2CAP Connection Update Resp 25 4 2 6 Evt Blue L2CAP Procedure
13. Aci_Gatt_Write_Charac_Val command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given attrHandle 2 bytes Handle of the characteristic to be written ValLen 1 byte Length of the value to be written AttrVal 0 N bytes Value to be written Table 201 Aci_Gatt_Write_Charac_Val return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Status 1 byte Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt_Blue_Gatt_Procedure_Cmplt event is generated d 98 131 DoclD026257 Rev 3 UM1755 Vendor specific commands 4 5 30 Aci Gatt Write Long Charac Val Table 202 Aci Gatt Write Long Charac Val Command name Parameters Return Connection handle AttrHandle Aci_Gatt_Write_Long_Charac_Val OxFD1D ValOffset Status ValLen AttrVal Description Start the procedure to write a long characteristic value Table 203 Aci_Gatt_Write_Long_Charac_Val command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given Attr
14. Conn Interval Min Nas Minimum connection interval received in E y Evt Blue L2CAP Connection Update Req event Conn Interea Max Sinise Maximum connection interval received in y Evt Blue L2CAP Connection Update Reg event Connection latency received in Sonn Pateney 2 bytes Evt Blue L2CAP Connection Update Reg event Tim t 2 bytes Supervision timeout received in Evt Blue L2CAP Connection Update Reg event d DoclD026257 Rev 3 UM1755 Vendor specific commands Table 11 Aci L2CAP Connection Parameter Update Response command parameters continued Parameter Size Description Identifier 1 byte Identifier received in Evt Blue L2CAP Connection Update Req event Accept 1 byte 0x00 The connection update parameters are not acceptable 0x01 The connection update parameters are acceptable Table 12 Aci L2CAP Connection Parameter Update Response return parameters Parameter Size Description 0x00 BLE STATUS SUCCESS Status 1 byte 0x12 BLE STATUS INVALID PARAMETER 0x0C ERR COMMAND DISALLOWED Event s generated A command complete event is generated 4 2 4 L2CAP VS events Table 13 L2CAP VS events Item Event EGID EID ECODE 1 Evt Blue L2CAP Connection Update Resp 0x02 0x00 0x0800 2 Evt Blue L2CAP Procedure Timeout 0x02 0x01 0x0801 3 Evt Blue L2CAP Connection Update Request 0x02 0x02 0x0802 4 2 5 Evt Blue L2CAP Connection Update Resp
15. Random device address DoclD026257 Rev 3 31 131 Vendor specific commands UM1755 32 131 Table 24 Aci_gap_set_discoverable command parameters continued Parameter Size Description 0x00 Allow scan request from any allow connect request from any default 0x01 Allow scan request from white list only allow t tf Adv Filter Policy fiw EE T T 0x02 Allow scan request from any allow connect request from white list only 0x03 Allow scan request from white list only allow connect request from white list only Length of the local name string in octets Local Name Length 1 byte If length is set to 0x00 Local Name parameter should not be used Locali Namo O N bytes Local name of the device This is an ASCII string without NULL character Length of the service UUID list in octets If there is no Service_UUID_Length 1 byte service to be advertised set this field to 0x00 This is the list of the UUIDs AD types as defined in Service UUID_List O N bytes Volume 3 Section 11 1 1 of GAP Specification Slave connection internal minimum value Connection interval is defined in the following manner Slave Conn Interval Min 2 bytes connlntervalmin Slave Conn Interval Min 1 25ms Slave Conn Interval Min range 0x0006 to 0x0C80 Value of OxFFFF indicates no specific minimum Slave connection internal maximum value Connlntervalmax Slave Conn Interval Max 1 25ms Slave Conn Interv
16. The controller will generate a command complete event Hal IO Configure Table 256 Hal IO Configure Command name Parameters Return Hal IO Configure OxFC02 OE Status Description Set the direction of the GPIOs Table 257 Hal IO Configure command parameters Parameter Size Description OE 1 byte Each bit represent one IO a value 1 is output and a O input Table 258 Hal IO Configure return parameters Parameter Size Description 0x00 BLE STATUS SUCCESS Status lye 0x47 BLE STATUS ERROR Event s generated The controller will generate a command complete event DoclD026257 Rev 3 117 131 Vendor specific commands UM1755 4 7 4 Hal IO set bit Table 259 Hal IO set bit Command name Parameters Return Hal IO set bit OxFC03 bn Status Value Description Set the value of a given IO Table 260 Hal IO set bit command parameters Parameter Size Description Index 1 byte The index of the pin to be manipulated A value equal to O reset the state of the pin a different value set Value 1 byte the pin to high Table 261 Hal_lO_set_bit return parameters Parameter Size Description Status TM 0x00 BLE STATUS SUCCESS 4 0x47 BLE_STATUS_ERROR Event s generated The controller will generate a command complete event 4 7 5 Hal IO get bit Table 262 Hal IO get bit Command name Parameters
17. rbre lo amu UUID Ee UUID Table 162 Aci Att Read Attr By Grp Type Reg return parameters Parameter Status Size 1 byte Event s generated Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started A command status event is generated on the receipt of the command The responses of the procedure are given through the Evt Blue Att Read By Group Resp event The end of the procedure is indicated by a Evt_Blue_Procedure_Complete event Aci_Att_Prepare_Write_Req Table 163 Aci_Att_Prepare_Write_Req Command name Description Aci_Att_Prepare_Write_Req OxFD10 Parameters Return Connection handle AttrHandle valOffset Status AttrValLen AttrVal This will prepare a write of the attribute value specified DoclD026257 Rev 3 d UM1755 Vendor specific commands Table 164 Aci Att Prepare Write Red command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given AttrHandle 2 bytes Handle of the attribute whose value has to be written valOffset 2 bytes The offset at which value has to be written AttrValLen 1 byte Length of the attribute value to follow AttrVal O N bytes Value
18. 0x11 Unsupported feature Status 1 byte Event s generated When the controller receives the command it will generate a command status event with return parameter Controller starts the advertising after this and when advertising timeout happens i e limited discovery period has elapsed controller generates Evt Blue Gap Limited Discoverable Complete event Aci Gap Set Discoverable Table 23 Aci gap set discoverable Command name Parameters Return Advertising Event Type Adv Interval Min Adv Interval Max Address Type Adv Filter Policy Aci Gap Set Discoverable OXFC83 Local Name Length Status Local Name Service Uuid Length Service Uuid List Slave Conn Interval Min Slave Conn Interval Max Description Set the device in general discoverable mode as defined in GAP specification volume 3 section 9 2 4 The device will be discoverable until the host issues the Aci Gap Set Non Discoverable command The Adv Interval Min and Adv Interval Max parameters are optional If both are set to 0 the GAP uses the default values for adv intervals for general discoverable mode Table 24 Aci gap set discoverable command parameters Parameter Size Description 0x00 Connectable undirected advertising default Advertising Event Type 1 byte 0x02 Scannable undirected advertising 0x03 Non connectable undirected advertising 0x00 Public device address default Address__lype 1 byte 0x01
19. 1 byte this attribute Valid Range 7 to 16 isVariable 1 byte 0x00 The attribute has a fixed length value field 0x01 The attribute has a variable length value field DoclD026257 Rev 3 Ly UM1755 Vendor specific commands Table 132 Aci Gatt Add Char Desc return parameters Parameter Size Description 0x00 Success 0x47 Error Ox1F Out of Memory 0x60 Invalid handle tat 1 byt statue a 0x61 Invalid parameter 0x62 Out of handle 0x63 Invalid Operation 0x64 Insufficient resources Char_Desc_Handle 2 bytes Handle of the characteristic descriptor Event s generated When this command is completed a command complete event will be generated by the controller which carries the status of the command and the handle of the characteristic descriptor 4 5 7 Aci_Gatt_Update_Char_Value Table 133 Aci_Gatt_Update_Char_Value Command name Parameters Return Serv_Handle Char_Handle Aci Gatt Update Char Value OxFD06 Val Offset Status Char Value Length Char Value Description Update a characteristic value in a service Table 134 Aci Gatt Update Char Value command parameters Parameter Size Description Serv Handle 2 bytes Handle of the service to which characteristic belongs Char Handle 2 bytes Handle of the characteristic The offset from which the attribute value has to be updated If this is set to O and the attribute value is of variable leng
20. 46 4 3 21 Aci Gap Terminate EE EE EE EE EG EE EE eee 46 4 3 22 Aci Gap Clear Security Database EE EE EE EE Ee eie 47 4 3 23 Aci_Allow_Rebond 2 20000 c eee ee 48 4 3 24 Aci Gap Start Limited Discovery Proc sellers 48 4 3 25 Aci Gap Start General Discovery Proc 50 4 3 26 Aci Gap Start Name Discovery Proc a 51 4 3 27 Aci Gap Start Auto Conn Establishment SS SS SS See 53 4 3 28 Aci Gap Start General Conn Establishment 55 4 3 29 Aci Gap Start Selective Conn Establishment 56 4 3 30 Aci Gap Create Connection a 58 4 3 31 Aci Gap Terminate Gap Procedure lslus 59 4 3 32 Aci Gap Start Connection Update sues 61 4 3 33 Aci Gap Send Pairing Request EE EE EE EE Ee Ee ke 62 4 3 34 Aci Gap Resolve Private Address SESSE EE EE EE eee 63 4 3 35 Aci Gap Get Bonded Devices SS SS SS SE ESE SS ee 64 4 4 GAP VS events u 0 2 eee eee 64 4 4 1 Evt Blue Gap Limited Discoverable 65 4 4 2 Evt Blue Gap Pairing Complete EE EE ER ee ee 65 44 3 Evt Blue Pass Key Request EE eee ee 65 444 Evt Blue Authorization Request EE Ee ee ee ee ee 67 4 4 5 Evt Blue Slave Security Initiated EE EE Ee se ee ee 67 44 6 Evt Blue Gap Bond Lost EE ES Se ee ee ee ee 67 4 4 7 Evt Blue Gap
21. 625 msec Own Address Typ NS 0x00 Public device address default e y 0x01 Random device address 0x00 Do not filter the duplicates default filterDuplicat 1 byt AE s 0x01 Filter duplicates I ee 1 byte Number of devices that have to be added to the whitelist The addr array will contain Num White List Entries number of Addr Array 7 bytes addresses and their address types that have to be added into the whitelist The format of the addr array should be address type followed by address Table 93 Aci Gap Start General Conn Establishment return parameters ELM NEN ENNNNN 0x00 BLE STATUS SUCCESS Status 1 byte 0x12 BLE STATUS INVALID PARAMETER 0x0C ERR COMMAND DISALLOWED Event s generated A command status event is generated when the command is issued If the status is returned as BLE STATUS SUCCESS then on completion of the procedure a Evt Blue Gap Procedure Completed event is generated with the procedure code set to 0x20 The procedure is terminated when a connection is established or the upper layer terminates the procedure by issuing the command Aci Gap Terminate Gap Procedure with the procedure code set to 0x20 DoclD026257 Rev 3 57 131 Vendor specific commands UM1755 4 3 30 Aci_Gap_Create_Connection Table 94 Aci Gap Create Connection Command name Parameters Return Scan_Interval Scan_Window Peer_Address_ Type Peer_Address Own_Address_Type Aci_Gap_Create_Connectio
22. BlueNRG s side Table 285 SPI pins Pin name Pin n Direction SPI CLK 2 Input SPI NCS 31 Input SPI MOSI 1 Input SPI MISO 32 Output SPI IRQ 3 Output Here is the summary of the SPI parameters The CS line is active low The clock signal can go up to 8 MHz or can go as low as 100 kHz The clock is inactive low i e the clock polarity CPOL 0 The data is valid on clock leading edge i e the clock phase CPHA 0 The data transfer is always 8 bit byte based For each byte the Most Significant Bit is sent first ME ON Figure 9 shows how to connect BlueNRG SPI bus to an external SPI master DoclDO26257 Rev 3 125 131 SPI interface UM1755 126 131 Figure 9 SPI wire connection ncs CLK Master MOSI BlueNRG _MISO MIso _DataRdy The SPI master i e an application processor always controls when to start an SPI transaction This can happen at any time lt is started by putting low the nCS line to activate the BlueNRG device Then the master should provide the SPI clock Together with the clock the master should output the data on the SPI bus through the MOSI line either dummy data or valid data At the same time the slave returns data from the MISO line because SPI is in principle a shift register When the SPI master wants to send data to the BlueNRG i e an SPI write it sets nCS to low then sends the SPI clock and dummy data to read an SPI header from th
23. Command name Parameters Return Aci Gatt Allow Read OxFD27 Connection handle Status Description The application has to send this command when it receives the Evt Blue Gatt Read Permit Req or Evt Blue Gatt Read Multi Permit Req This command indicates to the stack that the response can be sent to the client So if the application wishes to update any of the attributes before they are read by the client it has to update the characteristic values using the Aci Gatt Update Charac Value and then give this command The application should perform the required operations within 30 seconds Otherwise the GATT procedure will be timeout Table 233 Aci Gatt Allow Read command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given Table 234 Aci Gatt Allow Read return parameters Parameter Size Description 0x00 Success Status 1 byte 0x46 Not allowed The command is not expected in the current state of the stack Event s generated A command complete event is generated when this command is processed d DoclD026257 Rev 3 UM1755 Vendor specific commands 4 5 41 Aci_Gatt_Set_Security_Permission Table 235 Aci_Gatt_Set_Security_Permission Command name Parameters Return Service handle Aci_Gatt_Set_Security_Permission OxFD28 Attr handle Status Security permission Descri
24. Connection handle Aci Gatt Read Long Charac Val OxFD1A attrHandle Status valOffset Description Start the procedure to read a long characteristic value Table 194 Aci Gatt Read Long Charac Val command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given attrHandle 1 byte Handle of the characteristic to be read valOffset 2 bytes Offset from which the value needs to be read Table 195 Aci_Gatt_Read_Long_Charac_Val command return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Status 1 byte Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt_Blue_Gatt_Procedure_Cmplt event is generated Before procedure completion the response packets are given through Evt_Blue_Att_Read_Blob_Resp event DocID026257 Rev 3 Ly UM1755 Vendor specific commands 4 5 28 Aci Gatt Read Multiple Charac Values Table 196 Aci Gatt Read Multiple Charac Values Command name Parameters Return Connection handle Aci Gatt Read Multiple Charac Values OxFD1B numHandles Status setOfHandles
25. Connection handle for which the command is given AttrHandle 2 bytes Handle of the attribute to be written ValOffset 2 bytes Offset at which the attribute has to be written ValLen 1 byte Length of the value to be written AttrVal O N bytes Value to be written Table 207 Aci_Gatt_Write_Charac_Reliable return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Status 1 byte Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt_Blue_Gatt_Procedure_Cmplt event is generated Before procedure completion the response packets are given through Evt_Blue_Att_Prepare_Write_Resp and Evt_Blue_Att_Exec_Write_Resp events DocID026257 Rev 3 Ly UM1755 Vendor specific commands 4 5 32 Aci Gatt Write Long Charac Descriptor Table 208 Aci Gatt Write Long Charac Descriptor Command name Parameters Return Connection handle attrHandle Aci_Gatt_Write_Long_Charac_Descriptor OxFD1F ValOffset Status ValLen AttrVal Description Start the procedure to write a long characteristic descriptor Table 209 Aci_Gatt_Write_Long_Charac_Descriptor command parameters
26. EG ee eee 87 45 19 Aci Gatt Disc All Prim Services EE EE EE EE ee ee ee 88 4 5 20 Aci Gatt Disc Prim serv By Uuid 0405 89 4 5 21 Aci Gatt Find Included Services naana EE EE EE suus 90 4 5 22 Aci Gatt Disc All Charac Of Serv EE EE EE EE EE ee 91 4 5 23 Aci Gatt Disc Charac By UUID ii EE EE EG SE ee ee ee 92 4 5 24 Aci Gatt Disc All Charac Descriptors 93 4 5 25 Aci Gatt Read Charac Val EE EE EE EE Ee Ge eee eee 94 4 5 26 Aci Gat Read Charac Using UUID AE EE EE See 95 4 5 27 Aci Gat Read Long Charac Val EE a 96 4 5 28 Aci Gatt Read Multiple Charac Values EE EE lusus 97 4 5 29 Aci Gatt Write Charac Val EE EG ES EE cee eee 98 4 5 30 Aci Gatt Write Long Charac Val EE EE eee de ke 99 4 5 31 Aci Gatt Write Charac Reliable nnana aana 100 4 5 32 Aci Gatt Write Long Charac Descriptor 101 4 5 33 Aci Gatt Read Long Charac Descriptor 102 4 5 34 Aci Gatt Write Charac Descriptor EE a 103 4 5 35 Aci Gatt Read Charac Descriptor EE EE EE EE EE ee 104 4 5 36 Aci Gatt Write Without Response EE EE EE ee ee 104 4 5 37 Aci Gatt Signed Write Without Response 105 4 131 DocID026257 Rev 3 Ly UM1755 Contents 4 5 38 Aci Gatt Confirm Indication 0 106 4 5 39 Aci Gatt Write Resp 0000 cece 107 4 5 40 Aci
27. Evt Blue Gap Pairing Complete event Aci Gap Authorization Response Table 41 Aci Gap Authorization Response Command name Parameters Return Aci Gap Authorization Response OxFC89 Authorize Status Description This command should be send by the host in response to Evt Blue Gap Authorization Request event DoclD026257 Rev 3 37 131 Vendor specific commands UM1755 Table 42 Aci_Gap_Authorization_Response command parameters Parameter Size Description Authorize 1 byte 0x01 PULSI accept connection 0x02 Reject reject connection Table 43 Aci_Gap_Authorization_Response return parameters Parameter Size Description Status 1 byte 0x00 Success 0x42 Invalid parameter 0x0C Command disallowed Event s generated When the command has completed the controller will generate a command complete event 4 3 12 Aci Gap Init Table 44 Aci Gap Init Command name Aci Gap Init OxFC8A Parameters Return Status Service handle Role Dev name char handle Appearance Char handle Description Register the GAP service with the GATT If the role is peripheral then the device name characteristic and appearance characteristic are registered by default and the handles of these characteristics are returned in the event data Table 45 Aci Gap Init command parameters Parameter Size Description 0x01 Peripheral 0x0
28. HCI LE Set Scan Response 0x08 0x09 0x2009 19 HCI LE Set Advertize Enable 0x08 Ox0A 0x200A 20 HCI LE Set Scan Parameters 0x08 OXOB 0x200B 21 HCI LE Set Scan Enable 0x08 0x0C 0x200C 22 HCI LE Create Connection 0x08 0x0D 0x200D 23 HCI LE Create Connection Cancel 0x08 OxOE 0x200E 24 HCI LE Read White List Size 0x08 OxOF Ox200F 25 HCI LE Clear While List 0x08 0x10 0x2010 26 HCI LE Add Device To While List 0x08 0x11 0x2011 27 HCI_LE_Remove_Device_From_While_List 0x08 0x12 0x2012 28 HCI LE Connection Update 0x08 0x13 0x2013 Ky DoclD026257 Rev 3 19 131 Standard HCI commands UM1755 Table 2 HCI commands continued Item Command OGF OCF OpCode 29 HCI LE Set Host Channel Classification 0x08 0x14 0x2014 30 HCI LE Read Channel Map 0x08 0x15 0x2015 31 HCI LE Read Remote Used Features 0x08 0x16 0x2016 32 HCI LE Encrypt 0x08 0x17 0x2017 33 HCI LE Rand 0x08 0x18 0x2018 34 HCI LE Start Encryption 0x08 0x19 0x2019 35 HCI LE Long Term Key Request Reply 0x08 Ox1A 0x201A 36 HCI LE Long Term Key Requested Negative Reply 0x08 0x1B 0x201B 37 HCI LE Read Supported States 0x08 Ox1C 0x201C 38 HCI LE Receiver Test 0x08 0x1D 0x201D 39 HCI LE Transmitter Test 0x08 Ox1E 0x201E 40 HCI LE Test End 0x08 Ox1F Ox201F 3 2 Supported HCI events The table below lists the HCI events supported by the BlueNRG Table 3 HCI events Item Event Event code Sub event co
29. LE technology was designed to enable products that require lower power consumption lower complexity and lower cost compared to the Bluetooth classic or Bluetooth high speed systems A typical BLE system consists of an LE controller and a host The LE controller consists of a physical layer PHY including the radio a link layer LL and a standard host controller interface HCI The host consists of a HCI and other higher protocol layers e g L2CAP SM ATT GATT GAP etc In many designs the LE controller and the host reside in two separate silicon chips and are controlled by 2 different microcontrollers Communication between the two is transmitted via a hardware connection e g UART SPI USB etc The host can send HCI commands to control the LE controller The HCI interface and the HCI commands are standardized by the Bluetooth core specification Please refer to the official document for more information The HCI interface provides a significant benefit Any Bluetooth tester can easily connect to the controller via the hardware connection e g SPI to test the controller by sending HCI commands This removes the need to involve the host if the only interest is to test the controller Figure 1 Bluetooth LE system with separate host and controller Host GATTIATTISM L2CAP HCI it UART USB SDIO SPI Controller HCI LL PHY Sometimes the LE controller
30. Lost Table 66 Aci Gap Set Event Mask return parameters Parameter Size Status 1 byte Description 0x00 Success 0x12 Invalid HCI command parameter Event s generated A command complete event is generated on the completion of the command d DoclD026257 Rev 3 45 131 Vendor specific commands UM1755 4 3 20 4 3 21 46 131 Aci_Gap_Configure_WhiteList Table 67 Aci_Gap_Configure_WhiteList Command name Parameters Return Aci_Gap_Configure_WhiteList OxFC92 Status Description Configure the controller s white list with devices that are present in the security database Table 68 Aci_Gap_Configure_WhiteList return parameters Parameter Size Description 0x00 Success Status 1 byte 0x12 Invalid HCI command parameter 0x47 Error Event s generated The controller will generate a command complete event on the completion of the command and the status indicates whether the white list was configured or not The command will return an error if there are no devices in the database or it was unable to add to the white list Aci_Gap_Terminate Table 69 Aci_Gap_ Terminate Aci Gap Terminate OxFC93 abi biga Status Description Command the controller to terminate the connection Table 70 Aci Gap Terminate command parameters Parameter Size Description Conn handle 2 bytes Handle of the connection to be
31. OXOCOF 16 Evt Blue Gat Procedure Complete 0x03 0x10 OX0C10 17 Evt_Blue_Gatt_Error_Response 0x03 0x11 0X0C11 18 Evt Blue Gatt Disc Read Charac By UUID Resp 0x03 0x12 0X0C12 19 Evt Blue Gatt Write Permit req 0x03 0x13 0X0C13 20 Evt Blue Gatt Read Permit Req 0x03 0x14 OX0C14 21 Evt Blue Gatt Read Multi Permit Reg 0x03 0x15 OX0C15 4 6 1 Evt_Blue_Gatt_Attribute_modified This event is generated to the application by the GATT server when a client modifies any attribute on the server Table 245 Evt_Blue_Gatt_Attribute_modified Parameter Size Description Event code 2 bytes The event code of the vendor specific event Connection handle 2 bytes The connection handle which modified the attribute Attribute handle 2 bytes Handle of the attribute that was modified data_len 1 byte The length of the data to follow data buffer O N bytes The modified data 112 131 DoclD026257 Rev 3 ky UM1755 Vendor specific commands 4 6 2 Evt Blue Gatt Procedure Timeout This event is generated by the client server to the application on a GATT timeout 30 seconds Table 246 Evt Blue Gatt Procedure Timeout Parameter Size Description Event code 2 bytes The event code of the vendor specific event Connection handle 2 bytes connection handle on which the gatt procedure has timed 4 6 3 Evt Blue Gatt Procedure Complete This event is generated when a GATT client procedure completes either
32. Return Status Hal IO get bit OXFCO4 Index Mane Description Request the value of a pin Table 263 Hal IO get bit command parameters Parameter Size Description Index 1 byte The index of the pin to be manipulated d 118 131 DoclD026257 Rev 3 UM1755 Vendor specific commands Table 264 Hal IO get bit return parameters Parameter Size Description n Eie 0x00 BLE STATUS SUCCESS y 0x47 BLE STATUS ERROR 0x0 IO value is O valle are 0x1 IO value is 1 Event s generated The controller will generate a command complete event 4 7 6 Write Config Data Table 265 Write Config Data Command name Write Config Data OxFCOC Parameters Return Offset Length Status Value Description This command writes a value to a low level configure data structure It is useful to setup directly some low level parameters for the system in the runtime Table 266 Write Config Data command parameters Parameter Size Description Offset in the data structure The starting member in the data Offset 1 byte structure will have an offset O Length 1 byte Length of data to be written Value O N bytes Data to be written Table 267 Write Config Data members Data members Size Offset Description Public address 6 bytes 0x00 Bluetooth public address DIV 2 bytes 0x06 DIV used to derive CSRK ER 16 b
33. Table 241 Aci Gatt Read Handle Value EE EE EE Se cece 111 Table 242 Aci Gatt Read Handle Value command parameters EE ee ee ee 111 Table 243 Aci Gatt Read Handle Value return parameters is EE EE EE Ee ee ee ee 111 Table 244 GATT VS events 0000 eee eee 112 Table 245 Evt Blue Gatt Attribute modified ie EE EE EE EE EE EE ee ee ee ee ee 112 Table 246 Evt Blue Gatt Procedure Timeout is sd Ee Ee lese 113 Table 247 Evt Blue Gatt Procedure Complete iis SE 2c eee eee 113 Table 248 Evt Blue Gatt Disc Read Charac By UUID Resp EE EE Ee ee ee 113 Table 249 Evt Blue Gatt Write Permit req 114 Table 250 Evt Blue Gatt Read Permit Reg EE EE SE ES eee ee ees 114 Table 251 Evt Blue Gatt Read Multi Permit Red is EE SE ccc ee ee ee ee ee 115 Table 252 Other GATT VS events EE EE EE EE EG Ee ete ee ee 115 Table 253 HCI VS commandsS ie EE ees ee EG ee ee s 116 Table 234 Hal TO Iii ioo EE Sete RE Ten erat DB es Sew Dn WE we wR 117 Table 255 Hal IO Init return parameters SS SS SS SS SS ee ee eens 117 Table 256 Hal IO Configure ee Ee ee hn 117 Ly DoclD026257 Rev 3 11 131 List of tables UM1755 Table 257 Table 258 Table 259 Table 260 Table 261 Table 262 Table 263 Table 264 Table 265 Table 266 Table 267 Table 268 Table 269 Table 270 Table 271 Table 272 Table 273 Table 274 Table 275 Table 276 T
34. Timeout a 26 4 2 7 Evt Blue L2CAP Connection Update Request 26 4 3 GAP VS commands and events a 27 4 3 1 OVerVIGW AA AA AA 27 4 3 2 GAP VS Commands a anaa eee 28 4 3 3 Aci Gap Set Non Discoverable SS SS SE EE EE SS ees 29 4 3 4 Aci Gap Set Limited Discoverable 2 5 29 4 3 5 Aci Gap Set Discoverable 0 0 cc cece es 31 4 3 6 Aci Gap Set Direct Connectable 00 cece eee 33 4 3 7 Aci Gap Set IO Capability llli 34 4 3 8 Aci Gap Set Auth Requirement EE EE EE EE EE Ee eie 35 4 3 9 Aci Gap Set Author Requirement EE EE EE ee ee 36 2 131 DoclD026257 Rev 3 Ly UM1755 Contents 4 3 10 Aci Gap Pass Key Response 2 00 aa 37 4 3 11 Aci Gap Authorization Response 00 ce eee eens 37 4312 Aci Gap IMi iioc oe ee NANGKA EE E er ORE A RE 38 4 3 13 Aci Gap Set Non Connectable 0 0 0 0 cece 39 43 14 Aci Gap Set Undirected Connectable 40 4 3 15 Aci Gap Slave Security Request 0 0a 41 4 3 16 Aci Gap Update Adv Data 0 0 a 42 4 3 17 Aci Gap Delete AD Type 2 2202 EE EE 0002 eee eens 42 4 3 18 Aci Gap Get Security Level 2 0000000 eee 43 4 3 19 Aci Gap Set Event Mask 22 20000 e eee eee eee 45 4 3 20 Aci Gap Configure WhiteList aaaea aaaea
35. UM1755 Vendor specific commands Table 60 Aci_Gap_Delete_AD_Type command parameters Parameter AD Type Size 1 byte Description 0x01 AD_TYPE_FLAGS 0x02 AD_TYPE_16_BIT_SERV_UUID 0x03 AD_TYPE_16_BIT_SERV_UUID_CMPLT_LIST 0x04 AD_TYPE_32_BIT_SERV_UUID 0x05 AD_TYPE_32_BIT_SERV_UUID_CMPLT_LIST 0x06 AD_TYPE_128_BIT_SERV_UUID 0x07 AD TYPE 128 BIT SERV UUID CMPLT LIST 0x08 AD TYPE SHORTENED LOCAL NAME 0x09 AD TYPE COMPLETE LOCAL NAME OXOA AD TYPE TX POWER LEVEL 0x10 AD TYPE SEC MGR TK VALUE 0x11 AD TYPE SEC MGR OOB FLAGS 0x12 AD TYPE SLAVE CONN INTERVAL 0x14 AD TYPE SERV SOLICIT 16 BIT UUID LIST 0x15 AD TYPE SERV SOLICIT 32 BIT UUID LIST 0x16 AD TYPE SERVICE DATA OXFF AD TYPE MANUFACTURER SPECIFIC DATA Table 61 Aci Gap Delete AD Type return parameters Parameter Status Size 1 byte Description 0x00 Success Ox1F AD Type not found Event s generated A command complete event will be generated and the status indicates success or failure 4 3 18 Aci Gap Get Security Level Table 62 Aci Gap Get Security Level Command name Aci Gap Get Security Level OxFC90 Parameters Return Status MIMT protection required Bonding required OOB data present Passkey required Description This command can be used to get the current security settings of the device d DoclD026257 Rev 3
36. is generated for this command If the command was successfully processed the status field will have the value BLE STATUS SUCCESS and Evt Blue Gap Procedure Completed event is returned with the procedure code set to the corresponding procedure Aci Gap Start Connection Update Table 100 Aci Gap Start Connection Update Command name Aci Gap Start Connection Update OxFC9E Parameters Return Conn Handle Conn Interval Min Conn Interval Max Conn Latency Status Supervision Timeout Conn Len Min Conn Len Max Description Start the connection update procedure A LE Connection Update call is be made to the controller by GAP Table 101 Aci Gap Start Connection Update command parameters Parameter Conn Handle Conn Interval Min Size 2 bytes 2 bytes Description Handle of the connection for which the update procedure has to be started Minimum value for the connection event interval This shall be less than or equal to Conn Interval Max Range 0x0006 to 0x0C80 Time N 1 25 msec Time Range 7 5 msec to 4 seconds Conn Interval Max 2 bytes Maximum value for the connection event interval This shall be greater than or equal to Conn Interval Min Range 0x0006 to 0x0C80 Time N 1 25 msec Time Range 7 5 msec to 4 seconds Conn Latency 2 bytes Slave latency for the connection in number of connection events Range 0x0000 to 0x01F4 Supervision Timeout 2 byt
37. release 17 Nov 2014 Updated Title Table 14 Table 15 Table 16 Table 17 Table 30 Table 54 Table 242 minor changes in Chapter 4 Vendor specific commands and Section 5 2 4 Added Section 4 3 35 Aci_Gap_Get_Bonded_Devices and replaced technical content in Table 113 Minor text changes 01 Jul 2015 Updated Table 16 Table 38 Table 39 Table 85 Table 86 Table 88 and Table 113 DoclDO26257 Rev 3 d UM1755 IMPORTANT NOTICE PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries ST reserve the right to make changes corrections enhancements modifications and improvements to ST products and or to this document at any time without notice Purchasers should obtain the latest relevant information on ST products before placing orders ST products are sold pursuant to ST s terms and conditions of sale in place at the time of order acknowledgement Purchasers are solely responsible for the choice selection and use of ST products and ST assumes no liability for application assistance or the design of Purchasers products No license express or implied to any intellectual property right is granted by ST herein Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product ST and the ST logo are trademarks of ST All other product or service names are the property of their respective owners
38. to connect to GATT server Evt Blue Gap Authorization Request event will be sent to the host in this case Authorization enable Table 37 Aci_Gap_Set_Author_Requirement return parameters Creme sue me 0x00 Success Status 1 byte 0x42 Invalid parameter OxOC Command disallowed Event s generated When the command has completed the controller will generate a command complete event DocID026257 Rev 3 Ly UM1755 Vendor specific commands 4 3 10 4 3 11 d Aci Gap Pass Key Response Table 38 Aci Gap Pass Key Response Command name Parameters Return Conn handle Pass Key Aci Gap Pass Key Response 0xFC88 Status Description This command should be send by the host in response to Evt Blue Pass Key Request event The command parameter contains the pass key which will be used during the pairing process Table 39 Aci Gap Pass Key Response command parameters Parameter Size Description Conn handle 2 bytes Connection handle Pass Key 4 byte Pass key value range 0 999999 decimal Table 40 Aci Gap Pass Key Response return parameters Parameter Size Description 0x00 Success Status 1 byte 0x42 Invalid parameter OxOC Command disallowed Event s generated When controller receives this command it will generate a command status event with return parameter When paring process completes it will generate
39. to the application through EVT BLUE GAP RECONNECTION ADDRESS event Reconn addr 6 bytes Reconnection address used if use reconn addr is 1 Num WhiteList Entri es 1 byte Number of devices that have to be added to the whitelist Addr Array N 7 bytes The addr array will contain Num White List Entries number of addresses and their address types that have to be added into the whitelist The format of the addr array should be address type followed by address Table 87 Aci Gap Start Auto Conn Establishment return parameters Parameter Status Size 1 byte Description 0x00 BLE STATUS SUCCESS 0x12 BLE STATUS INVALID PARAMETER 0x0C ERR COMMAND DISALLOWED Event s generated A command status event is generated as soon as the command is given If BLE STATUS SUCCESS is returned the procedure is terminated when either a connection is successfully established with one of the specified devices in the white list or the procedure is explicitly terminated by issuing the command DoclD026257 Rev 3 Ly UM1755 Vendor specific commands Aci Gap Terminate Gap Procedure with the procedure code set to 0x08 A Evt Blue Gap Procedure Complete event is returned with the procedure code set to 0x08 4 3 28 Aci Gap Start General Conn Establishment d Table 88 Aci Gap Start General Conn Establishment Command name Aci Gap Start General Conn Establishment OxFC9
40. using any of the GAP features Table 120 Aci Gatt Init return parameters Parameter Size Description Status 1 byte 0x00 Success y 0x47 Error Aci_Gatt_Add_Service Table 121 Aci_Gatt_Add_Service Command name Parameters Return Service UUID Type Service UUID Status Service Type Service handle Max Aftribute Records Aci Gatt Add Service 0xF D02 Description Add a service to GATT Server When a service is created in the server the host needs to reserve the handle ranges for this service using Max Attribute Records parameter This parameter specifies the maximum number of attribute records that can be added to this service including the service attribute include attribute characteristic attribute characteristic value attribute and characteristic descriptor attribute Handle of the created service is returned in command complete event Table 122 Aci Gatt Add Service command parameters Parameter Size Description Service UUID Type 1 byte Oo iin Ee E y 0x02 128 bit UUID 2 bytes or A Service UUID 16 bit or 128 bit UUID based on the UUID type field 16 bytes DoclD026257 Rev 3 71 131 Vendor specific commands UM1755 4 5 4 72 131 Table 122 Aci_Gatt_Add_Service command parameters continued Parameter Size Description 0x01 Primary service Service T 1 byt ervice Iype ue 0x02 Secondary service Maximum number of attribute records that can be
41. with error or successfully Table 247 Evt_Blue_Gatt_Procedure_Complete Parameter Size Description Event code 2 bytes The event code of the vendor specific event Connection handle 2 bytes The connection handle which the gatt procedure has completed data_len 1 byte Will always be 1 byte Indicates whether the procedure completed with error data buffer O N bytes BLE_STATUS_FAILED or was successful BLE_STATUS_SUCCESS 4 6 4 Evt Blue Gatt Disc Read Charac By UUID Resp d This event can be generated during a Discover Characteristics By UUID procedure or a Read using Characteristic UUID procedure The attribute value will be a service declaration as defined in Bluetooth Core v4 0 spec vol 3 Part G ch 3 3 1 when a Discover Characteristics By UUID has been started It will be the value of the Characteristic if a Read using Characteristic UUID has been performed Table 248 Evt Blue Gatt Disc Read Charac By UUID Resp Parameter Size Description Event code 2 bytes The event code of the vendor specific event Connection Handle 2 bytes Connection handle where the procedure started Data_len 1 byte Length of following data Attribute_Handle 2 bytes Handle of the discovered attribute Attribute_Value Data_len 2 bytes Attribute value DoclD026257 Rev 3 113 131 Vendor specific commands UM1755 4 6 5 4 6 6 114 131 Evt Blue Gatt Write Permit reg This event is given to the application wh
42. 0006 to 0x0C80 Time N 1 25 msec Time Range 7 5 msec to 4 seconds Maximum value for the connection event interval This shall be greater than or equal to Conn Interval Min Conn Interval Max 2bytes Range 0x0006 to 0x0C80 Time N 1 25 msec Time Range 7 5 msec to 4 seconds Slave latency for the connection in number of connection events Conn Lat 2 byt onn Latency YES Range 0x0000 to 0x01F4 Supervision timeout for the LE Link Range 0x000A to 0x0C80 Time N 10 msec Time Range 100 msec to 32 seconds Supervision Timeout 2 bytes Minimum length of connection needed for the LE connection Conn_Len_Min 2 bytes Range 0x0000 OxFFFF Time N 0 625 msec Maximum length of connection needed for the LE connection Conn_Len_Max 2 bytes Range 0x0000 OxFFFF Time N 0 625 msec Table 84 Aci_Gap_Start_Name_Discovery_Proc return parameters Parameter Size Description 0x00 BLE_STATUS_SUCCESS Status 1 byte 0x12 BLE STATUS INVALID PARAMETER 0x0C ERR COMMAND DISALLOWED Event s generated A command status event is generated as soon as the command is given If BLE STATUS SUCCESS is returned on completion of the procedure a Evt Blue Gap Procedure Complete event is returned with the procedure code set to Ox04 d DoclD026257 Rev 3 Vendor specific commands d Aci Gap Start Auto Conn Establishment Table 85 Aci Gap Start Auto Conn Establishme
43. 2 Broadcaster Role 1 byte 0x03 Central 0x04 Observer Notes BlueNRG currently supports only peripheral and central roles 38 131 DoclD026257 Rev 3 d UM1755 Vendor specific commands Table 46 Aci Gap Init return parameters Parameter Size Description 00 Status 1 byte 0x00 Success 0x47 Error Service handle 2 bytes Handle for the GAP service Dev name char Handle for the device name characteristic added to the GAP 2 bytes handle service Appearance char Handle for the appearance characteristic added to the GAP 2 bytes handle service Event s generated On the completion of the command a command complete event is generated The status indicates success or failure If the registration of GAP service is successful the event data contains the handle for the GAP service registered with GATT and also the device name characteristic and appearance characteristic handles registered for the GAP service if the role is peripheral 4 3 13 Aci Gap Set Non Connectable d Table 47 Aci Gap Set Non Connectable Command name Parameters Return Aci Gap Set Non Connectable 0xXFC8B coU Description Put the device into non connectable mode Table 48 Aci Gap Set Non Connectable command parameters Parameter Size Description Advertising Event bie 0x02 Scannable undirected advertising Type 0x03 Non connectable undirected advertising Table 49 Aci_Gap_Set_N
44. 4 Table 30 Aci Gap Set IO Capability command parameters EE EE ee ee 34 Table 31 Aci Gap Set IO Capability return parameters anaana SE EE EE Ee ee ee ee 34 Table 32 Aci Gap Set Auth Requirement EE EE EE EG cece eee eee 35 Table 33 Aci Gap Set Auth Requirement command parameters nnna naaa SES ES sun 35 Table 34 Aci Gap Set Auth Requirement return parameters SS SS SS SES SS ee 36 Table 35 Aci Gap Set Author Reduirement asnasan EE EE 000 eee eee eee 36 Table 36 Aci Gap Set Author Requirement command parameters 36 Table 37 Aci Gap Set Author Requirement return parameters llle ee 36 Table 38 Aci Gap Pass Key Response ii EE EE Ee Ee tenes 37 Table 39 Aci Gap Pass Key Response command parameters is EE EE EE suus 37 Table 40 Aci Gap Pass Key Response return parameters ii EE EE EE Ee ee ee ee 37 Table 41 Aci Gap Authorization Response EE ccc SS SS SS SS SS SS Se ee eens 37 Table 42 Aci Gap Authorization Response command parameters 38 Table 43 Aci Gap Authorization Response return parameters aaaea 38 Table 44 Aci Gap Init liliis s 38 Table 45 Aci Gap Init command parameters liliis 38 Table 46 Aci Gap Init return parameters EE SS SS SS SS SS s 39 Table 47 Aci Gap Set Non Connectable SEE SS SS SS SS SS es 39 Table 48 Aci Gap Set Non Connecta
45. 43 131 Vendor specific commands UM1755 44 131 Table 63 Aci_Gap_Get_Security_Level return parameters Parameter Size Description Status 1 byte 0x00 Success MIMT protection 0x00 Not required a 1 byte required 0x01 Required 0x00 Not required Bondi ired 1 byt ico icis D 0x01 Required 0x00 Not present OOB data present 1 byte 0x01 Present 0x00 Not required 0x01 Fixed pin is present which is being used 0x2 Passkey required for pairing An event will be generated when required Passkey required 1 byte Event s generated The security parameters will be returned in a command complete event The first byte indicates the status of the security manager channel opened or closed d DoclD026257 Rev 3 UM1755 Vendor specific commands 4 3 19 Aci_Gap_Set_Event_Mask Table 64 Aci_Gap_Set_Event_Mask Command name Aci Gap Set Event Mask OxFC91 Parameters Return Event mask Status Description It allows masking events from the GAP The default configuration is all the events masked Table 65 Aci Gap Set Event Mask command parameters Parameter Size 0x0001 0x0002 0x0004 0x0008 0x0010 0x0020 Event mask 2 bytes Description Evt Blue Gap Limited Discoverable Evt Blue Pairing Complete Evt Blue Pass Key Request Evt Blue Authorization Request Evt Blue Slave Security Initiated Evt Blue Gap Bond
46. 5 4 3 16 4 3 17 42 131 Aci_Gap_Update_Adv_Data Table 56 Aci Gap Update Adv Data Command name Parameters Return Adv Data Length Adv Data Aci Gap Update Adv Data OxFC8E Status Description This command can be used to update the advertising data for a particular AD type If the AD type specified does not exist then it is added to the advertising data If the overall advertising data length is more than 31 octets after the update then the command is rejected and the old data is retained Table 57 Aci Gap Update Adv Data command parameters Parameter Size Description The number of bytes of data that is to follow in the advData Adv Data Length 1 byte parameter The advData has to be formatted as specified in Bluetooth Hay Dala akal da specification Volume 3 Part C 11 including data length Table 58 Aci Gap Update Adv Data return parameters Parameter Size Description 0x00 Success Status 1 byte 0x41 Failed Event s generated A command complete event will be generated when the command has completed with the status indicating success or failure Aci Gap Delete AD Type Table 59 Aci Gap Delete AD Type Command name Parameters Return Aci Gap Delete AD Type OxFC8F AD Type Status Description This command can be used to delete the specified AD type from the advertisement data if present d DoclD026257 Rev 3
47. A Parameters Return Scan_Type Scan Interval Scan Window Own Address Type filterDuplicates Use reconn addr Reconn addr Status Start a general connection establishment procedure The host enables scanning in the controller with the scanner filter policy set to accept all advertising packets and from the scanning results all the devices are sent to the upper layer using the event Evt Blue Gap Found Device The upper layer then has to select one of the devices to which it wants to connect by issuing the command Aci Gap Create Connection Table 89 Aci Gap Start General Conn Establishment command parameters Parameter Scan Type Size 1 byte Description 0x00 Passive scanning 0x01 Active scanning Scan Interval Scan Window 2 bytes 2 bytes Time interval from when the controller started its last LE scan until it begins the subsequent LE scan The scan interval should be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0 625 msec Amount of time for the duration of the LE scan Scan Window shall be less than or equal to Scan_Interval The scan window should be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0 625 msec Own_Address_Type 1 byte 0x00 Public device address default 0x01 Random device address filte
48. ATT VS commands SS SS SS SS SS eee eee eens 69 Table 119 Act Gatt IN oem DR eae aaa BREED Pad PRU E NGA 71 Table 120 Aci Gatt Init return parameters SS SS SES SS eee ee ee 71 Table 121 Aci Gatt Add Service EE EE EE EE EE GE ee eee 71 Table 122 Aci Gatt Add Service command parameters ccc eee ees 71 Table 123 Aci Gatt Add Service return parameters SS SS SS SS SS eee ee 72 Table 124 Aci Gatt Include Service EE EE EE EE EE GE Ee eee 72 Table 125 Aci Gatt Include Service command parameters 00 cece ee 73 Table 126 Aci Gatt Include Service return parameterS EE llli llle 73 Table 127 Aci Gatt Add Characteristic SS SS SS SS eee ees 73 Table 128 Aci Gatt Add Characteristic command parameters SS SS eee 74 Table 129 Aci Gatt Add Characteristic return parameters anaana cece ees 75 Table 130 Aci Gatt Add Char Desc SS SS SS eee SS SS Se ee ee ee 75 Table 131 Aci Gatt Add Char Desc command parameters EE EE EE EE ee ee ee 76 Table 132 Aci Gatt Add Char Desc return parameters is EE EE EE Ee eee ee ee ee 71 Table 133 Aci Gatt Update Char Value SS SS SS ens 77 Table 134 Aci Gatt Update Char Value command parameters aaee 71 Table 135 Aci Gatt Update Char Value return parameters ii EE EE EE Ee ee ee ee 78 Table 136 Aci Gatt Del Characteristic SS SS SS SS SS SS SS SS SS SS Se ee ee ee 78 Table 137 Ac
49. Aci_Gatt_Read_Long_Charac_Descriptor command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given attrHandle 2 bytes Handle of the characteristic descriptor ValOffset 2 bytes Offset from which the value needs to be read Table 213 Aci_Gatt_Read_Long_Charac_Descriptor return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Status 1 byte Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt_Blue_Gatt_Procedure_Cmplt event is generated Before procedure completion the response packets are given through Evt_Blue_Att_Read_Blob_Resp event d 102 131 DoclD026257 Rev 3 UM1755 Vendor specific commands 4 5 34 Table 214 Aci_Gatt_Write_Charac_Descriptor Aci_Gatt_Write_Charac_Descriptor Command name Aci_Gatt_Write_Charac_Descriptor OxFD21 Parameters Connection handle AttrHandle ValLen AttrVal Return Status Description Start the procedure to write a characteristic value Table 215 Aci_Gatt_Write_Charac_Descriptor command parameters Param
50. D18 25 Aci Gatt Read Charac Using UUID 0x02 0x19 OxFD19 26 Aci Gatt Read Long Charac Val 0x02 Ox1A OxFD1A 27 Aci Gatt Read Multiple Charac Values 0x02 Ox1B OxFD1B 28 Aci Gatt Write Charac Val 0x02 Ox1C OxFD1C 29 Aci Gatt Write Long Charac Val 0x02 Ox1D OxFD1D 30 Aci Gatt Write Charac Reliable 0x02 Ox1E OxFD1E 31 Aci Gatt Write Long Charac Descriptor 0x02 Ox1F OxFD1F 32 Aci Gatt Read Long Charac Descriptor 0x02 0x20 OxFD20 33 Aci Gatt Write Charac Descriptor 0x02 0x21 OxFD21 34 Aci_Gatt_Read_Charac_Descriptor 0x02 0x22 OxFD22 35 Aci Gatt Write Without Response 0x02 0x23 OxFD23 36 Aci Gatt Signed Write Without Response 0x02 0x24 OxFD24 37 Aci Gatt Confirm Indication 0x02 0x25 OxFD25 38 Aci Gatt Write Resp 0x02 0x26 OxFD26 39 Aci Gatt Allow Read 0x02 0x27 OxFD27 40 Aci Gatt Set Security Permission 0x02 0x28 OxFD28 41 Aci Gatt Set Descriptor Value 0x02 0x29 OxFD29 42 Aci Gatt Read Handle Value 0x02 Ox2A OxFD2A DoclD026257 Rev 3 3 UM1755 Vendor specific commands 4 5 2 4 5 3 d Aci Gatt Init Table 119 Aci Gatt Init Command name Parameters Return Aci Gatt Init OXFDO1 Status Description Initialize the GATT server on the slave device Initialize all the pools and active nodes Also it adds GATT service with service changed characteristic Until this command is issued the GATT channel will not process any commands even if the connection is opened This command has to be given before
51. Device Found 2000000 eee 67 4 4 8 Evt Blue Gap Procedure Complete 5 68 4 4 9 Evt Blue Gap Reconnection Address LLL 69 4 5 GATT VS commands and events ee essen 69 Ky DoclD026257 Rev 3 3 131 Contents UM1755 4 5 1 GATT VS commands 000 002 eee ese 69 4 5 2 Aci Gat Init ss EER ER REDE EE tac ERES KAKA ee toe eae VARY 71 4 5 3 Aci Gatt Add Service EE EE GEE EE Ge ee ee ee 71 4 5 4 Aci Gatt Include Service llle 72 4 5 5 Aci Gatt Add Characteristic llle 73 4 5 6 Aci Gatt Add Char DesC EE EE EE EE Ee eee 75 4 5 7 Aci Gatt Update Char Value 2 200 0c 71 4 5 8 Aci Gatt Del Characteristic SS SS SS EES ee 78 4 5 9 Aci Gatt Del Service EE 0000 EE EE EE EE Ge eee 79 4 5 10 Aci Gatt Del Include Service EE EE EE EE EE ee ee 80 4 5 11 Aci Gat Set Event Mask 22 EG EE cece eee 80 4 5 12 Aci Gat Exchange Configuration ee a 81 4 5 13 Aci Att Find Information Req EE EE EE EE EE ee ee 82 4 5 14 Att Find By Type Value Reg EE EE Ee eee ee 83 4 5 15 Aci Att Read Attr By Type Req 0 000 eee eee eee 84 45 16 Aci Att Read By Group Type Req 20005 85 4 5 17 Aci Att Prepare Write Req ii EE EE EE EG ee eee ee 86 4 5 18 Aci Att Execute Write Req ii EE EG EE
52. G SPI header and the following 3 conditions must be met 1 The master sends the CTRL byte as Ox0A 2 The slave replies with SPI READY byte as 0x02 3 The write buffer size is bigger than O If so the master can put the data bytes following the 5 header bytes on the MOSI line in the same transaction If the master is fast enough it may start sending data bytes immediately in the same SPI transaction where the 3 conditions are just seen satisfied Or the master may choose to stop the SPI transaction for now go back to prepare the data and send them in a later SPI transaction The SPI master is allowed to write less bytes than the write buffer size but it is forbidden to write more In case an ACI command packet is bigger than 128 bytes The master has to send it in 2 SPI write transactions The master firstly sends 128 bytes then waiting for the write buffer to be available again and then write the remaining bytes The BlueNRG will count how many bytes are actually received on the MOSI line So the master does not need to indicate how many bytes it intends to write The write buffer size value is the data bytes of the payload It does not include the 5 header bytes When the master is sending real data bytes on the MOSI line the BlueNRG will return the same amount of bytes from its own shift register The master should ignore these bytes Read data from BlueNRG The BlueNRG uses the IRQ pin to notify the SPI master when it has d
53. Gatt Allow Read 22 ellen 108 4 5 41 Aci Gatt Set Security Permission llli EE EE ee ee 109 4 5 42 Aci Gatt Set Descriptor Value 2000000005 110 4 5 43 Aci Gatt Read Handle Value anaana 111 4 6 GATT VS evehts code p ae eee Sale ea Vus CT PR A 112 4 6 1 Evt Blue Gatt Attribute modified se EE EE EE ee ee 112 4 6 2 Evt Blue Gatt Procedure Timeout 2 0 05 113 4 6 3 Evt Blue Gatt Procedure Complete 113 4 6 4 Evt Blue Gatt Disc Read Charac By UUID Resp 113 4 6 5 Evt Blue Gatt Write Permit req is EE EE EE ee se ee 114 4 6 6 Evt Blue Gatt Read Permit Reg 22 0005 114 4 6 7 Evt Blue Gatt Read Multi Permit Reg 115 4 6 8 Other GATT VS events 2 2 2 2 115 4 7 HCI Vendor specific commands 2 116 4 7 1 HCI VS commands 200 cee eee ees 116 4 7 2 Hal ed csse ar 117 4 7 3 Hal IO Configure Ee EE SE cece 117 4 7 4 Hal IO set Dit sa ia ca ei paths dE edd Pk Dee te aod 118 4 7 5 Hal lO get DIt ie eat e esee etd giu semel A GER a 118 4 7 6 Write Config Data EE EE SE EE EE Ee ee 119 4 7 7 Read Config Data liliis 120 4 7 8 Set Tx power level EE EE EE EE llle 121 4 7 9 Device Standby EE EER RE EER eee ee 122 4 7 10 Number Of Packet Sent in DirectTX 123 4 7 11 one Start sono e
54. Handle 2 bytes Handle of the attribute to be written ValOffset 2 bytes Offset at which the attribute has to be written ValLen 1 byte Length of the value to be written AttrVal O N bytes Value to be written Table 204 Aci Gatt Write Long Charac Val return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Status 1 byte Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt_Blue_Gatt_Procedure_Cmplt event is generated Before procedure completion the response packets are given through Evt_Blue_Att_Prepare_Write_Resp and Evt_Blue_Att_Exec_Write_Resp events d DoclD026257 Rev 3 99 131 Vendor specific commands UM1755 4 5 31 100 131 Aci Gatt Write Charac Reliable Table 205 Aci Gatt Write Charac Reliable Command name Parameters Return Connection handle AttrHandle Aci Gatt Write Charac Reliable OXFD1E ValOffset Status ValLen Attr Val Description Start the procedure to write a characteristic reliably Table 206 Aci Gatt Write Charac Reliable command parameters Parameter Size Description Connection handle 2 bytes
55. N HIGH POWER 1 byte Can be only 0 or 1 Set high power bit on or off PA LEVEL 1 byte Can be from 0 to 7 Set the PA level value Table 274 Tx power level command parameters combination EN HIGH POWER PA LEVEL TX Power Level dBm 0 18 14 7 11 4 8 1 4 9 1 6 1 7 5 0 15 1 1 11 7 OD O lO O O O CO O OD Nf oO oO BR OJN DoclD026257 Rev 3 121 131 Vendor specific commands UM1755 4 7 9 122 131 Table 274 Tx_power_level command parameters combination continued EN_HIGH_POWER PA_LEVEL TX Power Level dBm 1 2 8 4 1 3 5 1 1 4 24 1 5 14 1 6 4 7 1 7 8 0 default Table 275 Set Tx power level return parameters Parameter Size Description 0x00 BLE STATUS SUCCESS Status Lbyte 0x12 ERR_INVALID_HCI_CMD_PARAMS Event s generated The controller will generate a command complete event Device_Standby Table 276 Device_Standby Command name Parameters Return Device Standby 0XxFC13 Status Description Normally the BlueNRG will automatically enter sleep mode to save power This Device Standby command further put the device into the Standby mode instead of the sleep mode The difference is that in sleep mode the device can still wake up itself with the internal timer But in standby mode this timer is also disabled So the only possibility to wake up the devi
56. Rev 3 Ly UM1755 Vendor specific commands Table 138 Aci Gatt Del Characteristic return parameters Parameter Size Description 0x00 Success 0x47 Error Status 1 byte 0x60 Invalid handle 0x61 Invalid parameter 0x64 Insufficient resources Event s generated When the Aci Gatt Del Characteristic command has completed the controller will generate a command complete event 4 5 9 Aci_Gatt_Del_Service Table 139 Aci_Gatt_Del_Service Command name Aci Gatt Del Service OxFD08 Parameters Service handle Return Status Description Delete the service specified from the GATT server database Table 140 Aci Gatt Del Service command parameters Parameter Size Service Handle 2 bytes Description Handle of the service to be deleted Table 141 Aci Gatt Del Service return parameters Parameter Size Status 1 byte Description 0x00 Success 0x47 Error 0x60 Invalid handle 0x61 Invalid parameter 0x64 Insufficient resources Event s generated When the command has completed the controller will generate a command complete event d DoclD026257 Rev 3 Vendor specific commands UM1755 4 5 10 Aci_Gatt_Del_Include_Service Table 142 Aci_Gatt_Del_Include_Service Command name Parameters Return Aci Gatt Del Include Service Serv Handle Include Handle Status Description Delete the Includ
57. _Proc Table 79 Aci_Gap_Start_General_Discovery_Proc Command name Parameters Return Scan_Interval Scan_Window Own_Address_Type filterDuplicates Aci Gap Start General Discovery Proc OxFC97 Status Description Start the general discovery procedure The controller is commanded to start active scanning Table 80 Aci Gap Start General Discovery Proc command parameters Parameter Size Description Time interval from when the controller started its last LE scan until it begins the subsequent LE scan The scan interval should Scan_Interval 2 bytes be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0 625 msec Amount of time for the duration of the LE scan Scan Window shall be less than or equal to Scan Interval The scan window Scan Window 2 bytes should be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0 625 msec 0x00 Public device address default 0x01 Random device address Own Address Type 1 byte 0x00 Do not filter the duplicates default filterDuplicates 1 byte f j 0x01 Filter duplicates Table 81 Aci_Gap_Start_General_Discovery_Proc return parameters Creme see beet 0x00 BLE_STATUS_SUCCESS Status 1 byte 0x12 BLE STATUS INVALID PARAMETER 0x0C ERR COMMAND DISALLOWED Event s generated A com
58. able 277 Table 278 Table 279 Table 280 Table 281 Table 282 Table 283 Table 284 Table 285 Table 286 12 131 Hal IO Configure command parameters ansaa se ES Ee See ee ee ee 117 Hal IO Configure return parameters is SE GE eects 117 Fal IO set Dit EES EERDER ILLI 118 Hal IO set bit command parameters EE 0c cece Ee ee ee ee ee ee 118 Hal IO set bit return parameters EE GE ee ES EG ee ee ee ee ee 118 Hal NOX GOL bit ss TP pc 118 Hal IO get bit command parameters EE 0c cece eee 118 Hal IO get bit return parameters EE Ee ee ee ee ee ee eee 119 Write Config Data EE SEE EE na aa Ee ee eee 119 Write Config Data command parameters is EE EE cece eee eee esee 119 Write Config Data members EE EE SE EE elle 119 Write Config Data return parameters is EE EE GE EG ee ee ee eee 120 Read_Config_Data 0 0 0 2 cee 120 Read Config Data command parameters cece eee eee eee 120 Read Config Data return parameters 0000 cece eee eee 120 Set Tx power level 2 121 Set Tx power level command parameters 2 121 Tx power level command parameters combination EE EE sus 121 Set Tx power level return parameters EE eee eee ees 122 Device Standby resres tsr EE RE EE RE EE Re teen ke ee dk ee ee 122 Device Standby return parameters iS EE ee ee ee ee ee ee 122 Number Of Packet Sent in DirectTX
59. added Max_Attribute_ Records 1 byte to this service Table 123 Aci_Gatt_Add_Service return parameters Parameter Size Description 0x00 Success 0x47 Error 0x1F Out of memory 0x61 Invalid parameter 0x62 Out of handle 0x64 Insufficient resources Status 1 byte Handle of the Service When this service is added to the service a handle is allocated Service handle 2 bytes by the server to this service Also server allocates a range of handles for this service from Service Handle to Service Handle Max Aftribute Records Event s generated When the Aci Gatt Add Service command is completed controller will generate a command complete event with status and handle for the service as parameters Aci Gatt Include Service Table 124 Aci Gatt Include Service Command name Parameters Return Service Handle Include Start Handle Stat Aci Gatt Include Service 0XFDO3 Include End Handle Included handle Included Uuid Type Included Uuid Description Include a service given by Service Include Handle to another service given by Service Handle Attribute server creates an INCLUDE definition attribute and return the handle of this in command complete event as Included Handle d DoclD026257 Rev 3 UM1755 Vendor specific commands Table 125 Aci Gatt Include Service command parameters Parameter Size Description Serv
60. al Max 2 bytes Slave Conn Interval Max range 0x0006 to 0x0C80 Slave Conn Interval Max shall be equal to or greater than the Slave Conn Interval Min Value of OxFFFF indicates no specific maximum Table 25 Aci gap set discoverable return parameters Parameter Status Size 1 byte Description 0x00 Success 0x42 Invalid parameter 0x0C Command disallowed 0x11 Unsupported feature Event s generated When the Aci_Gap_Set_Discoverable command has completed the controller will generate a command complete event DoclD026257 Rev 3 a UM1755 Vendor specific commands 4 3 6 Aci Gap Set Direct Connectable Table 26 Aci Gap Set Direct Connectable Command name Parameters Return Own Address Type Aci Gap Set Direct Connectable OxFC84 Initiator Address Type Status Initiator Direct Address Description Set the device in direct connectable mode as defined in GAP specification Volume 3 Section 9 3 3 If the privacy is enabled the reconnection address is used for advertising else the address of the type specified in own address type is used The device will be in directed connectable mode only for 1 28 seconds If no connection is established within this duration the device enters non discoverable mode and advertising will have to be again enabled explicitly Table 27 Aci Gap Set Direct Connectable command parameters Parameter Size Descripti
61. alue return parameters Parameter Size Description 0x00 BLE STATUS SUCCESS Status 1 byte 0x41 BLE STATUS FAILED 0x12 ERR INVALID HCI CMD PARAMS Length 2 bytes Length of the value Value O N bytes Value read The length is as specified in the Length field Event s generated A command complete event is returned when this command is received The event will contain the length and value of the attribute handle specified d DoclD026257 Rev 3 111 131 Vendor specific commands UM1755 4 6 GATT VS events Table 244 GATT VS events Item Event EGID EID ECODE 1 Evt_Blue_Gatt_Attribute_modified 0x03 0x01 0x0C01 2 Evt_Blue_Gatt_Procedure_Timeout 0x03 0x02 0x0C02 3 Evt Blue Att Exchange MTU Resp 0x03 0x03 0x0C03 4 Evt_Blue_Att_Find_Information_Resp 0x03 0x04 0x0C04 5 Evt_Blue_Att_Find_By_Type_Value_Resp 0x03 0x05 0x0C05 6 Evt Blue Att Read By Type Resp 0x03 0x06 0x0C06 7 Evt Blue Att Read Resp 0x03 0x07 0x0C07 8 Evt_Blue_Att_Read_Blob_Resp 0x03 0x08 0x0C08 9 Evt_Blue_Att_Read_Multiple Resp 0x03 0x09 0x0C09 10 Evt_Blue_Att_Read_By_Group_Type_Resp 0x03 OXOA 0x0COA 11 Evt Blue Att Write Resp 0x03 OXOB OxOCOB 12 Evt Blue Att Prepare Write Resp 0x03 OXOC OxOCOC 13 Evt Blue Att Exec Write Resp 0x03 OxOD OxOCOD 14 Evt Blue Gatt Indication 0x03 OxOE OxOCOE 15 Evt Blue Gatt notification 0x03 OxOF
62. and CGID CID OpCode 1 Aci Gatt Init 0x02 0x01 OXFDO1 2 Aci Gatt Add Service 0x02 0x02 OxFD02 3 Aci Gatt Include Service 0x02 0x03 OxFD03 4 Aci Gatt Add Characteristic 0x02 0x04 OXFDO4 5 Aci Gatt Add Char Desc 0x02 0x05 OxFD05 6 Aci Gatt Update Char Value 0x02 0x06 OxFD06 7 Aci_Gatt_Del_Characteristic 0x02 0x07 OxFD07 8 Aci Gatt Del Service 0x02 0x08 OxFD08 9 Aci Gatt Del Include Service 0x02 0x09 OxFD09 10 Aci Gatt Set Event Mask 0x02 OXOA OxFDOA 11 Aci_Gatt_Exchange_configuration 0x02 Ox0B OxFDOB 12 Aci_Att_Find_Information_Req 0x02 OxOC OxFDOC 13 Aci Att Find Attr By Typ And Value Req 0x02 OxOD OxFDOD 14 Aci Att Find Attr By Typ And Value Req 0x02 OxOE OxFDOE 15 Aci Att Read Attr By Grp Type Req 0x02 OxOF OxFDOF 16 Aci Att Prepare Write Req 0x02 0x10 OxFD10 17 Aci Att Execute Write Req 0x02 0x11 OxFD11 18 Aci Gatt Disc All Prim Services 0x02 0x12 OxFD12 19 Aci Gatt Disc Prim serv By Uuid 0x02 0x13 OxFD13 DoclD026257 Rev 3 69 131 Vendor specific commands UM1755 70 131 Table 118 GATT VS commands continued Item Command CGID CID OpCode 20 Aci_Gatt_Find_Included_Services 0x02 0x14 OxFD14 21 Aci Gatt Disc All Charac Of Serv 0x02 0x15 OxFD15 22 Aci Gatt Disc Charac By UUID 0x02 0x16 OxFD16 23 Aci Gatt Disc All Charac Descriptors 0x02 0x17 OxFD17 24 Aci Gatt Read Charac Val 0x02 0x18 OxF
63. and the host can be combined into a single chipset solution This lowers the cost of hardware first because it reduces the number of silicon chips to one rather than two and second because the hardware connection between the host and the controller is no longer required Under this scenario the host may directly control the LL PHY In this way there is no need to generate the standard HCI commands transmit the commands to the LL and then process them As a result the execution time is improved and the calculation load on the CPU is reduced However if the HCI is removed completely it will be more difficult to test only the controller with an external Bluetooth tester DocID026257 Rev 3 Ly UM1755 Overview Figure 2 Bluetooth LE system with combined host and controller Host Controller GATT ATT SM L2CAP HCl LL PHY 1 1 BlueNRG ACI architecture The BlueNRG is implemented using a combined host and controller solution An application command interface ACI is provided for accessing the BlueNRG host and controller User applications i e programs running in another silicon chip can send ACI commands to control the BlueNRG The ACI commands should be sent over an SPI connection The SPI protocol is described in a later section The ACI interface also supports HCI commands If a command is received the ACI will check whether the command is for the host or for the c
64. arac_Descriptor return parameters Parameter Status Size 1 byte Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt_Blue_Gatt_Procedure_Cmplt event is generated Before procedure completion the response packet is given through Evt_Blue_Att_Read_Resp event 4 5 36 Aci_Gatt_Write_Without_Response Table 220 Aci_Gatt_Write_Without_Response Command name Parameters Return Connection handle AttrHandle Aci Gatt Write Without Response 0xFD23 Status ValLen Attr Val 104 131 DoclD026257 Rev 3 d UM1755 Vendor specific commands Description Start the procedure to write a characteristic value without waiting for any response from the server Table 221 Aci Gatt Write Without Response command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given AttrHandle 2 bytes Handle of the attribute to be written ValLen 1 byte Length of the value to be written AttrVal O N bytes Value to be written Table 222 Aci_Gatt_Write_Without_Respons
65. arameters Return Status Description This command is used to stop the previously started Tone_Start command Table 284 Tone_Stop return parameters Parameter Status Size 1 byte Description 0x00 BLE STATUS SUCCESS Event s generated DoclD026257 Rev 3 The controller will generate a command complete event d UM1755 SPI interface 5 5 1 d SPI interface The BlueNRG device provides an SPI interface which can be used to connect an external device The external device normally is an application processor It sends ACI commands to control the BlueNRG device And the BlueNRG generates ACI events to report back to the external application processor The ACI commands and events are transmitted through the SPI bus This chapter describes the BlueNRG hardware SPI interface Also it describes the communication protocol over the SPI bus between the BlueNRG and the external device Hardware SPI interface The BlueNRG SPI interface is Motorola protocol compliant which has 5 wires CLK clock nCS chip select MOSI master output slave input MISO master input slave output and DataRdy IRQ transmit interrupt request The BlueNRG always behaves as the slave device on the SPI bus The external device must be the SPI master The table below shows the 5 SPI pins on the BlueNRG device including the pin number of the silicon chip and the pin direction from the
66. ata to be read When the SPI master sees the IRQ pin become high it should read data from BlueNRG The protocol is similar to SPI write The SPI master starts a transaction to check the SPI header The master puts OxB in the CTRL byte and checks again if the slave is ready 0x02 and the read buffer size is non zero Then the master sends certain amount of dummy bytes e g 0x00 or OxFF on the MOSI line while reading back the slave data from the MISO line The reading process can happen in 1 SPI transaction or in multiple SPI transactions The SPI master should read from BlueNRG as long as the IRQ pin is high 3 DoclD026257 Rev 3 UM1755 SPI interface 5 2 4 d SPI operation with BlueNRG sleep mode The BlueNRG device is designed with a deep sleep mode in which it turns off most of the internal functions to save power The BlueNRG goes into sleep mode automatically when there is no Bluetooth activity ongoing So it is very likely that the BlueNRG is sleeping when the master starts an SPI transaction The BlueNRG wakes up as soon as the nCS line is put to low But then it needs to initialize and prepare the SPI buffers This will take some time So the following sequence is likely to occur on the SPI bus 1 The master puts the nCS line to low and the BlueNRG wakes up BlueNRG is expecting a command within 2 ms before going to sleep 2 The master sends the header but the BlueNRG replies with the READY byte as 0x00 o
67. ble command parameters EE EE EE EE Ee 39 Ly DoclD026257 Rev 3 7 131 List of tables UM1755 Table 49 Table 50 Table 51 Table 52 Table 53 Table 54 Table 55 Table 56 Table 57 Table 58 Table 59 Table 60 Table 61 Table 62 Table 63 Table 64 Table 65 Table 66 Table 67 Table 68 Table 69 Table 70 Table 71 Table 72 Table 73 Table 74 Table 75 Table 76 Table 77 Table 78 Table 79 Table 80 Table 81 Table 82 Table 83 Table 84 Table 85 Table 86 Table 87 Table 88 Table 89 Table 90 Table 91 Table 92 Table 93 Table 94 Table 95 Table 96 Table 97 Table 98 Table 99 Table 100 8 131 Aci Gap Set Non Connectable return parameters nananana EE EE Ee ee ee 39 Aci Gap Set Undirected Connectable SS ccc eee 40 Aci Gap Set Undirected Connectable command parameters 40 Aci Gap Set Undirected Connectable return parameters Aa 40 Aci Gap Slave Security Request EE EE EE ee eee 41 Aci Gap Slave Security Request command parameters nnana naana 41 Aci Gap Slave Security Request return parameters 2 00000 000 41 Aci Gap Update Adv Data EE EE EE EE ee ln 42 Aci Gap Update Adv Data command parameterS SS SEE EES cece eee eae 42 Aci Gap Update Adv Data return parameterS EES 000 cc cece SS SS SS ee 42 Aci Gap Dele
68. byte Jose amu UUID Trend UUID Table 159 Aci Att Find Attr By Typ And Value Reg return parameters Parameter Status Size 1 byte Event s generated A command status event is generated on the receipt of the command The responses of the procedure are given through the Evt Blue Att Read By Type Resp event The end of the Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started procedure is indicated by a Evt Blue Procedure Complete event 4 5 16 Aci Att Read By Group Type Req Table 160 Aci Att Read By Group Type Req Command name Description Parameters Return Connection handle Start handle Aci Att Read By Group Type Red OxFDOF End handle Status UUID type UUID It posts the read by group type request d DoclD026257 Rev 3 85 131 Vendor specific commands UM1755 4 5 17 86 131 Table 161 Aci Att Read Attr By Grp Type Req command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given Start handle 2 bytes Start handle of the range of values to be read on the server End handle 2 bytes End handle of the range of values to be read on the server UUD
69. c For a number N Time N 0 625 msec 0x00 Public device address default 0x01 Random device address Conn Interval Min 2 bytes DoclD026257 Rev 3 Minimum value for the connection event interval This shall be less than or equal to Conn Interval Max Range 0x0006 to 0x0C80 Time N 1 25 msec Time Range 7 5 msec to 4 seconds 53 131 Vendor specific commands UM1755 54 131 Table 86 Aci_Gap_Start_Auto_Conn_Establishment command parameters Parameter Conn Interval Max Size 2 bytes Description Maximum value for the connection event interval This shall be greater than or equal to Conn Interval Min Range 0x0006 to 0x0C80 Time N 1 25 msec Time Range 7 5 msec to 4 seconds Conn Latency 2 bytes Slave latency for the connection in number of connection events Range 0x0000 to 0x01F4 Supervision Timeout 2 bytes Supervision timeout for the LE Link Range 0x000A to 0x0C80 Time N 10 msec Time Range 100 msec to 32 seconds Conn Len Min 2 bytes Minimum length of connection needed for the LE connection Range 0x0000 OxFFFF Time N 0 625 msec Conn Len Max 2 bytes Maximum length of connection needed for the LE connection Range 0x0000 OxFFFF Time N 0 625 msec Use reconn addr 1 byte If 1 the provided reconnection address is used as our address during the procedure the address has been previously notified
70. cation when a read reguest or read blob reguest is received by the server from the client This event will be given to the application only if the event bit for this event generation is set when the characteristic was added On receiving this event the application can update the value of the handle if it desires and when done it has to send the Aci Gatt Allow Read command to indicate to the stack that it can send the response to the client Table 250 Evt Blue Gatt Read Permit Reg Parameter Size Description Event code 2 bytes The event code of the vendor specific event Handle of the connection on which there was the request to read Connection handle 2 bytes the attribute Attribute handle 2 bytes The handle of the attribute that has been requested by the client to be read Datalen 1 byte Length of the data to follow Data O N bytes Contains the offset from which the read has been requested d DoclD026257 Rev 3 UM1755 Vendor specific commands 4 6 7 4 6 8 d Evt Blue Gatt Read Multi Permit Req This event is given to the application when a read multiple request or read by type request is received by the server from the client This event will be given to the application only if the event bit for this event generation is set when the characteristic was added On receiving this event the application can update the values of the handles if it desires and when done it has to send the A
71. ce is by the external signals e g a HCI command sent via SPI bus Based on the measurement the current consumption under sleep mode is 2 uA And this value is 1 5 uA in standby mode The command is only accepted when there is no other Bluetooth activity Otherwise an error code command disallowed will return Table 277 Device_Standby return parameters Parameter Size Description 0x00 BLE_STATUS_SUCCESS Status 1 byte 0x0C ERR COMMAND DISALLOWED This command is not allowed when Bluetooth activity is ongoing Event s generated DocID026257 Rev 3 Ly UM1755 Vendor specific commands The controller will generate a command complete event 4 7 10 Number Of Packet Sent in DirectTX Table 278 Number Of Packet Sent in DirectTX Command name Parameters Return F Status Number Of Packet Sent in DirectTX OxFC14 Packet Counter Description During the Direct Test mode in the TX tests the number of packets sent in the test is not returned when executing the Direct Test End command This command implements this feature If the Direct TX test is started a 32 bit counter will be used to count how many packets have been transmitted After the Direct Test End this command can be used to check how many packets were sent during the Direct TX test The counter starts from O and counts upwards As would be the case if 32 bits are all used the counte
72. ci Gatt Allow Read command to indicate to the stack that it can send the response to the client Table 251 Evt Blue Gatt Read Multi Permit Req Parameter Size Description Event code 2 bytes The event code of the vendor specific event Connection handle 2 bytes Handle of the connection which requested to read the attribute data len 1 byte The length of the data to follow The handles of the attributes that have been requested by the data buffer O N bytes client for a read Other GATT VS events Table 252 Other GATT VS events Parameter Size Description Event code 2 bytes The event code of the vendor specific event Connection handle 2 bytes Connection handle on which the gatt procedure is running data len 1 byte The length of the data to follow if any Indicates whether the procedure completed with error BLE STATUS FAILED or was successful BLE STATUS SUCCESS This event will be generated when any one of the GATT client procedures are started by the application The application has to associate the event with the procedure it had started data buffer O N bytes DoclD026257 Rev 3 115 131 Vendor specific commands UM1755 4 7 4 7 1 116 131 HCI Vendor specific commands HCI VS commands Table 253 HCI VS commands Item Event EGID EID ECODE 1 Hal IO Init 0x00 0x01 OXFCO1 2 Hal IO Conf
73. cute Write Req return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If ATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Status 1 byte Event s generated A command status event is generated on the receipt of the command The result of the procedure is given through the Evt Blue Att Exec Write Resp event The end of the procedure is indicated by a Evt Blue Procedure Complete event Aci Gatt Disc All Prim Services Table 169 Aci Gatt Disc All Prim Services Command name Parameters Return Aci Gatt Disc All Prim Services OxFD12 Connection handle Status Description This command will start the GATT client procedure to discover all primary services on the Server Table 170 Aci Gatt Disc All Prim Services command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given d DoclD026257 Rev 3 UM1755 Vendor specific commands Table 171 Aci_Gatt_Disc_All_Prim_Services return parameters Parameter Status Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous reques
74. d can optionally have a receiver e Observer In observer role device receives the advertising events An observer shall have a receiver and can optionally have a transmitter e Peripheral Any device that accepts the establishment of LE physical link is referred as peripheral A device operating in peripheral role will be slave in LL connection state A peripheral shall have both a transmitter and receiver e Central A device that initiates the establishment of LE physical link is referred as central device A device operating in central role will be master in LL connection state A central shall have both a transmitter and receiver BlueNRG is capable of being the peripheral or central in the GAP profile context because e BlueNRG controller is capable of acting as a slave in a connection i e it can accept the LL connection request from a central device and can support all the mandatory requirements of the GAP peripheral role as dictated in Table 2 1 Part C Generic Access Profile of Bluetooth core specification 4 0 e BlueNRG controller is capable of acting as a master in a connection i e it can issue the LL connect request to a peripheral device and can support all the mandatory requirements of the GAP central role as dictated in Table 2 1 Part C Generic Access Profile of Bluetooth core specification 4 0 DoclDO26257 Rev 3 27 131
75. de 1 Disconnect Complete 0x05 2 Encryption Change Event 0x08 3 Read Remote Version Information Complete 0x0C 4 Command Complete Event OxOE 5 Command Status Event OxOF 6 Hardware Error Event 0x10 7 Number Of Completed Packets 0x13 8 Encryption Key Refresh Complete 0x30 9 LE Connection Complete Ox3E 0x01 10 LE Advertising Report Ox3E 0x02 11 LE Connection Update Complete Ox3E 0x03 12 LE Read Remote Used Features Complete Ox3E 0x04 13 LE Long Term Key Request Event Ox3E 0x05 20 131 DoclD026257 Rev 3 d UM1755 Vendor specific commands 4 4 1 d Vendor specific commands The VS commands can be either ACI V8 commands to access the host of the BlueNRG or the HCI VS commands to access the LE controller Both types of the commands use the OGF value of Ox3F VS command and VS event format The OCF field of the OpCode of the V8 commands is further divided into two fields Command Group ID and Command ID Figure 7 OpCode format for VS Commands 15 109 76 0 Bits OGF OCF 11111 1 Command Group ID Command ID CID CGID 7 bits 3 bits GAMS2904141430SG Figure 7 above gives the 16 bit OpCode format see also Section 2 2 The OGF field is always Ox3F for VS commands The 10 bit OCF field is split into two parts 3 bit Command Group ID CGID and 7 bit Command ID CID The CGID is used by the BlueNRG ACI interface to route the commands to different lo
76. dle 2 bytes Handle of the characteristic to which description is to be added 0x01 16 bit UUID default Char_D UUID t 1 byt ER HUB ie ui 0x02 128 bit UUID 0x2900 Characteristic Extended Properties Descriptor 0x2901 Characteristic User Descriptor 2 bytes or 0x2902 Client configuration descriptor E 16 bytes 0x2903 Server configuration descriptor 0x2904 Characteristic presentation format 0x2905 Characteristic aggregated format OxXXXX 16 128 bit user specific descriptor Char Desc Value Max Length 1 byte The maximum length of the descriptor value Char Desc Value Length 1 byte Current Length of the characteristic descriptor value Char Desc Value 0 N Bytes Value of the characteristic description 0x00 No security permission 01 Authenticati ired Security Permissions 1 byte T ae b bii 0x02 Authorization required 0x04 Encryption required 0x00 No Access e 0x01 Readable Access Permissions 1 byte 0x02 Writable 0x03 Read Write 0x01 GATT SERVER ATTR WRITE The application will be notified when a client writes to this attribute 0x02 GATT INTIMATE AND WAIT FOR APPL AUTH Gatt Event Mask 1 byte The application will be notified when a write request write cmd signed write cmd is received by the server for this attribute 0x04 GATT INTIMATE APPL WHEN READ N WAIT The application will be notified when a read request of any type is got for this attribute The minimum encryption key size requirement for Enorypian Kay Size
77. ds we use the term ACI commands In practice the value of the OpCode is more important Each command regardless of whether it is an HCI or an ACI command matches only one OpCode value The user application should guarantee the OpCode value is used correctly Please note that the Bluetooth specification uses bit wise little endian format for the OpCode So in Figure 4 the OGF field is placed to the right But in this document when writing an OpCode in the format of OXXXXX we imply the most significant bit to the left For example if an OpCode is OxFE81 its top 6 bit OGF is 111111 i e Ox3F so it is a vendor specific command And its OCF is 10 bit 0x281 For another example if an OpCode is 0x0406 the 6 bit OGF is 0x01 and its OCF is 0x06 So this is a standard HCI command HCI Disconnect DoclD026257 Rev 3 17 131 ACI command data format UM1755 2 3 HCI event packet The BlueNRG uses event packets to acknowledge a command or to notify that its status has updated to the user application The BlueNRG only sends HCI event packets but does not receive them Figure 5 HCI event packet 0 4 12 16 20 24 28 31 Event Code Parameter Total Length Event Parameter 0 Event Parameter 1 Event Parameter 2 Event Parameter 3 Event Parameter N 1 Event Parameter N GAMS2904141415SG 2 4 HCI ACL data packet The ACL data packets are used to exchan
78. dure completion the response packets are given through Evt_Blue_Att_Find_Info_Resp event Aci_Gatt_Read_Charac_Val Table 187 Aci Gatt Read Charac Val Command name Parameters Return Aci Gatt Read Charac Val OXFD18 bia endie Description Start the procedure to read the attribute value Table 188 Aci Gatt Read Charac Val command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given attrHandle 2 bytes Handle of the characteristic to be read Table 189 Aci_Gatt_Read_Charac_Val return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Status 1 byte d DoclD026257 Rev 3 UM1755 Vendor specific commands Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt Blue Gatt Procedure Cmplt event is generated Before procedure completion the response packet is given through Evt Blue Gatt Disc Read Charac By UUID Resp event 4 5 26 Aci Gatt Read Charac Using UUID d Table 190 Aci Gatt Read Charac Using UUID Command name Parameters Return Connection handle Start handle Aci Gatt R
79. e procedure are given through the Evt Blue Att Read By Type Resp event The end of the procedure is indicated by a Evt_Blue_Procedure_Complete event 4 5 22 Aci_Gatt_Disc_All_Charac_Of_Serv Table 178 Aci_Gatt_Disc_All_Charac_Of_Serv Command name Parameters Return Connection handle Aci Gatt Disc All Charac Of Serv 0xFD15 Start Attr handle Status End Attr handle Description Start the procedure to discover all the characteristics of a given service Table 179 Aci Gatt Disc All Charac Of Serv command parameters Parameter Size Connection handle 2 bytes Description Connection handle for which the command is given Start Attr handle 2 bytes Start attribute handle of the service End Attr handle 2 bytes End attribute handle of the service d DoclD026257 Rev 3 Vendor specific commands UM1755 Table 180 Aci Gatt Disc All Charac Of Serv return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed Statis 1 byte If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt_Blue_Gatt_Procedure_Cmplt event is gen
80. e 166 Table 167 Table 168 Table 169 Table 170 Table 171 Table 172 Table 173 Table 174 Table 175 Table 176 Table 177 Table 178 Table 179 Table 180 Table 181 Table 182 Table 183 Table 184 Table 185 Table 186 Table 187 Table 188 Table 189 Table 190 Table 191 Table 192 Table 193 Table 194 Table 195 Table 196 Table 197 Table 198 Table 199 Table 200 Table 201 Table 202 Table 203 Table 204 10 131 Aci Att Find Information Red return parameterS EE EE EE EE ee ee ee ee 83 Att Find By Type Value Reg EE EE Ee Se tee 83 Aci Att Find Attr By Typ And Value Reg command parameters 83 Aci Att Find Attr By Typ And Value Reg return parameters 84 Aci Att Read Attr By Type_Req 0 cece nee 84 Aci Att Read Attr By Type Red command parameters a 85 Aci Att Find Attr By Typ And Value Reg return parameters 85 Aci Att Read By Group Type Req 2 EE 0c cece Ee ee ee ee ee ee 85 Aci Att Read Aft By Grp Type Red command parameters 86 Aci Att Read Aft By Grp Type Reg return parameters anaana EE Ee Ee 86 Aci Att Prepare Write Red EE EE EE EE ee SE eee 86 Aci Att Prepare Write Reg command parameters SS SS ee eee eens 87 Aci Att Prepare Write Reg retu
81. e BlueNRG The SPI header format will be described in the following section If the SPI header indicates that the BlueNRG has enough space in the buffer the SPI master can then send real data over the SPI bus The SPI master should not overwrite the BlueNRG SPI buffer otherwise the communication will fail When the BlueNRG wants to send data to the SPI master i e an SPI read it must use the IRQ pin because the SPI slave cannot control the nCS line The BlueNRG will set the IRQ pin to high which notifies the SPI master that there is data to be read Then the SPI master should start an SPI transaction reading the SPI header and from where it will know how many bytes it should read back from the BlueNRG The SPI master should not read bytes other than those indicated as the SPI header otherwise the communication will fail The DataRdy IRQ pin of the BlueNRG should work as follows 1 it must be high when BlueNRG has data to send to the SPI master 2 It must be high impedance when BlueNRG has no data to send to the SPI master On the SPI master side this pin must be configured as an input pin The SPI master may poll this pin or use it as an interrupt source to detect when an SPI read is required Also there should be a pull down resistor either on the SPI master IRQ pin or externally connected This pull down resistor makes sure the DataRdy value goes back to 0 so it does not confuse the SPI master to misread data Note that the reason t
82. e definition from the service Table 143 Aci Gatt Del Include Service command parameters Parameter Size Description Serv Handle 2 bytes Handle of the service to which Include definition belongs Include Handle 2 bytes Handle of the Included definition to be deleted Table 144 Aci Gatt Del Include Service return parameters Parameter Size Description 0x00 Success 0x47 Error Status 1 byte 0x60 Invalid handle 0x61 Invalid parameter 0x64 Insufficient resources Event s generated When the command has completed the controller will generate a command complete event 4 5 11 Aci Gatt Set Event Mask Table 145 Aci Gatt Set Event Mask Command name Aci Gatt Set Event Mask OxFDOA Parameters Event mask Return Status Description It allows masking events from the GATT The default configuration is all the events masked 80 131 DoclD026257 Rev 3 d UM1755 Vendor specific commands 4 5 12 d Table 146 Aci Gatt Set Event Mask command parameters Parameter Size 0x00000001 0x00000002 0x00000004 0x00000008 0x00000010 0x00000020 0x00000040 0x00000080 0x00000100 0x00000200 0x00000400 0x00000800 0x00001000 0x00002000 0x00004000 0x00008000 0x00010000 Event mask 4 bytes Description Evt Blue Gatt Attribute modified Evt Blue Gatt Procedure Timeout Evt Blue Att Exchange MTU Resp Evt Blue At
83. e return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed Status 1 byte If the exchange has already taken place Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Event s generated A command complete event is generated when this command is processed 4 5 37 Aci_Gatt_Signed_Write_Without_Response d Table 223 Aci Gatt Signed Write Without Response Command name Parameters Return Connection handle Aci Gatt Signed Write Without Response AttrHandle Status 0xFD24 ValLen AttrVal Description Start the procedure to write a characteristic value with an authentication signature without waiting for any response from the server It cannot be used when the link is encrypted DoclDO26257 Rev 3 105 131 Vendor specific commands UM1755 4 5 38 106 131 Table 224 Aci_Gatt_Signed_Write_Without_Response command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given AttrHandle 2 bytes Handle of the attribute to be written ValLen 1 byte Length of the value to be written AttrVal O N bytes Value to be written Table 225 Aci_Gatt_Signed_Write_Without_Response return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed Status 1 byte If the exchange has already taken place
84. ead Charac Using UUID OxFD19 End handle Status UUID type UUID Description Start the procedure to read all the characteristics specified by the UUID Table 191 Aci Gatt Read Charac Using UUID command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given Start handle 2 bytes Starting handle of the range to be searched End handle 2 bytes End handle of the range to be searched 0x01 16 bit UUID default ES iuis 0x02 128 bit UUID 2 bytes or UUID 16 bytes UUID Table 192 Aci Gatt Read Charac Using UUID return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place Status 1 byte If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started DoclD026257 Rev 3 95 131 Vendor specific commands UM1755 4 5 27 96 131 Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt_Blue_Gatt_Procedure_Cmplt event is generated Before procedure completion the response packets are given through Evt Blue Gatt Disc Read Charac By UUID Resp event Aci Gatt Read Long Charac Val Table 193 Aci Gatt Read Long Charac Val Command name Parameters Return
85. en desc val Description This command sets the value of the descriptor specified by Desc handle Table 239 Aci Gatt Set Descriptor Value command parameters Parameter Size Description Service handle 2 bytes Handle of the service which contains the descriptor Char handle 2 bytes Handle of the characteristic which contains the descriptor Desc handle 2 bytes Handle of the descriptor whose value has to be set val offset 2 bytes Offset from which the descriptor value has to be updated desc val len 2 bytes Length of the descriptor value desc val O N bytes Descriptor value Table 240 Aci Gatt Set Descriptor Value return parameters Parameter Size Description 0x00 Success 0x47 Error 0x60 Invalid handle 0x61 Invalid parameter Status 1 byte Event s generated A command complete event is generated when this command is processed d 110 131 DoclD026257 Rev 3 UM1755 Vendor specific commands 4 5 43 Aci Gatt Read Handle Value Table 241 Aci Gatt Read Handle Value Command name Parameters Return Aci Gatt Read Handle Value 0xFD2A Attribute handle Status value Description Reads the value of the attribute handle specified Table 242 Aci Gatt Read Handle Value command parameters Parameter Size Description Attribute handle 2 bytes Handle of the attribute to read Table 243 Aci Gatt Read Handle V
86. en a write reguest write command or signed write command is received by the server from the client This event will be given to the application only if the event bit for this event generation is set when the characteristic was added When this event is received the application has to check whether the value being reguested for write can be allowed to be written and respond with the command Aci Gatt Write Resp The details of the parameters of the command can be found Based on the response from the application the attribute value will be modified by the stack If the write is rejected by the application then the value of the attribute will not be modified In case of a write REQ an error response will be sent to the client with the error code as specified by the application In case of write signed write commands no response is sent to the client but the attribute is not modified Table 249 Evt_Blue_Gatt_Write_Permit_req Parameter Size Description Event code 2 bytes The event code of the vendor specific event Handle of the connection on which there was the request to write Connection handle 2 bytes the attribute The handle of the attribute for which the write request has been Attribute handle 2 bytes made by the client data_len 1 byte The length of the data to follow data buffer O N bytes The data that the client has requested to write Evt Blue Gatt Read Permit Rea This event is given to the appli
87. erated Before procedure completion the response packets are given through Evt_Blue_Att_Read_By_Type_Resp event 4 5 23 Aci_Gatt_Disc_Charac_By_UUID Table 181 Aci Gatt Disc Charac By UUID Command name Parameters Return Connection handle Start Attr handle Aci Gatt Disc Charac By UUID 0xFD16 End Attr handle Status UUID type UUID Description Start the procedure to discover all the characteristics specified by the UUID Table 182 Aci Gatt Disc Charac By UUID command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given Start Attr handle 2 bytes Start attribute handle of the service End Attr handle 2 bytes End attribute handle of the service 0x01 16 bit UUID default aa a TEE 0x02 128 bit UUID 2 bytes or UUID 16 bytes UUID 92 131 DoclD026257 Rev 3 Ly UM1755 Vendor specific commands Table 183 Aci Gatt Disc Charac By UUID return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed Status 1 byte If the exchange bus already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt Blue Gatt Procedure Cmplt
88. es Supervision timeout for the LE Link Range 0x000A to 0x0C80 Time N 10 msec Time Range 100 msec to 32 seconds DoclD026257 Rev 3 61 131 Vendor specific commands UM1755 4 3 33 62 131 Table 101 Aci_Gap_Start_Connection_Update command parameters continued Parameter Size Description Minimum length of connection needed for the LE connection Conn_Len_Min 2 bytes Range 0x0000 OxFFFF Time N 0 625 msec Maximum length of connection needed for the LE connection Conn_Len_Max 2 bytes Range 0x0000 OxFFFF Time N 0 625 msec Table 102 Aci Gap Start Connection Update return parameters Parameter Size Description 0x00 BLE STATUS SUCCESS Status 1 byte 0x12 BLE STATUS INVALID PARAMETER 0x0C ERR COMMAND DISALLOWED Event s generated A command status event is generated as soon as the command is given If BLE STATUS SUCCESS is returned on completion of connection update a LE Connection Update Complete event is returned to the upper layer Aci Gap Send Pairing Request Table 103 Aci Gap Send Pairing Request Command name Parameters Return Conn Handle Force Rebond Aci Gap Send Pairing Request OXFC9F Status Description Send the SM pairing request to start a pairing process The authentication requirements and IO capabilities should be set before issuing this command using the Aci Set IO Capabilities and Aci Set Aut
89. esigned for the controller All standard HCl command are clearly defined in the Bluetooth specification so they are not described in this document 2 Vendor specific VS HCI commands the commands with an OGF value 0x3F and are designed for the controller Each vendor can define their own VS commands based on the hardware implementation The V8 commands defined for the BlueNRG are described in this document 3 Vendor specific VS ACI commands the commands also with an OGF value Ox3F but these commands are designed to control access the host The Bluetooth specification does not define any command for the host so all the ACI commands are naturally vendor specific The ACI commands for the BlueNRG are described in this document To clarify the commands designed to control the controller are called HCI commands This name is defined by the Bluetooth specification and we maintain it here in order to comply with the specification The commands designed to control the host are called ACI commands We give it a different name to indicate that this command is rather assigned to the host i e to the whole BLE system and not only to the controller at the lower level However because both ACI and HCI commands are the commands received from the external device via the ACI interface and both of them share the same data format sometimes it is not very important to differentiate between the two So in this document when referring in general to comman
90. eter Size Description Connection handle 2 bytes Connection handle for which the command is given AttrHandle 2 bytes Handle of the attribute to be written ValLen 1 byte Length of the value to be written AttrVal O N bytes Value to be written Table 216 Aci_Gatt_Write_Charac_Descriptor return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed Status 1 byte If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt Blue Gatt Procedure Cmplt event is generated d DoclD026257 Rev 3 103 131 Vendor specific commands UM1755 4 5 35 Aci_Gatt_Read_Charac_Descriptor Table 217 Aci_Gatt_Read_Charac_Descriptor Command name Aci_Gatt_Read_Charac_Descriptor OxFD22 AttrHandle Parameters Return Connection handle Status Description Start the procedure to read the descriptor specified Table 218 Aci_Gatt_Read_Charac_Descriptor command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given AttrHandle 2 bytes Handle of the descriptor to be read Table 219 Aci_Gatt_Read_Ch
91. eturn parameters Parameter Size Description 0x00 Success 0x42 Invalid parameter OxOC Command disallowed Event s generated When the command has completed the controller will generate a command complete event d DoclD026257 Rev 3 Vendor specific commands d Aci Gap Set Auth Requirement Table 32 Aci Gap Set Auth Requirement Command name Aci Gap Set Auth Requirement OxFC86 Parameters Return MIMT mode OOB enable OOB data Mi tion key si in encryption key size Status Max encryption key size Use fixed pin Fixed pin Bonding mode Description Set the authentication requirements for the device If the OOB Enable is set to 0 the following 16 octets of OOB Data will be ignored on reception This command has to be given only when the device is not in a connected state Table 33 Aci Gap Set Auth Requirement command parameters Parameter Size Description MIMT mode 1 byte 0x00 MIMT not required y 0x01 MIMT required OOB enable para 0x00 Out Of Bound authentication not enabled y 0x01 Out Of Bound authentication enabled OOB data 16 bytes OOB data Min encryption key 1 byte Minimum size of the encryption key to be used during the pairing size y process Max encryption key 1 byte Maximum size of the encryption key to be used during the pairing size process 0x00 Use fixed pin during the pairing process Use fixed pin 1 byte Ox Do not use a pin dur
92. event is generated Before procedure completion the response packets are given through Evt Blue Gatt Disc Read Charac By UUID Resp event 4 5 24 Aci Gatt Disc All Charac Descriptors Table 184 Aci Gatt Disc All Charac Descriptors Command name Parameters Return Connection handle Aci Gatt Disc All Charac Descriptors OXFD17 charValHandle Status EndHandle Description Start the procedure to discover all characteristic descriptors on the server Table 185 Aci Gatt Disc All Charac Descriptors command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given charValHandle 2 bytes Starting handle of the characteristic EndHandle 2 bytes End handle of the characteristic ky DoclD026257 Rev 3 93 131 Vendor specific commands UM1755 4 5 25 94 131 Table 186 Aci_Gatt_Disc_All_Charac_Descriptors return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Status 1 byte Event s generated A command status event is generated on the receipt of the command When the procedure is completed a Evt_Blue_Gatt_Procedure_Cmplt event is generated Before proce
93. evious request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Event s generated A command status event is generated on the receipt of the command When the ATT MTU exchange procedure is completed a Evt_Blue_Att_Exchange_MTU_Resp event is generated Also procedure complete event is generated to indicate end of procedure Aci Att Find Information Rea Table 151 Aci Att Find Information Rea Command name Parameters Return Connection handle Aci Att Find Information Reg OxFDOC Start handle Status End handle Description Post the Find information request Table 152 Aci Att Find Information Req command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given Start handle 2 bytes y handle of the range of attributes to be discovered on the End handle 2 bytes Ending handle of the range of attributes to be discovered on the server d DoclD026257 Rev 3 UM1755 Vendor specific commands Table 153 Aci_Att_Find_Information_Req return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed Statis 1 byte If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT pr
94. g a Aci_L2CAP_Connection_Update_Resp command to the BlueNRG Table 16 Evt_Blue_L2CAP_Connection_Update_Request Parameter Size Description Event code 2 bytes The event code for connection update request event Handle of the connection for which the connection update request has been received The same handle has to be returned Conn_Handle 2 bytes while responding to the event with the command Aci L2CAP Connection Update Resp Length of the data to follow The data will be the L2CAP DataLen 1 byte i connection update request received This is the identifier which associates the request to the Identifier 1 byte response The same identifier has to be returned by the upper layer in the command Aci L2CAP Connection Update Resp Length 2 bytes Length of the L2CAP connection update request Interval Min 2 bytes Value as defined in Bluetooth 4 0 spec Volume 3 Part A 4 20 Interval Max 2 bytes Value as defined in Bluetooth 4 0 spec Volume 3 Part A 4 20 Slave Latency 2 bytes Value as defined in Bluetooth 4 0 spec Volume 3 Part A 4 20 Timeout Multiplier 2 bytes Value as defined in Bluetooth 4 0 spec Volume 3 Part A 4 20 d DoclD026257 Rev 3 UM1755 Vendor specific commands 4 3 GAP VS commands and events 4 3 1 Overview 3 There are 4 GAP roles defined for LE devices e Broadcaster Broadcaster is a device that sends advertising events Broadcaster shall have a transmitter an
95. ge data Figure 6 HCI ACL data packet 0 4 12 16 20 24 28 31 Handle EE Data Total Length Data 18 131 GAMS2904141420SG DoclD026257 Rev 3 d UM1755 Standard HCI commands 3 Standard HCI commands 3 1 Supported HCI commands The table below lists the standard Bluetooth HCl commands which are supported by the BlueNRG For the details of each command e g command descriptions parameters etc please refer to the Bluetooth core specification Volume 2 Part E Chapter 7 Table 2 HCI commands Item Command OGF OCF OpCode 1 HCI Disconnect 0x01 0x06 0x0406 2 HCI Read Remote Version Information 0x01 0x1D 0x041D 3 HCI Set Event Mask 0x03 0x01 0x0C01 4 HCI Reset 0x03 0x03 Ox0C03 5 HCI Read Transmit Power Level 0x03 Ox2D OxOC2D 6 HCI Read Local Version Information 0x04 0x01 0x1001 7 HCI Read Local Supported Commands 0x04 0x02 0x1002 8 HCI Read Local Supported Features 0x04 0x03 0x1003 9 HCI Read BD ADDR 0x04 0x09 0x1009 10 HCI Read RSSI 0x05 0x05 0x1405 11 HCI LE Set Event Mask 0x08 0x01 0x2001 12 HCI LE Read Buffer Size 0x08 0x02 0x2002 13 HCI LE Read Local Supported Feature 0x08 0x03 0x2003 14 HCI LE Set Random Address 0x08 0x05 0x2005 15 HCI LE Set Advertizing Parameters 0x08 0x06 0x2006 16 HCI LE Read Advertizing Channel Tx Power 0x08 0x07 0x2007 17 HCI LE Set Advertizing Data 0x08 0x08 0x2008 18
96. ger to complete the pairing procedure and rebond with the master Table 75 Aci Allow Rebond return parameters Parameter Size Description Status 1 byte 0x00 Success Event s generated The controller will generate a command complete event on the completion of the command Even if the command is given when it is not valid success will be returned but internally it will have no effect Aci Gap Start Limited Discovery Proc Table 76 Aci Gap Start Limited Discovery Proc Command name Parameters Return Scan Interval Scan Window Own Address Type filterDuplicates Aci Gap Start Limited Discovery Proc OxFC96 Status Description Start the limited discovery procedure The controller is commanded to start active scanning When this procedure is started only the devices in limited discoverable mode are returned to the upper layers Table 77 Aci Gap Start Limited Discovery Proc command parameters Parameter Size Description Time interval from when the controller started its last LE scan until it begins the subsequent LE scan The scan interval should Scan Interval 2 bytes be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0 625 msec Amount of time for the duration of the LE scan Scan Window shall be less than or equal to Scan Interval The scan window Scan Window 2 bytes should be a number in the ra
97. gical layers e g L2CAP GAP GATT etc It also helps to categorize the VS commands with a more clear structure The CID determines the ID of each command Each CGID group can have up to 128 VS commands Table 4 CGID group Command group Description CGID HCI HCI extension commands 0x0 GAP Generic access profile commands 0x1 GATT Generic attribute profile commands 0x2 L2CAP L2CAP commands 0x3 Reserved 0x4 0x7 The VS event also has a slightly different format than the standard HCI event see also Section 2 3 1 The 8 bit event code of the VS event always has the value of OxFF 2 The 16 bit event parameter O has a different format DoclD026257 Rev 3 21 131 Vendor specific commands UM1755 Figure 8 Event parameter 0 format for VS events BlueNRG Event Code ECODE 16 bits Event Group ID EGID Event ID EID 6 bits 10 bits GAMS2904141435SG 22 131 The event parameter 0 is the first return parameter in the HCI event packets following the Parameter Length field These 2 bytes together are defined as the BlueNRG Event Code ECODE ECODE is further divided into 2 fields Event Group ID EGIO and Event ID EID BlueNRG combines the events into logical groups using the EGID And the EID is used to specify an event in the group The EGID occupies 6 bits in the ECODE field while the EID occupies the remaining 10 bits Table 5 EGID group Eve
98. hat IRQ pin must be high Z when there is no data to send is because we also use this pin as input when BlueNRG boots up The IRQ pin value will determine if the updater mode is required or not After the BlueNRG goes to normal working state the IRQ pin is configured as output for SPI interface Note also that the MISO also goes to high Z when BlueNRG does not send data This allows multi SPI slaves on the same bus This other SPI slave may access the bus when BlueNRG does not d DoclD026257 Rev 3 UM1755 SPI interface 5 2 SPI communication protocol To communicate with the BlueNRG the data on the SPI bus must be formatted as described in this section An SPI transaction is defined from the time instant when the master puts the nCS line to low until the time instant when the nCS line is back to high Each SPI transaction should contain 1 data frame Each data frame should contain at least 5 bytes of header and may have O N bytes of data 5 2 1 Header 3 Figure 10 SPI header format ta I ncS l EE EE t cek TI Aim Tum mmm NL MOSI A CTRL X 0x00 X 0x0 X 0x00 X 0x00 X MISO Figure 10 above shows an SPI frame with minimum 5 bytes SPI header and O byte SPI data The header of the master is on the MOSI line which is 1 control byte and 4 bytes 0x00 The control byte can have only the value of OxOA SPI write or OxOB SPI read The BlueNRG returns the slave header on the MISO line at the same
99. hentication Requirements commands Table 104 Aci Gap Send Pairing Request command parameters Parameter Size Description Handle of the connection for which the pairing request has to be Conn Handle 2 bytes sent 0x00 Pairing request is sent only if the device has not previously bonded 0x01 Pairing request will be sent even if the device was previously bonded Force Rebond 1 byte d DoclD026257 Rev 3 UM1755 Vendor specific commands Table 105 Aci Gap Send Pairing Request return parameters Parameter Size Description 0x00 BLE STATUS SUCCESS Status 1 byte 0x12 BLE STATUS INVALID PARAMETER 0x0C ERR COMMAND DISALLOWED Event s generated A command status event is generated when the command is received If BLE STATUS SUCCESS is returned in the command status event a Evt Blue Pairing Complete event is returned after the pairing process is completed 4 3 34 Aci Gap Resolve Private Address Table 106 Aci Gap Resolve Private Address Command name Parameters Return Aci Gap Resolve Private Address OxFCAO Address Status Description This command tries to resolve the address provided with the IRKs present in its database If the address is resolved successfully with any one of the IRKs present in the database it returns success Table 107 Aci Gap Resolve Private Address command parameters Parameter Size Description Address 6 bytes Address to be
100. hich a connection has to be Peer Address 6 bytes established 0x00 Public device address default Own Addis Ee ype 1 Dyte 0x01 Random device address d 58 131 DoclD026257 Rev 3 UM1755 Vendor specific commands Table 95 Aci Gap Create Connection command parameters continued Parameter Size Description Minimum value for the connection event interval This shall be less than or equal to Conn Interval Max Conn Interval Min 2 bytes Range 0x0006 to 0x0C80 Time N 1 25 msec Time Range 7 5 msec to 4 seconds Maximum value for the connection event interval This shall be greater than or equal to Conn Interval Min Conn Interval Max 2 bytes Range 0x0006 to 0x0C80 Time N 1 25 msec Time Range 7 5 msec to 4 seconds Slave latency for the connection in number of connection events Conn Lat 2 byt vi aa d YES Range 0x0000 to 0x01F4 Supervision timeout for the LE Link Range 0x000A to 0x0C80 Time N 10 msec Time Range 100 msec to 32 seconds Supervision Timeout 2 bytes Minimum length of connection needed for the LE connection Conn Len Min 2 bytes Range 0x0000 OxFFFF Time N 0 625 msec Maximum length of connection needed for the LE connection Conn Len Max 2 bytes Range 0x0000 OxFFFF Time N 0 625 msec Table 96 Aci Gap Create Connection return parameters Parameter Size Description 0x00 BLE STATUS SUCCESS Status 1 b
101. i Gatt Del Characteristic command parameters SS ee eee eens 78 Table 138 Aci Gatt Del Characteristic return parameters ccc ccc eens 79 Table 139 Aci Gatt Del Service EE 00000 cette 79 Table 140 Aci Gatt Del Service command parameters SS SS SS SS SE ES Se ee ee 79 Table 141 Aci Gatt Del Service return parameters a 79 Table 142 Aci Gatt Del Include Service n a nananana eee eens 80 Table 143 Aci Gatt Del Include Service command parameters EE EE EE Ee 80 Table 144 Aci Gatt Del Include Service return parameters EE EE EE EE ee ee 80 Table 145 Aci Gatt Set Event Mask SS SS SS SS SS rrr 80 Table 146 Aci Gatt Set Event Mask command parameters EE EE ee ee 81 Table 147 Aci Gatt Set Event Mask return parameters iss SE EE cece eee ee ee 81 Table 148 Aci Gatt Exchange Configuration sasaa aaaeeeaa 81 Table 149 Aci Gatt Exchange Configuration command parameters EE Ee ee ee 82 Table 150 Aci Gatt Exchange Configuration return parameters EE Ee ee ee ee 82 Table 151 Aci Att Find Information Reg EE EE EE EE 0c eects 82 Table 152 Aci Att Find Information Red command parameters annaa EE EE less 82 Ly DocID026257 Rev 3 9 131 List of tables UM1755 Table 153 Table 154 Table 155 Table 156 Table 157 Table 158 Table 159 Table 160 Table 161 Table 162 Table 163 Table 164 Table 165 Tabl
102. icates Num_WhiteList_Entries Addr_Array Description Start a selective connection establishment procedure The GAP adds the specified device addresses into white list and enables scanning in the controller with the scanner filter policy set to accept packets only from devices in whitelist All the devices found are sent to the upper layer by the event Evt Blue Gap Found Device The upper layer then has to select one of the devices to which it wants to connect by issuing the command Aci_Gap_Create_Connection Table 92 Aci Gap Start Selective Conn Establishment command parameters Parameter Size Description 0x00 Passive scanning S T 1 byt Can Iype yte 0x01 Active scanning Time interval from when the controller started its last LE scan until it begins the subsequent LE scan The scan interval should Scan Interval 2 bytes be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0 625 msec DocID026257 Rev 3 Ly UM1755 Vendor specific commands d Table 92 Aci Gap Start Selective Conn Establishment command parameters Parameter Size Description Amount of time for the duration of the LE scan Scan Window shall be less than or equal to Scan Interval The scan window Scan Window 2 bytes should be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0
103. ice Handle 2 bytes Handle of the service to which another service has to be included Include Start Handle 2 bytes Start handle of the service which has to be included in service Include End Handle 2 bytes End handle of the service which has to be included in service 0x01 16 bit UUID Include_UUID_Type 1 byte 0x02 128 bit UUID Include_UUID 2 byles Of debit or 1 28 bit UUID of the service ng 16 bytes Table 126 Aci Gatt Include Service return parameters Parameter Size Description 0x00 Success 0x47 Error Ox1F Out of Memory 0x60 Invalid handle Stat 1 byt ene ye 0x61 Invalid parameter 0x62 Out of handle 0x63 Invalid Operation 0x64 Insufficient resources Included handle 2 bytes Handle of the included declaration Event s generated When the Aci_Gatt_Add_Service command is completed controller will generate a command complete event with status and handle for the service as parameters 4 5 5 Aci_Gatt_Add_Characteristic Table 127 Aci_Gatt_Add_Characteristic Command name Parameters Return Service_Handle Char_UUID_Type Char UUID Char Value Length Status Aci Gatt Add Characteristic OxFD04 Char Properties Char handle Security Permissions Gatt Evt Mask Encryption Key Size isVariable d DoclD026257 Rev 3 73 131 Vendor specific commands UM1755 74 131 Description Add a characteristic to a service Table 128 Aci_Gatt_Add_Characteristic comma
104. igure 0x00 0x02 OxFC02 3 Hal IO set bit 0x00 0x03 OxFCO3 4 Hal IO get bit 0x00 0x04 OxFC04 5 Write_Config_data 0x00 Ox0C OxFCOC 6 Read Config data 0x00 OxOD OxFCOD 7 Set Tx power level 0x00 OXOF OXFCOF 8 Device Standby 0x00 0x13 OxFC13 9 Number Of Packet Sent in DirectTX 0x00 0x14 OxFC14 10 Tone Start 0x00 0x15 OxFC15 11 Tone Stop 0x00 0x16 OxFC16 12 Updater Start 0x00 0x20 OxFC20 13 Updater Reboot 0x00 0x21 OxFC21 14 Updater Version 0x00 0x22 OxFC22 15 Updater Buffer Size 0x00 0x23 OxFC23 16 Updater Erase Blue Flag 0x00 0x24 OxFC24 17 Updater Reset Blue Flag 0x00 0x25 OxFC25 18 Updater Erase Sector 0x00 0x26 OxFC26 19 Updater Program Data Block 0x00 0x27 OxFC27 20 Updater Read Data Block 0x00 0x28 OxFC28 21 Updater Calculate CRC 0x00 0x29 OxFC29 22 Updater Read HW Version 0x00 Ox2A OxFC2A 1 Forthe updater commands i e OpCode with OxFC2x please refer to the separate document BlueNRG Updater Specification 2 The4 HAL IO XXX commands Item 1 4 are disabled in the current release DoclD026257 Rev 3 d UM1755 Vendor specific commands 4 7 2 4 7 3 d Hal IO Init Table 254 Hal IO Init Command name Parameters Return Hal IO Init OXFCO1 Status Description Initialize the GPIOs of the BlueNRG device Table 255 Hal IO Init return parameters Parameter Size Description 0x00 BLE STATUS SUCCESS Status 1byte 0x47 BLE_STATUS_ERROR Event s generated
105. ing the pairing process In this case GAP will generate Evt Blue Pin Code Request event to the host n Fixed pin to be used during pairing if MIMT protection is enabled Fixed pin ies Any random value between 0 to 999999 0x00 Bondi t ired Bonding mode 1 byte bis MN E 0x01 Bonding required DoclD026257 Rev 3 35 131 Vendor specific commands UM1755 4 3 9 36 131 Table 34 Aci_Gap_Set_Auth_Requirement return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameter 0x0C Command Disallowed 0x11 Unsupported Feature Status 1 byte Event s generated When the command has completed the controller will generate a command complete event Aci_Gap_Set_Author_Requirement Table 35 Aci Gap Set Author Requirement Command name Parameters Return Connection handle Aci Gap Set Author Requirement OxFC87 Authorization enable Status Description Set the authorization requirements of the device This command has to be given only when the device is not in a connected state Table 36 Aci_Gap_Set_Author_Requirement command parameters Parameter Size Description Handle of the connection in case BlueNRG is configured as a Connection handle 2 bytes master otherwise it can be also 0 0x00 Authorization not required default 0x01 Authorization required This enables the authorization in 1 byte the device and when a remote device tries
106. it req If the write can be allowed then the status and error code has to be set to O If the write cannot be allowed then the status has to be set to 1 and the error code has to be set to the error code that has to be passed to the client Table 230 Aci Gatt Write Resp command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given Handle of the attribute that was passed in the event Airibute nandie 2 bytes Evt Blue Gatt Write Permit reg 0x00 The value can be written to the attribute specified by handle Status 1 byte 0x01 The value should not be written to the attribute specified by the handle The error code that has to be passed to the client in case the Error Code 1 byte h write has to be rejected Length of the value to be written as passed in the event Att Val ben 1 byte Evt Blue Gatt Write Permit reg Att Val O N bytes Value as passed in the event Evt Blue Gatt Write Permit req d DoclD026257 Rev 3 107 131 Vendor specific commands UM1755 4 5 40 108 131 Table 231 Aci_Gatt_Write_Resp return parameters Parameter Size Description 0x00 Success Status 1 byte 0x46 Not allowed The command is not allowed in the current state of stack Event s generated A command complete event is generated when this command is processed Aci Gatt Allow Read Table 232 Aci Gatt Allow Read
107. le 271 Read Config Data return parameters Parameter Size Description eius para 0x00 BLE STATUS SUCCESS T 0x12 ERR INVALID HCI CMD PARAMS Value O N bytes Value read at the offset specified d DoclD026257 Rev 3 UM1755 Vendor specific commands 4 7 8 d Event s generated The controller will generate a command complete event Set Tx power level Table 272 Set Tx power level Command name Parameters Return EN HIGH POWER Set Tx power level OXFCOF Status PA LEVEL Description This command sets the TX power level of the BlueNRG By controlling the EN HIGH POWER and the PA LEVEL the combination of the 2 determines the output power level dBm See the table below When the system starts up or reboots the default TX power level will be used which is the maximum value of 8 dBm Once this command is given the output power will be changed instantly regardless if there is Bluetooth communication going on or not For example for debugging purpose the BlueNRG can be set to advertise all the time And use this command to observe the signal strength changing The system will keep the last received TX power level from the command i e the 2nd command overwrites the previous TX power level The new TX power level remains until another Set TX Power command or the system reboots Table 273 Set Tx power level command parameters Parameter Size Description E
108. mand status event is generated as soon as the command is given If BLE STATUS SUCCESS is returned the procedure is terminated when either the upper layers issue a command to terminate the procedure by issuing the command Aci Gap Terminate Gap Procedure with the procedure code set to 0x02 or a timeout happens When the procedure is terminated due to any of the above reasons Evt Blue Gap Procedure Complete event is returned with the procedure code set to 0x02 50 131 DoclD026257 Rev 3 Ly UM1755 Vendor specific commands The device found when the procedure is ongoing is returned to the upper layers through the event Evt Blue Gap Found Device 4 3 26 Aci Gap Start Name Discovery Proc Table 82 Aci Gap Start Name Discovery Proc Command name Parameters Return Scan Interval Scan Window Peer Address Type Peer Address Own Address Type Aci Gap Start Name Discovery Proc OxFC98 Conn Interval Min Status Conn Interval Max Conn Latency Supervision Timeout Conn Len Min Conn Len Max Description Start the name discovery procedure ALE Create Connection call will be made to the controller by GAP with the initiator filter policy set to ignore whitelist and process connectable advertising packets only for the specified device Once a connection is established GATT procedure is started to read the device name characteristic When the read is completed successfully or unsuccessfully a Evt Blue Gap Procedu
109. n OxFC9C Conn Interval Min Status Conn Interval Max Conn Latency Supervision Timeout Conn Len Min Conn Len Max Description Start the direct connection establishment procedure ALE Create Connection call will be made to the controller by GAP with the initiator filter policy set to ignore whitelist and process connectable advertising packets only for the specified device The procedure can be terminated explicitly by the upper layer by issuing the command Aci Gap Terminate Gap Procedure When a command is issued to terminate the procedure by upper layer aLE Create Connection Cancel call will be made to the controller by GAP Table 95 Aci Gap Create Connection command parameters Parameter Size Description Time interval from when the controller started its last LE scan until it begins the subsequent LE scan The scan interval should Scan Interval 2 bytes be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0 625 msec Amount of time for the duration of the LE scan Scan Window shall be less than or equal to Scan Interval The scan window Scan Window 2 bytes should be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0 625 msec 0x00 Public device address default 0x01 Random device address Peer Address Type 1 byte Address of the peer device with w
110. n Establishment 0x01 Ox1B OxFC9B 28 Aci Gap Create Connection 0x01 Ox1C OxFC9C 29 Aci Gap Terminate Gap Procedure 0x01 Ox1D OxFC9D 30 Aci Gap Start Connection Update 0x01 Ox1E OxFC9E 31 Aci_Gap_Send_Pairing_Request 0x01 Ox1F OxFC9F 32 Aci Gap Resolve Private Address 0x01 0x20 OxFCAO 33 Aci Gap Get Bonded Devices 0x01 0x23 OxFCA3 28 131 DoclD026257 Rev 3 Ky UM1755 Vendor specific commands 4 3 3 Aci Gap Set Non Discoverable Table 18 Aci gap set non discoverable Command name Parameters Return Aci Gap Set Non Discoverable OxFC81 Status Description Set the device in non discoverable mode This command will disable the LL advertising and put the device in standby state Table 19 Aci gap set non discoverable return parameters Parameter Size Description Status 1 byte 0x0 Status ee OXC Command Disallowed Event s generated When the Aci_Gap_Set_Non_Discoverable command has completed the controller will generate a command complete event 4 3 4 Aci_Gap_Set_Limited_Discoverable d Table 20 Aci gap set limited discoverable Command name Parameters Return Advertising Event Type Adv Interval Min Adv Interval Max Address Type Adv Filter Policy Aci Gap Set Limited Discoverable OxFC82 Local Name Length Status Local Name Service Uuid Length Service Uuid List Slave Conn Interval Min Slave Conn Interval Max Description Set the device in limited discove
111. nd parameters Parameter Service_Handle Size 2 bytes Description Handle of the service to which the characteristic has to be added Char_UUID_Type 1 byte 0x01 16 bit UUID 0x02 128 bit UUID Char_UUID 2 bytes or 16 bytes 16 bit or 128 bit UUID Char_Value_Length 1 byte Maximum length of the characteristic value Char_Properties 1 byte Bitwise OR values of Characteristic Properties defined in Volume 3 Section 3 3 3 1 of Bluetooth Specification 4 0 Security_Permissions 1 byte 0x00 ATTR_PERMISSION_NONE 0x01 Need authentication to read 0x02 Need authorization to read 0x04 Link should be encrypted to read 0x08 Need authentication to write 0x10 Need authorization to write 0x20 Link should be encrypted for write Gatt_Evt_Mask 1 byte 0x01 GATT_SERVER_ATTR_WRITE The application will be notified when a client writes to this attribute 0x02 GATT_INTIMATE_AND_WAIT_FOR_APPL_AUTH The application will be notified when a write request write cmd signed write cmd is received by the server for this attribute 0x04 GATT_INTIMATE_APPL_WHEN_READ_N_WAIT The application will be notified when a read request of any type is got for this attribute Encryption_Key_Size 1 byte The minimum encryption key size requirement for this attribute Valid Range 7 to 16 isVariable 1 byte 0x00 The attribute has a fixed length value field 0x01 The att
112. nge 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0 625 msec DocID026257 Rev 3 Ly UM1755 Vendor specific commands Table 77 Aci Gap Start Limited Discovery Proc command parameters continued Parameter Size Description 0x00 Public device address default 0x01 Random device address 0x00 Do not filter the duplicates default 0x01 Filter duplicates Own Address Type 1 byte filterDuplicates 1 byte Table 78 Aci_Gap_Start_Limited_Discovery_Proc return parameters Parameter Size Description 0x00 BLE_STATUS_SUCCESS Status 1 byte 0x12 BLE STATUS INVALID PARAMETER 0x0C ERR COMMAND DISALLOWED Event s generated A command status event is generated as soon as the command is given If BLE STATUS SUCCESS is returned the procedure is terminated when either the upper layers issue a command to terminate the procedure by issuing the command Aci Gap Terminate Gap Procedure with the procedure code set to Ox01 or a timeout happens When the procedure is terminated due to any of the above reasons Evt Blue Gap Procedure Complete event is returned with the procedure code set to 0x01 The device found when the procedure is ongoing is returned to the upper layers through the event Evt Blue Gap Found Device d DoclD026257 Rev 3 49 131 Vendor specific commands UM1755 4 3 25 Aci_Gap_Start_General_Discovery
113. nse command parameters 24 Table 12 Aci L2CAP Connection Parameter Update Response return parameters 25 Table 13 E2CAP VS events usi bERR ISI e Eee ER edd uius ETE 25 Table 14 Evt Blue L2CAP Connection Update Resp 0000 eee eens 25 Table 15 Evt Blue L2CAP Procedure Timeout SG Ee ee ee eee 26 Table 16 Evt_Blue_L2CAP_Connection_Update_Request 2 200000 eee eee 26 Table 17 GAP VS commands 2 ee ee ee ee tte ns 28 Table 18 Aci gap set non discoverable EE EE EE EE EE EE ee Ge tee 29 Table 19 Aci gap set non discoverable return parameters is EE EE EG EE ee ee 29 Table 20 Aci gap set limited discoverable llle 29 Table 21 Aci gap set limited discoverable command parameters EE EE EE EE Ee 30 Table 22 Aci gap set limited discoverable return parameters EE EE EE EE ee 31 Table 23 Aci gap set discoverable nasaus anaana 31 Table 24 Aci gap set discoverable command parameters EE EE EE EE EE Ee ee 31 Table 25 Aci gap set discoverable return parameters nassaan EE EE EG Ee ee ee ee 32 Table 26 A Aci Gap Set Direct Connectable SEE SS SS SS SS SS ee ee ee ee 33 Table 27 Aci Gap Set Direct Connectable command parameters EE EE EE Ee 33 Table 28 Aci Gap Set Direct Connectable return parameters ananasa EE EE Ee ee 33 Table 29 Aci Gap Set IO Capabilty EE EE EE EE EE Ee ee es 3
114. nt Command name Aci Gap Start Auto Conn Establishment OxFC99 Parameters Return Scan Interval Scan Window Own Address Type Conn Interval Min Conn Interval Max Conn Latency Supervision Timeout Conn Len Min Conn Len Max Use reconn addr Reconn addr Num WhiteList Entries Addr Array Status Description Start the auto connection establishment procedure The devices specified are added to the white list of the controller and a LE Create Connection call will be made to the controller by GAP with the initiator filter policy set to use whitelist to determine which advertiser to connect to When a command is issued to terminate the procedure by upper layer a LE Create Connection Cancel call will be made to the controller by GAP Table 86 Aci Gap Start Auto Conn Establishment command parameters Parameter Scan Interval Size 2 bytes Description Time interval from when the controller started its last LE scan until it begins the subsequent LE scan The scan interval should be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0 625 msec Scan Window Own Address Type 2 bytes 1 byte Amount of time for the duration of the LE scan Scan Window shall be less than or equal to Scan Interval The scan window should be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 mse
115. nt Group Description EGID HCI HCI extension events 0x0 GAP Generic access profile commands 0x1 L2CAP L2CAP events 0x2 GATT Generic attribute profile events 0x3 DoclD026257 Rev 3 d UM1755 Vendor specific commands 4 2 4 2 1 4 2 2 d L2CAP VS commands and events L2CAP VS commands Table 6 L2CAP VS commands Item Command CGID CID OpCode 1 Connection Parameter Update Request 0x03 0x01 OxFD81 2 Connection Parameter Update Response 0x03 0x02 OxFD82 Aci L2CAP Connection Parameter Update Request Table 7 Aci L2CAP Connection Parameter Update Request Command name Parameters Return Connection handle Interval min Aci L2CAP Connection Parameter Update Request Interval max Status OxFD81 Slave latency Timeout multiplier Description Send an L2CAP connection parameter update request from the slave to the master Table 8 Aci L2CAP Connection Parameter Update Requests command parameters Parameter Size Description Connection handle of the link which the connection Connection handle 2 bytes parameter update request has to be sent Defines minimum value for the connection event interval Interval min 2 bytes in the following manner connintervalMin Interval Min 1 25 ms Defines maximum value for the connection event interval Interval max 2 bytes in the following manner connIntervalMax Interval Max 1 25 ms Slave latenc
116. nt packet In the BlueNRG the HCI synchronous data packet is not supported but the other three are HCI command packet When an external device gives a command to the BlueNRG the command must be formatted in a HCI command packet The BlueNRG only receives the HCI command packets but does not transmit Figure 4 HCI command packet 0 4 8 12 16 20 24 28 31 Parameter Total Parameter 0 OCF Length Parameter 1 Parameter e e e Parameter N 1 Parameter N GAMS2904141410SG Each HCI command uses a 2 byte OpCode to uniquely identify different types of commands The OpCode is divided into two fields the OpCode Group Field OGF and the OpCode Command Field OCF The OGF is the upper 6 bits and the remaining lower 10 bits are used by the OCF All HCI commands are grouped into logical groups by the Bluetooth specification and each group is assigned a unique OGF value DocID026257 Rev 3 Ly UM1755 ACI command data format d Table 1 OGF value Group name OGF value Link Control Commands 0x01 Link Policy Commands 0x02 Controller and Baseband Commands 0x03 Information Parameters 0x04 Status Parameters 0x05 Testing Commands 0x06 LE Controller Commands 0x08 Vendor Specific Commands Ox3F Depending on the OGF the commands can be categorized into 3 sets 1 Standard HCI commands the commands with an OGF value other than Ox3F These commands are d
117. ocedure is started Event s generated A command status event is generated on the receipt of the command The responses of the procedure are given through the Evt_Blue_ Att_Find_Information_Resp event The end of the procedure is indicated by a Evt_Blue_Procedure_Complete event 4 5 14 Att Find By Type Value Rea Table 154 Att Find By Type Value Reg Command name Att Find By Type Value Rea OxFDOD Status Parameters Return Connection handle Start handle End handle UUID AttrValLen AttrVal Description Post the Find by type value request Table 155 Aci_Att_Find_Attr_By_Typ_And_Value_Req command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given Start handle 2 bytes Starting handle of the range of attributes to be discovered on the server End handle 2 bytes Ending handle of the range of attributes to be discovered on the server UUID 2 bytes 16 bit UUID KYI DoclD026257 Rev 3 83 131 Vendor specific commands UM1755 Table 155 Aci Att Find Attr By Typ And Value Req command parameters Parameter Size Description Length of the attribute value to follow Note Though the max attribute value that is allowed according to AttrValLen 1 byte the spec is 512 octets due to the limitation of the transport layer command packet max length is 255 bytes the value is limited to 255 bytes At
118. of the attribute to be written Table 165 Aci Att Prepare Write Req return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Status 1 byte Event s generated A command status event is generated on the receipt of the command The responses of the procedure are given through the Evt_Blue_Att_Prepare_Write_Resp event The end of the procedure is indicated by a Evt_Blue_Procedure_Complete event 4 5 18 Aci_Att_Execute_Write_Req Table 166 Aci_Gatt_Execute_Write_Req Command name Parameters Return f Connection handle Aci Att Execute Write Req OxFD11 Status Execute Description All the writes previously prepared will be executed They will be either written or discarded as specified by the execute parameter d DoclD026257 Rev 3 87 131 Vendor specific commands UM1755 4 5 19 88 131 Table 167 Aci_Att_Execute_Write_Req command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given TRUE Execute the pending prepared writes Execute 1 byte i FALSE Cancel all pending writes that are prepared Table 168 Aci Att Exe
119. on 0x00 Public device address default Own Address Type T byte 0x01 Random device address BE 0x00 Public device address default me Andre Dips roe 0x01 Random device address Initiator_Direct_Address 6 bytes Initiator Bluetooth address Table 28 Aci Gap Set Direct Connectable return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameter 0x0C Command disallowed 0x11 Unsupported feature Status 1 byte Event s generated When the command has completed the controller will generate a command complete event The controller also generates a LE_Connection_Complete event with the status set to directed_advertising_timeout if the connection was not established and 0x00 if the connection was successfully established DoclD026257 Rev 3 33 131 d Vendor specific commands UM1755 4 3 7 34 131 Aci Gap Set IO Capability Table 29 Aci Gap Set IO Capability Command name Parameters Return Aci Gap Set IO Capability OxFC85 IO Capability Status Description Set the IO capabilities of the device This command has to be given only when the device is not in a connected state Table 30 Aci Gap Set IO Capability command parameters Parameter Size Description 0x00 Display Only 0x01 Display yes no IO Capability 1 byte 0x02 Keyboard Only 0x03 No Input no output 0x04 Keyboard display Table 31 Aci Gap Set IO Capability r
120. on_Connectable return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameter 0x0C Command disallowed 0x11 Unsupported feature Status 1 byte DoclD026257 Rev 3 39 131 Vendor specific commands UM1755 4 3 14 40 131 Event s generated A command complete event is generated upon the completion of the command Aci_Gap_Set_Undirected_Connectable Table 50 Aci Gap Set Undirected Connectable Command name Parameters Return Advertising filtering policy Own address type siiis Aci Gap Set Undirected Connectable OxFC8C Description Put the device into undirected connectable mode If privacy is enabled in the device a resolvable private address is generated and used as the advertiser s address If not the address of the type specified in Own Address Type is used for advertising Table 51 Aci Gap Set Undirected Connectable command parameters Parameter Size Description Adveitisina Event 0x00 Allow scan request from any allow connect request from a Ni ISING EVENL 1 byte any default TP 0x03 Allow scan request from white list only allow connect Own Address Typ 1 byte 0x00 Public device address default e yt 0x01 Random device address Table 52 Aci_Gap_Set_Undirected_Connectable return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameter Malus Toe 0x0C Command disallowed 0x11 Unsupported fea
121. ontroller If the command is a HCI command i e a command for the controller the ACI will forward directly the command to the controller bypassing it from the host This implementation has two advantages 1 normally the host can control the LL PHY without using the HCI commands which improves performance and 2 user applications can still test the controller individually or set up some low level hardware parameters with the HCI commands without going through the host Figure 3 BlueNRG ACI architecture Application Processor User Application ACI IE BlueNRG ACI GATT ATT SM lj L2CAP HCI LL PHY d DoclD026257 Rev 3 15 131 ACI command data format UM1755 2 2 1 2 2 16 131 ACI command data format When sending an ACI command to the BlueNRG the command must be formatted as described in this chapter Overview The BlueNRG ACI commands utilize and extend the standard HCI data format The standard HCI data format is a part of the Bluetooth core specification To avoid redundancy and inconsistency the texts are not copied into this document Please refer to the official Bluetooth specification Volume 2 Part E Chapter 5 for detailed information According to the Bluetooth specification a standard HCI packet can be an 1 HCl command packet 2 HCI ACL data packet 3 HCl synchronous data packet 4 HCI eve
122. plication when the application has set that authorization is required for reading writing of attributes This event will be generated as soon as the pairing is complete When this event is received Aci Gap Authorization Response command should be used to respond by the application Table 114 Evt Blue Authorization Request Parameter Size Description Event code 2 bytes 0x0403 Connection handle 2 bytes Connection handle for which authorization is being requested 4 4 5 Evt Blue Slave Security Initiated This event is generated when the slave security request is successfully sent to the master 4 4 6 Evt Blue Gap Bond Lost This event is generated when a pairing request is issued in response to a slave security request from a master which has previously bonded with the slave When this event is received the upper layer has to issue the command Aci Allow Rebond in order to allow the slave to continue the pairing process with the master 4 4 7 Evt Blue Gap Device Found d The event is given by the GAP layer to the upper layers when a device is discovered during scanning as a consequence of one of the GAP procedures started by the upper layers This event is given for all the devices that are scannable ADV IND or ADV SCAN IND regardless of the discoverable mode of the device A Evt Blue Gap Device Found event must be discarded by the application if it does not follow a Evt Blue Gap Device Found event with advertising data ADV IND or ADV SCAN IND from
123. ption This command sets the security permission for the attribute handle specified Currently the setting of security permission is allowed only for client configuration descriptor Table 236 Aci_Gatt_Set_Security_Permission command parameters Parameter Size Description Services handie 2 bytes Handle of the service which contains the attribute whose security permission has to be modified Attr handle 2 bytes Handle of the attribute whose security permission has to be modified 0x00 ATTR_PERMISSION_NONE 0x01 ATTR_PERMISSION_AUTHEN_READ 0x02 ATTR_PERMISSION_AUTHOR_READ Security permission 1 byte 0x04 ATTR_PERMISSION_ENCRY_READ 0x08 ATTR_PERMISSION_AUTHEN_WRITE 0x10 ATTR_PERMISSION_AUTHOR_WRITE 0x20 ATTR_PERMISSION_ENCRY_WRITE Table 237 Aci_Gatt_Set_Security_Permission return parameters Parameter Status Size 1 byte Description 0x00 Success 0x12 Invalid parameters 0x41 Failed Could not find the handle specified or the handle is not of a client configuration descriptor Event s generated A command complete event is generated when this command is processed d DoclD026257 Rev 3 109 131 Vendor specific commands UM1755 4 5 42 Aci Gatt Set Descriptor Value Table 238 Aci Gatt Set Descriptor Value Command name Parameters Return Service Handle Char Handle Desc Handle Aci Gatt Set Descriptor Value OxFD29 e Status val offset desc val l
124. r OxFF This means the BlueNRG SPI interface is still not initialized 3 The master keeps polling the BlueNRG releasing and asserting CS again In order to read again the header the SPI master has to release the CS line and assert it within 2ms from the previous CS assertion After a while the READY byte becomes 0x02 but both the buffer sizes are 0x00 This means the BlueNRG SPI is initialized but the buffer is not yet prepared 4 Assoon as the buffer size becomes non zero the master can write data to the BlueNRG With the measurement the master should allow about 0 5 ms for the BlueNRG to be completely ready for the SPI communication Note that 0 5 ms is when non retention RAM of BlueNRG must be initialized upon wakeup i e device in mode1 slave only mode The value can be 0 3 ms if non retention RAM initialization is not required which makes the SPI ready faster This waiting operation is only needed when the SPI bus is idle for a while If the master is continuously writing from the 2 write transaction there is no need to wait because the BlueNRG will not sleep if there is still SPI data to be processed Also there is no need to wait when reading from the BlueNRG because it cannot sleep if it still holds data for the master DoclD026257 Rev 3 129 131 Revision history UM1755 6 130 131 Revision history Table 286 Document revision history Date 30 May 2014 Revision 1 Changes Initial
125. r wraps back and starts from O again The counter is not cleared until the next Direct TX test starts Table 279 Number Of Packet Sent in DirectTX return parameters Parameter Size Description Status 1 byte 0x00 BLE STATUS SUCCESS Packet counter 4 bytes Number of packets sent during the last Direct TX test Event s generated The controller will generate a command complete event 4 7 11 Tone Start Table 280 Tone Start Command name Parameters Return Tone Start OxFC15 Channel ID Status Description d This command starts a carrier frequency i e a tone on a specific channel The frequency sine wave at the specific channel may be used for debugging purpose only The channel ID is a parameter from 0x00 to 0x27 for the 40 BLE channels e g 0x00 for 2 402 GHz 0x01 for 2 404 GHz etc This command should not be used when normal Bluetooth activities are ongoing The tone should be stopped by Tone Stop command DoclD026257 Rev 3 123 131 Vendor specific commands UM1755 4 7 12 124 131 Table 281 Tone_Start command parameters Parameter Size Description Channel ID 1 byte BLE Channel ID from 0x00 to 0x27 meaning 2 402 2 0xXX GHz Table 282 Tone_Start return parameters Parameter Size Description Status 1 byte 0x00 BLE_STATUS_SUCCESS Event s generated The controller will generate a command complete event Tone_Stop Table 283 Tone_Stop Command name Tone_Stop OxFC16 P
126. rDuplicates 1 byte 0x00 Do not filter the duplicates default 0x01 Filter duplicates Use_reconn_addr 1 byte If 1 the provided reconnection address is used as our address during the procedure the address has been previously notified to the application through EVT_BLUE_GAP_RECONNECTION_ADDRESS event Reconn_addr 6 bytes Reconnection address used if use reconn addris 1 DoclD026257 Rev 3 55 131 Vendor specific commands UM1755 4 3 29 56 131 Table 90 Aci_Gap_Start_General_Conn_Establishment return parameters Parameter Size Description 0x00 BLE_STATUS_SUCCESS Status 1 byte 0x12 BLE STATUS INVALID PARAMETER 0x0C ERR COMMAND DISALLOWED Event s generated A command status event is generated when the command is issued If the status is returned as BLE STATUS SUCCESS then on completion of the procedure a Evt Blue Gap Procedure Completed event is generated with the procedure code set to 0x10 The procedure is terminated when a connection is established or the upper layer terminates the procedure by issuing the command Aci Gap Terminate Gap Procedure with the procedure code set to 0x10 Aci_Gap_Start_Selective_Conn_Establishment Table 91 Aci_Gap_Start_Selective_Conn_Establishment Command name Parameters Return Scan_Type Scan Interval Scan Window Aci Gap Start Selective Conn Establishment Own Address Type Status OxFC9B filterDupl
127. rable mode as defined in GAP specification volume 3 section 9 2 3 The device will be discoverable for maximum period of TGAP lim adv timeout 180 seconds from errata The advertising can be disabled at any time by issuing Aci Gap Set Non Discoverable command The Adv Interval Min and Adv Interval Max parameters are optional If both are set to 0 the GAP will use default values for adv intervals for limited discoverable mode DoclD026257 Rev 3 29 131 Vendor specific commands UM1755 To allow a fast connection the host can set Local Name Service Uuid List Slave Conn Interval Min and Slave Conn Interval Max These parameters are optional in this command These values can be set in advertised data using GAP Update Adv Data command separately Table 21 Aci gap set limited discoverable command parameters Parameter Advertising Event Type Size 1 byte Description 0x00 Connectable undirected advertising default 0x02 Scannable undirected advertising 0x03 Non connectable undirected advertising Address Type 1 byte 0x00 Public device address default 0x01 Random device address Adv Filter Policy 1 byte 0x00 Allow scan request from any allow connect request from any default 0x01 Allow scan request from white list only allow connect request from Any 0x02 Allow scan request from any allow connect request from white list only 0x03 Allow scan request from white li
128. re Complete event is given to the upper layer The event also contains the name of the device if the device name was read successfully Table 83 Aci Gap Start Name Discovery Proc command parameters Parameter Size Description Time interval from when the controller started its last LE scan until it begins the subsequent LE scan The scan interval should Scan Interval 2 bytes be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0 625 msec Amount of time for the duration of the LE scan Scan Window shall be less than or equal to Scan Interval The scan window Scan Window 2 bytes should be a number in the range 0x0004 to 0x4000 This corresponds to a time range 2 5 msec to 10240 msec For a number N Time N 0 625 msec 0x00 Public device address default 0x01 Random device address Peer Address Type 1 byte Address of the peer device with which a connection has to be established 0x00 Public device address default 0x01 Random device address Peer Address 6 bytes Own Address Type 1 byte d DoclD026257 Rev 3 51 131 Vendor specific commands UM1755 52 131 Table 83 Aci_Gap_Start_Name_Discovery_Proc command parameters continued Parameter Size Description Minimum value for the connection event interval This shall be less than or equal to Conn Interval Max Conn_Interval_Min 2bytes Range 0x
129. re completed 0x00 Pairing success Pairing with a remote device was successful 0x01 Pairing timeout Status 1 byte The SMP timeout has elapsed and no further SMP commands will be processed until reconnection 0x02 Pairing failed The pairing failed with the remote device 4 4 3 Evt_Blue_Pass_Key_Request d This event is generated by the Security manager to the application when a passkey is required for pairing When this event is received the application has to respond with the Aci Gap Pass Key Response command The event is given by the GAP layer to the upper layers when a device is discovered during scanning as a consequence of one of the GAP procedures started by the upper layers This event is given for all the devices that are scannable ADV IND or ADV SCAN IND regardless of the discoverable mode of the device A Evt Blue Gap Device Found event must be discarded by the application if it does not follow a Evt Blue Gap Device Found event with advertising data ADV IND or ADV SCAN IND from the same device DoclD026257 Rev 3 65 131 Vendor specific commands UM1755 66 131 Table 113 Evt_Blue_Pass_Key_Request Parameter Size Description conn_handle 2 bytes Connection handle for which the passkey has been requested DoclDO26257 Rev 3 d UM1755 Vendor specific commands 4 4 4 Evt_Blue_Authorization_Request This event is generated by the Security manager to the ap
130. resolved Table 108 Aci Gap Resolve Private Address return parameters Parameter Size Description 0x00 BLE STATUS SUCCESS Status 1 byte 0x12 BLE STATUS INVALID PARAMETER 0x48 The address was not resolved Event s generated A command complete event is returned where the status indicates whether the command was successful d DoclD026257 Rev 3 63 131 Vendor specific commands UM1755 4 3 35 Aci_Gap_Get_Bonded_Devices Table 109 Aci_Gap_Get_Bonded_Devices Command name Parameters Return Status Num_of_Addresses Address Typelil Address i Aci Gap Get Bonded Devices 0xFCA3 Description This command allows to get the list of bonded devices address type and address for each bonded device Table 110 Aci Gap Get Bonded Devices return parameters Parameter Size Description 0x00 success Stat 1 byt Ue ys 0x64 Insufficient resources Num of Addresses 1 byte Number of bonded device 1 byte 0x00 Public Device Address Address Typen Num of Addresses 0x01 Random Device Address 6 bytes Public Device Address or Random Device dees N Num of Addresses Address of the device in the list Event s generated When the Aci Gap Get Bonded Devices command is completed controller will generate a command complete event with status number of addresses address type and address value of all the devices in the list 4 4 GAP VS events
131. ribute has a variable length value field DoclD026257 Rev 3 d UM1755 Vendor specific commands Table 129 Aci Gatt Add Characteristic return parameters Parameter Size Description 0x00 Success 0x47 Error Ox1F Out of Memory 0x60 Invalid handle Stat 1 byt pone sd 0x61 Invalid parameter 0x62 Out of handle 0x64 Insufficient resources 0x66 Character Already Exists Char Handle 2 bytes Handle of the Characteristic Event s generated When the command is completed a command complete event will be generated by the controller which carries the status of the command and the handle of the characteristic as parameters 4 5 6 Aci Gatt Add Char Desc Table 130 Aci Gatt Add Char Desc Command name Parameters Return Service Handle Char Handle Char Desc UUID Type Char Desc UUID Char Desc Value Max Length Char Desc Value Length Status Aci_Gatt_Add_Char_Desc 0xFD05 Char Desc Value Char desc B handle Security_Permissions Access_Permissions Gatt_Evt_Mask Encryption_Key_Size isVariable Description Add a characteristic descriptor to a service d DoclD026257 Rev 3 75 131 Vendor specific commands UM1755 76 131 Table 131 Aci_Gatt_Add_Char_Desc command parameters Parameter Size Description Serica Handle 2 bytes Handle of the service to which characteristic belongs Char Han
132. rn parameters ESE SS SS SS eens 87 Aci Gatt Execute Write Red EE EE SE eee 87 Aci Att Execute Write Reg command parameters a 88 Aci Att Execute Write Reg return parameters is EE ES cece eee 88 Aci Gatt Disc All Prim Services EE EE ES Ee Se ee ee ee ee 88 Aci Gatt Disc All Prim Services command parameters 0 0 88 Aci Gatt Disc All Prim Services return parameters EE EE EE ee ee 89 Aci Gatt Disc Prim serv By Uuid 2 EE GE EG Ge ee ee 89 Aci Gatt Disc Prim serv By Uuid command parameters 89 Aci Gatt Disc Prim serv By Uuid return parameters 0a 90 Aci Gatt Find Included Services SS SS EES SS eens 90 Aci Gatt Find Included Services command parameters 0 0000 e weenie 90 Aci Gatt Find Included Services return parameters 00 91 Aci Gatt Disc All Charac Of Serv EE 0000 cece lee 91 Aci Gatt Disc All Charac Of Serv command parameters 91 Aci Gatt Disc All Charac Of Serv return parameters Es ee ee 92 Aci Gatt Disc Charac By UUID sssssseee e n 92 Aci Gatt Disc Charac By UUID command parameters EE EE Ee ee ee 92 Aci Gatt Disc Charac By UUID return parameters EE EE see ee 93 Aci Gatt Disc All Charac Descriptors aa 93 Aci Gatt Disc All Charac Descriptors command parameters nanan EE Ee 93 Aci Gatt Disc All Charac De
133. scriptors return parameters EE ss Ee Ee 94 Aci Gatt Read Charac Val EE EE EE EE ES Ee tees 94 Aci Gatt Read Charac Val command parameters EE EE Ee ee ee 94 Aci_Gatt_Read_Charac_Val return parameters elles 94 Aci Gatt Read Charac Using UUID EE EE EE EG ee ee ee 95 Aci Gatt Read Charac Using UUID command parameters 95 Aci Gatt Read Charac Using UUID return parameters SEE EE ee ee 95 Aci Gatt Read Long Charac Val 2 2 96 Aci Gatt Read Long Charac Val command parameters EE EE ee 96 Aci Gatt Read Long Charac Val command return parameters 96 Aci Gatt Read Multiple Charac Values SS 0 ccc eee Se 97 Aci Gatt Read Multiple Charac Values command parameters 97 Aci Gatt Read Multiple Charac Values return parameters 000000 97 Aci Gatt Write Charac Val naaa aaa aeaaea 98 Aci Gatt Write Charac Val command parameters EE EE EE es ee ee 98 Aci Gatt Write Charac Val return parameters EE EE EG Ee cece ese 98 Aci Gatt Write Long Charac Val EE EE EE EE Ee Ge ne 99 Aci Gatt Write Long Charac Val command parameters EE EE EE Ee ee 99 Aci Gatt Write Long Charac Val return parameters iS EE Es ee ee 99 DocID026257 Rev 3 Ly UM1755 List of tables Table 205 Aci Gatt Write Charac Reliable
134. st only allow connect request from white list only Local Name Length 1 byte Length of the local name string in octets If length is set to 0x00 Local Name parameter should not be used Local Name O N bytes Local name of the device This is an ASCII string without NULL character Service UUID Length Service UUID List 1 byte O N bytes Length of the service UUID list in octets If there is no service to be advertised set this field to 0x00 This is the list of the UUID s AD types as defined in Volume 3 Section 11 1 1 of GAP Specification Slave Conn Interval Min 2 bytes Slave connection internal minimum value Connection interval is defined in the following manner connintervalmin Slave Conn Interval Min 1 25 ms Slave Conn Interval Min range 0x0006 to 0x0C80 Value of OxFFFF indicates no specific minimum Slave Conn Interval Max 2 bytes Slave connection internal maximum value Connlntervalmax Slave Conn Interval Max 1 25 ms Slave Conn Interval Max range 0x0006 to 0x0C80 Slave Conn Interval Max shall be equal to or greater than the Slave Conn Interval Min Value of OxFFFF indicates no specific maximum 30 131 DoclD026257 Rev 3 d UM1755 Vendor specific commands 4 3 5 d Table 22 Aci gap set limited discoverable return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameter 0x0C Command disallowed
135. t Already a request is in the queue to be sent Channel not open Already one GATT procedure is started 1 byte Event s generated A command status event is generated on the receipt of the command The responses of the procedure are given through the Evt Blue Att Read By Group Resp event The end of the procedure is indicated by a Evt_Blue_Procedure_Complete event 4 5 20 Aci_Gatt_Disc_Prim_serv_By_Uuid Table 172 Aci_Gatt_Disc_Prim_serv_By_Uuid Command name Parameters Return Connection handle Aci_Gatt_Disc_Prim_Serv_By_Uuid OxFD13 UUID type Status UUID Description This command will start the procedure to discover the primary services of the specified UUID on the server Table 173 Aci_Gatt_Disc_Prim_serv_By_Uuid command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given 0x01 16 bit UUID default AE EE HE 0x02 128 bit UUID UUID Dyer Dui 16 bytes d DoclD026257 Rev 3 89 131 Vendor specific commands UM1755 Table 174 Aci Gatt Disc Prim serv By Uuid return parameters Parameter Size Status 1 byte 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is s
136. t Find Information Resp Evt Blue Att Find By Type Value Resp Evt Blue Att Read By Type Resp Evt Blue Att Read Resp Evt Blue Att Read Blob Resp Evt Blue Att Read Multiple Resp Evt Blue Att Read By Group Resp Evt Blue Att Write Resp Evt Blue Att Prepare Write Resp Evt Blue Att Exec Write Resp Evt Blue Gatt Indication Evt Blue Gatt notification Evt Blue Gatt Error Resp Evt Blue Gatt Procedure Complete Table 147 Aci Gatt Set Event Mask return parameters Parameter Size Description Status 1 byte 0x00 Success 0x12 Invalid HCI Command Parameters Event s generated A command complete event is generated on Aci Gatt Exchange Configuration the completion of the command Table 148 Aci Gatt Exchange Configuration Command name Parameters Return Aci Gatt Exchange Configuration OXFDOB Connection handle Status Description Perform an ATT MTU exchange DoclD026257 Rev 3 81 131 Vendor specific commands UM1755 4 5 13 82 131 Table 149 Aci_Gatt_Exchange_Configuration command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is givens Table 150 Aci_Gatt_Exchange_Configuration return parameters Parameter Size Description 0x00 Success 0x46 Not allowed If the exchange has already taken place Status 1 byte If GATT is expecting response for pr
137. tarted Description Event s generated A command status event is generated on the receipt of the command The responses of the procedure are given through the Evt_Blue_Att_Find_By_Type_Value_Resp event The end of the procedure is indicated by a Evt_Blue_Procedure_Complete event 4 5 21 Aci_Gatt_Find_Included_Services Table 175 Aci_Gatt_Find_Included_Services Command name Parameters Return Connection handle Aci Gatt Find Included Services OxFD14 Start handle Status End handle Description Start the procedure to find all included services Table 176 Aci Gatt Find Included Services command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given Start handle 2 bytes Start handle of the service End handle 2 bytes End handle of the service 90 131 DoclD026257 Rev 3 d UM1755 Vendor specific commands Table 177 Aci_Gatt_Find_Included_Services return parameters Parameter Status Size 1 byte Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Event s generated A command status event is generated on the receipt of the command The responses of th
138. te AD Type nananana 0 00000 cece nes 42 Aci Gap Delete AD Type command parameters eee ee 43 Aci Gap Delete AD Type return parameters EE EE EE EE eee ee ee 43 Aci Gap Get Security Level EE EE EE EE EE EE Ee eee 43 Aci Gap Get Security Level return parameters EE EE Es ee ee ee ee 44 Aci Gap Set Event Mask 22 22G 45 Aci Gap Set Event Mask command parameters 22 ES ES Ee ee ee 45 Aci Gap Set Event Mask return parameters 2 EE ES EE ee ee ee ee 45 Aci Gap Configure Whitelist ee EE EE EE SE ee Ee ee Ee ee ee ee ee ee 46 Aci Gap Configure Whitel ist return parameters EE EE EE Ee ee ee 46 Aci Gap Terminate nanana 0000 EE Ee ee Ee eee eee 46 Aci Gap Terminate command parameters SS a 46 Aci Gap Terminate return parameters SS SS aaa 47 Aci Gap Clear Security Database 0 EE EG Ee te 47 Aci Gap Clear Security Database return parameters 2 0000 00000 47 Ac Allow REDONG Lia kaaa NALANG NA NAG AG ae es NAGA Gow PERE EA WEAR 48 Aci Allow Rebond return parameters EE SS eens 48 Aci Gap Start Limited Discovery Proc EE EE Ge eae 48 Aci Gap Start Limited Discovery Proc command parameters 48 Aci Gap Start Limited Discovery Proc return parameters is 0 49 Aci Gap Start General Discovery Proc EE EE ES eee eee 50 Aci Gap Start General Discovery Proc command parameters
139. terminated Reason for requesting disconnection The error code can be any Reason 1 byte of ones as specified for the disconnected command in the HCI specification d DoclD026257 Rev 3 UM1755 Vendor specific commands 4 3 22 d Table 71 Aci Gap Terminate return parameters Parameter Status Size 1 byte 0x00 Success Description OxOC Command disallowed Event s generated The controller will generate a command status event when the command is received and a Disconnection Complete event will be generated when the link is disconnected Aci_Gap_Clear_Security_Database Table 72 Aci_Gap_Clear_Security_Database Command name Aci_Gap_Clear_Security_Database OxFC94 Parameters Status Return Description Clear the security database All the devices in the security database will be removed Table 73 Aci Gap Clear Security Database return parameters Parameter Status Size 1 byte 0x00 Success Description 0x4B Flash erase failed Event s generated The controller will generate a command complete event on the completion of the command DoclD026257 Rev 3 47 131 Vendor specific commands UM1755 4 3 23 4 3 24 48 131 Aci_Allow_Rebond Table 74 Aci_Allow_Rebond Command name Parameters Return Aci Allow Rebond 0xFC95 Status Description Allows the security mana
140. th then the length of the attribute will be set to the Char Value Length If the Val Offset is set to a value greater than O then the length of the attribute will be set to the maximum length as specified for the attribute while adding the characteristic Val Offset 1 byte d DoclD026257 Rev 3 77 131 Vendor specific commands UM1755 Table 134 Aci_Gatt_Update_Char_Value command parameters continued Parameter Size Description Char_Value_Length Length of the characteristic value in octets Char_Value O N bytes Characteristic value Table 135 Aci_Gatt_Update_Char_Value return parameters Parameter Size Description 0x00 Success 0x47 Error Status 1 byte 0x60 Invalid handle 0x61 Invalid parameter 0x64 Insufficient resources Event s generated When the command has completed the controller will generate a command complete event 4 5 8 Aci Gatt Del Characteristic Table 136 Aci Gatt Del Characteristic Command name Parameters Return Serv Handle Aci Gatt Del Characteristic OXFDO7 Ghar Handle Status Description Delete the characteristic specified from the service Table 137 Aci Gatt Del Characteristic command parameters Parameter Size Description Serv Handle 2 bytes Handle of the service to which characteristic belongs Char Handle 2 bytes Handle of the characteristic to description to be deleted 78 131 DocID026257
141. the same device Table 115 Evt Blue Gap Device Found Parameter Size Description Event code 2 bytes 0x0406 Type of event ADV IND 0x00 Ekke vine ADV_DIRECT_IND 0x01 YP y ADV SCAN IND 0x02 ADV NONCONN IND 0x03 SCAN RSP 0x04 0x00 Public device address PESLAMORSS TYPE 1 byte 0x01 Random device address Peer_Address 6 bytes Address of the peer device found during scanning Length_Data 1 byte Length of advertising or scan response data DoclD026257 Rev 3 67 131 Vendor specific commands UM1755 Table 115 Evt_Blue_Gap_Device_Found continued Parameter Size Description Data Length Data bytes Advertising or scan response data Size 1 Octet signed integer RSSI iby Range 127 lt N lt 20 Units dBm 127 RSSI is not available 4 4 8 Evt_Blue_Gap_Procedure_Complete This event is sent by the GAP to the upper layers when a procedure previously started has been terminated by the upper layer or has completed for any other reason Table 116 Evt Blue Gap Procedure Complete Parameter Event code Size 2 bytes 0x0407 Description Procedure_Code 1 byte 0x01 0x02 0x04 0x08 0x10 0x20 0x40 LIMITED DISCOVERY PROC GENERAL DISCOVERY PROC NAME DISCOVERY PROC AUTO CONNECTION ESTABLISHMENT PROC GENERAL CONNECTION ESTABLISHMENT PROC SELECTIVE CONNECTION ESTABLISHMENT PROC DIRECT CONNECTION ESTABLISHMENT PROC Status 1 b
142. time The 1st byte is the SPI READY indication It must be 0x02 to indicate the slave SPI interface is ready If it is any value other than 0x02 the master must ignore the following 4 bytes and abort the SPI transaction If the BlueNRG SPI is ready Ready byte 0x02 the following 4 bytes give 2 buffer sizes for write and read 2 bytes for each buffer Of the 2 byte buffer size the lower byte comes first then the higher byte The write buffer size means how many bytes the master can write to the BlueNRG The read buffer size means how many bytes in the BlueNRG are waiting for the master to read For example if the slave header is 0x0200010500 the write buffer size is 0x0100 and the read buffer size is 0x0005 So the master cannot write more than 256 bytes to the BlueNRG and it should read back 5 bytes from the BlueNRG as soon as possible The SPI master may poll the BlueNRG by sending dummy SPI headers just to check what value is in the BlueNRG SPI header For example the SPI master can send an SPI frame with only 5 bytes header the CTRL byte can be either write or read then following 4 bytes 0x00 dummy bytes After the header the SPI master stops the frame without sending any real data So the write read action will not happen in practice DoclD026257 Rev 3 127 131 SPI interface UM1755 5 2 2 5 2 3 128 131 Write data to BlueNRG To write data to the BlueNRG the SPI master must start an SPI frame to check the BlueNR
143. trVal O N bytes Value of the attribute to be matched Table 156 Aci Att Find Attr By Typ And Value Reg return parameters Parameter Size Description 0x00 Success 0x42 Invalid parameters 0x46 Not allowed Status 1 byte If the exchange has already taken place If GATT is expecting response for previous request Already a request is in the queue to be sent Channel not open Already one GATT procedure is started Event s generated A command status event is generated on the receipt of the command The responses of the procedure are given through the Evt_Blue_ Att_Find_By_Type_Value_Resp event The end of the procedure is indicated by a Evt_Blue_Procedure_Complete event 4 5 15 Aci_Att_Read_Attr_By_Type_Req Table 157 Aci_Att_Read_Attr_By_Type_Req Command name Parameters Return Connection handle Start handle Aci Att Read Attr By Type Req OxFDOE End handle Status UUID type UUID Description It posts the read by type request 84 131 DoclD026257 Rev 3 d UM1755 Vendor specific commands Table 158 Aci_Att_Read_Attr_By_Type_Req command parameters Parameter Size Description Connection handle 2 bytes Connection handle for which the command is given Start handle 2 bytes Start handle of the range of values to be read on the server End handle 2 bytes End handle of the range of values to be read on the server UUD
144. tt de Re bad Pha BALA hah pd 123 4 7 12 TONE SOD ookan c hg adie BL alata doi en pe ER Wace OS Se EDE Re 124 5 SPI interface si ERK RE US DRA DER Ee RR RE RE RD ie 125 5 1 Hardware SPI interface anaana aaan 125 5 2 SPI communication protocol EE EE ee 127 5 2 1 Header saci SEER Ed Ee DANG Be MR teh ILABAN he bee a KA 127 5 2 2 Write data to BlueNRG EE EE EE EE Ee eee 128 5 2 3 Read data from BlueNRG EE EE EE EE EE Ee ee ee 128 5 2 4 SPI operation with BlueNRG sleep mode 129 Ky DoclD026257 Rev 3 5 131 Contents UM1755 6 REVISION history 2685 xoa adadrudu AE RE ARE RR deen EE EE n 130 d 6 131 DoclD026257 Rev 3 UM1755 List of tables List of tables Table 1 OGF valle EERS ee ER DA EE Se DRA RE RENE pk EE Dan 17 Table 2 bg Ke AA AA 19 Table 3 HE LevenRIS ee GT BANAS Ee ae NG AT DI GATA DP ADA es NAA 20 Table 4 ee Belle o AA CPUS 21 Table 5 EGID group EE N EE Y ER d ded EE Red Ra ERR EO 22 Table 6 L2CAP VS commands 0 222 ell 23 Table 7 Aci L2CAP Connection Parameter Update Reguest EE EE Ee Ee 23 Table 8 Aci L2CAP Connection Parameter Update Requests command parameters 23 Table 9 Aci L2CAP Connection Parameter Update Requests return parameters 24 Table 10 Aci_L2CAP_Connection_Parameter_Update_Response 24 Table 11 Aci L2CAP Connection Parameter Update Respo
145. ture Event s generated A command complete event is generated on the completion of the command d DoclD026257 Rev 3 UM1755 Vendor specific commands 4 3 15 Table 53 Aci_Gap_Slave_Security_Request Aci_Gap_Slave_Security_Request Command name Parameters Return Aci_Gap_Slave_Security_Request OxFC8D Bonding MITM Protection Status Description This command has to be issued to notify the master of the security requirements of the slave Table 54 Aci_Gap_Slave_Security_Request command parameters Parameter Size Description Connection handle 2 bytes Handle of the connection on which the slave security request will be sent ignored in slave only role 00 No bondi Bonding 1 byte 0x00 No pu Ws 0x01 Bonding required 0x00 MIMT protecti t ired MITM protection 1 byte x protes on ng require 0x01 MIMT protection required Table 55 Aci Gap Slave Security Reduest return parameters Parameter Size Status 1 byte Description 0x00 Success Ox1F Out of memory OxOC Command disallowed Event s generated A command status event will be generated when a valid command is received On completion of the command i e when the security request is successfully transmitted to the master a Evt_Blue_Slave_Security_Initiated vendor specific event will be generated d DoclD026257 Rev 3 41 131 Vendor specific commands UM175
146. us 105 Table 223 Aci Gatt Signed Write Without Response EE EE EE GE EE ee ee 105 Table 224 Aci Gatt Signed Write Without Response command parameters 106 Table 225 Aci Gatt Signed Write Without Response return parameters 106 Table 226 Aci Gatt Confirm Indication llli 106 Table 227 Aci Gatt Confirm Indication command parameters a 106 Table 228 Aci Gatt Confirm Indication return parameters llle 107 Table 229 Aci Gatt Write Resp EE EE 000 EE GE GE ee nh 107 Table 230 Aci Gatt Write Resp command parameters llle 107 Table 231 Aci Gatt Write Resp return parameters EE EE EG EE ee eee ess 108 Table 232 Aci Gatt Allow Read EE EE EE cece eee 108 Table 233 Aci Gatt Allow Read command parameters EE EE EE EE EE ee ee ee 108 Table 234 Aci Gatt Allow Read return parameters nannaa EE EE EE EE ee ee eee ee 108 Table 235 Aci Gatt Set Security Permission EE EE EE eee eee 109 Table 236 Aci Gatt Set Security Permission command parameters EE EE Eie 109 Table 237 Aci Gatt Set Security Permission return parameters EE EE ee ee 109 Table 238 Aci Gatt Set Descriptor Value EE EE EE EE EE Re Ee Ee ee ee ee ee ee 110 Table 239 Aci Gatt Set Descriptor Value command parameters EE EE EE Ee 110 Table 240 Aci Gatt Set Descriptor Value return parameters SS SS eee 110
147. y 2 bytes Defines the slave latency parameter as number of LL connection events 2 igi Defines connection timeout parameter in the following Timeout multiplier 2 bytes Nad ANGGE manner Timeout Multiplier 10 ms DoclD026257 Rev 3 23 131 Vendor specific commands UM1755 4 2 3 24 131 Table 9 Aci_L2CAP_Connection_Parameter_Update_Requests return parameters Parameter Size Description Status 1 byte 0x0 connection parameter accepted 0x1 connection parameter rejected Event s generated A command status event on the receipt of the command and a Evt_Blue_L2CAP_Conn_Upd_Resp event when the master responds to the request accepts or rejects Aci_L2CAP_Connection_Parameter_Update_Response Table 10 Aci_L2CAP_Connection_Parameter_Update_Response OxFD82 Command name Aci_L2CAP_Connection_Parameter_Update_Response Parameters Return Conn_Handle Conn Interval Min Conn Interval Max Conn Latency Timeout Identifier Accept Status Description This command should be sent in response to the Evt Blue L2CAP Connection Update Red event from the controller The accept parameter has to be set if the connection parameters given in the event are acceptable Table 11 Aci_L2CAP_Connection_Parameter_Update_Response command parameters Parameter Size Description Conn_Handle 2 bytes Handle received in Evt Blue L2CAP Connection Update Req event
148. yte 0x00 0x41 0x05 authentication requirements BLE STATUS SUCCESS BLE STATUS FAILED ERR AUTH FAILURE Procedure failed due to Procedure Specific Data 1 or more bytes Procedure Aci Gap Name Discovery Proc The name of the peer device if the procedure completed successfully Procedure Aci Gap General Conn Establishment Proc The reconnection address written to the peripheral device if the peripheral is privacy enabled 68 131 DoclD026257 Rev 3 d UM1755 Vendor specific commands 4 4 9 4 5 4 5 1 d Evt Blue Gap Reconnection Address This event is generated when the reconnection address is generated during the general connection establishment procedure The same address is set to the peer device also as a part of the general connection establishment procedure In order to make use of the reconnection address the next time while connecting to the bonded peripheral the application needs to set its own address as well as the peer address to which it wants to connect to this reconnection address Table 117 Evt Blue Gap Reconnection Address Parameter Size Description Event code 2 bytes 0x0408 Reconnection address 6 bytes 6 bytes of reconnection address GATT VS commands and events GATT VS commands Table 118 GATT VS commands Item Comm
149. yte 0x12 BLE STATUS INVALID PARAMETER 0x0C ERR COMMAND DISALLOWED Event s generated A command status event is generated as soon as the command is given If BLE STATUS SUCCESS is returned on termination of the procedure a LE Connection Complete event is returned The procedure can be explicitly terminated by the upper layer by issuing the command Aci Gap Terminate Gap Procedure with the procedure code set to 0x40 4 3 31 Aci Gap Terminate Gap Procedure Table 97 Aci Gap Terminate Gap Procedure Command name Parameters Return Aci Gap Terminate Gap Procedure OxFC9D Procedure Code d DoclD026257 Rev 3 59 131 Vendor specific commands UM1755 Description The gap procedure specified is terminated Table 98 Aci_Gap_Terminate_Gap_Procedure command parameters Parameter Size Description 0x01 LIMITED_DISCOVERY_PROC 0x02 GENERAL_DISCOVERY_PROC 0x04 NAME_DISCOVERY_PROC Procedure_Code 1 byte 0x08 AUTO_CONNECTION_ESTABLISHMENT_PROC 0x10 GENERAL_CONNECTION_ESTABLISHMENT_PROC 0x20 SELECTIVE_CONNECTION_ESTABLISHMENT_PROC 0x40 DIRECT_CONNECTION_ESTABLISHMENT_PROC Table 99 Aci Gap Terminate Gap Procedure return parameters Parameter Size Description mm 0x00 BLE STATUS SUCCESS y 0x12 BLE STATUS INVALID PARAMETER 60 131 DoclD026257 Rev 3 Ly UM1755 Vendor specific commands 4 3 32 d Event s generated A command complete event
150. ytes 0x08 Encryption root key used to derive LTK and CSRK IR 16 bytes 0x18 Identity root key used to derive LTK and CSRK Ky DoclD026257 Rev 3 119 131 Vendor specific commands UM1755 4 7 7 120 131 Table 267 Write_Config_Data members continued Data members Size Offset Description LLWithoutHost 1 byte Ox2C Switch on off Link Layer only mode Select the BlueNRG roles and mode configuration 1 Slave and master only one connection only 6 KB of RAM retention 2 Slave and master only one connection 12 KB of RAM retention 3 Master up to 8 slaves 12 KB of RAM retention Role 1 byte 0x2D Table 268 Write_Config_Data return parameters Parameter Size Description 0x00 BLE_STATUS_SUCCESS Status ai 0x12 ERR INVALID HCI CMD PARAMS Event s generated The controller will generate a command complete event Read Config Data Table 269 Read Config Data Command name Parameters Return Stat Read Config Data OxFCOD Offset id Value Description This command requests the value in the low level configure data structure For more information see the command Write Config Data The number of bytes of returned Value changes for different Offset Table 270 Read Config Data command parameters Parameter Size Description Offset in the data structure The starting member in the data Offset 1 byte structure will have an offset O Tab
Download Pdf Manuals
Related Search
Related Contents
Notice de montage Samsung XL2370 Lietotāja rokasgrāmata voicemail user manual. 1996 Chevrolet Corvette Owners Manual - Dealer e Cisco Unified Communications Software Subscription, 2 Years -100 Users 6 Equilibreur Buffalo Portable Drive USB 2.0 PJ551D-2 User Guide, English Copyright © All rights reserved.
Failed to retrieve file