hal-ipc-api.txt 84 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737
  1. Android HAL protocol for Bluetooth
  2. ==================================
  3. The Android HAL daemon for Bluetooth functionality implements the Unix socket
  4. server protocol around /run/bluetooth/daemon (tentative location) or Linux
  5. abstract sockets (tentative name).
  6. The daemon is single threaded and uses a mainloop for scheduling and general
  7. operation.
  8. The protocol is SOCK_SEQPACKET based and follows a strict PDU specification
  9. with a generic header and initial registration exchange. The communication
  10. is driven from the HAL with command/response exchanges. The daemon will use
  11. notification to signal events. The protocol is single PDU exchanged based,
  12. meaning every command requires a response. Notification does not require
  13. any confirmation. Not handling this PDU exchange leads to a disconnection of
  14. the socket.
  15. Command/response and notification use separate sockets. First connected socket
  16. is used for command/response, second for notification. All services are
  17. multi-plexed over same pair of sockets. Separation is done to ease
  18. implementation of simple HAL library with dedicated thread for handling
  19. notification.
  20. This strict protocol requirement is done to match C based callbacks and
  21. callout functions that are running in a thread inside the HAL and might
  22. block.
  23. .--Android--. .--Android--.
  24. | daemon | | HAL |
  25. | | Command | |
  26. | | <-------------------------- | |
  27. | | | |
  28. | | --------------------------> | |
  29. | | Response | |
  30. | | | |
  31. | | | |
  32. | | Notification | |
  33. | | --------------------------> | |
  34. | | | |
  35. '-----------' '-----------'
  36. Every packet will follow the basic header to support simple multi-plexing
  37. over the same socket. It will also support a basic control channel with service
  38. id 0.
  39. 0 8 16 24 31
  40. +--------------+--------------+--------------+--------------+
  41. | Service ID | Opcode | Data Length |
  42. +--------------+--------------+-----------------------------+
  43. | |
  44. The unique service ID is assigned by this specification for each HAL.
  45. As general rule of thumb, the opcode for command matches the opcode for a
  46. response. Or the opcode 0x00 for an error is returned.
  47. Notification opcodes start from 0x81.
  48. Opcode 0x80 is reserved and shall not be used.
  49. All command/response opcodes have the least significant bit not set. And all
  50. notifications have the least significant bit set.
  51. The HAL modules only have the job to map the callback and event functions
  52. to the protocol. They do not need to do anything else. Below is an example
  53. of a sample transaction for the Bluetooth Core HAL and enabling of an
  54. adapter.
  55. HAL Daemon
  56. ----------------------------------------------------
  57. call enable() --> command 0x01
  58. return enable() <-- response 0x01
  59. call adapter_state_changed() <-- notification 0x81
  60. return adapter_state_changed()
  61. When the Android hardware framework calls into the Bluetooth Core HAL
  62. and executes the enable() callback, the HAL module sends the enable
  63. command with opcode 0x01 to the daemon. As soon as the daemon responds,
  64. the callback will return with the appropriate result.
  65. After the daemon switched on the adapter, it will send a notification
  66. with opcode 0x81 to the HAL module.
  67. The Bluetooth Core HAL and Bluetooth Socket HAL are guaranteed to be
  68. available from the daemon. All other HAL modules are optional.
  69. When the Bluetooth Core HAL init() function is called, it should open
  70. the socket and register both "bluetooth" and "socket" service modules. It is
  71. required to register "socket" service at the same time since the HAL module
  72. does not have its own init() function.
  73. It is possible to send Configure command before registering any services to
  74. customize stack. This step is optional.
  75. When new profiles are initiated, the get_profile_interface() callback
  76. will load the profile and during init() of the profile, it should register the
  77. specific service.
  78. Bluetooth main thread Daemon
  79. -------------------------------------------------------
  80. init() --> open command socket
  81. --> open notification socket
  82. --> register module "bluetooth"
  83. --> register module "socket"
  84. get_profile_interface() --> return profile struct
  85. --> continue on Handsfree thread
  86. Handsfree thread Daemon
  87. --------------------------------------------------------
  88. init() --> register module handsfree
  89. Error response is common for all services and has fixed structure:
  90. Opcode 0x00 - Error response
  91. Response parameters: Status (1 octet)
  92. Valid status values: 0x01 = Fail
  93. 0x02 = Not ready
  94. 0x03 = No memory
  95. 0x04 = Busy
  96. 0x05 = Done (already completed)
  97. 0x06 = Unsupported
  98. 0x07 = Parameter invalid
  99. 0x08 = Unhandled
  100. 0x09 = Authentication failure
  101. 0x0a = Remote device down
  102. 0x0b = Authentication rejected
  103. Core Service (ID 0)
  104. ===================
  105. Opcode 0x00 - Error response
  106. Opcode 0x01 - Register module command/response
  107. Command parameters: Service id (1 octet)
  108. Mode (1 octet)
  109. Max Clients (4 octets)
  110. Response parameters: <none>
  111. In case a command is sent for an undeclared service ID, it will
  112. be rejected. Also there will be no notifications for undeclared
  113. service ID.
  114. Valid Mode values: 0x00 = Default Mode
  115. 0xXX = as defined by service
  116. In case of an error, the error response will be returned.
  117. Opcode 0x02 - Unregister module command/response
  118. Command parameters: Service id (1 octet)
  119. Response parameters: <none>
  120. In case of an error, the error response will be returned.
  121. Opcode 0x03 - Configuration
  122. Command parameters: Num options (1 octet)
  123. Option Type # (1 octet)
  124. Option Length # (2 octets)
  125. Option Value # (variable)
  126. Response parameters: <none>
  127. Valid configure option types: 0x00 = Vendor
  128. 0x01 = Model
  129. 0x02 = Name
  130. 0x03 = Serial Number
  131. 0x04 = System ID
  132. 0x05 = PnP ID
  133. 0x06 = Firmware Rev
  134. 0x07 = Hardware Rev
  135. In case of an error, the error response will be returned.
  136. Bluetooth Core HAL (ID 1)
  137. =========================
  138. Android HAL name: "bluetooth" (BT_HARDWARE_MODULE_ID)
  139. Service modes: 0x00 = Enable BR/EDR/LE if supported (default)
  140. 0x01 = Enable BR/EDR only
  141. 0x02 = Enable LE only
  142. Commands and responses:
  143. Opcode 0x00 - Error response
  144. Opcode 0x01 - Enable command/response
  145. Command parameters: <none>
  146. Response parameters: <none>
  147. In case of an error, the error response will be returned.
  148. Opcode 0x02 - Disable command/response
  149. Command parameters: <none>
  150. Response parameters: <none>
  151. In case of an error, the error response will be returned.
  152. Opcode 0x03 - Get Adapter Properties command/response
  153. Command parameters: <none>
  154. Response parameters: <none>
  155. In case of an error, the error response will be returned.
  156. Opcode 0x04 - Get Adapter Property command/response
  157. Command parameters: Property type (1 octet)
  158. Response parameters: <none>
  159. In case of an error, the error response will be returned.
  160. Opcode 0x05 - Set Adapter Property command/response
  161. Command parameters: Property type (1 octet)
  162. Property length (2 octets)
  163. Property value (variable)
  164. Response parameters: <none>
  165. In case of an error, the error response will be returned.
  166. Opcode 0x06 - Get Remote Device Properties command/response
  167. Command parameters: Remote address (6 octets)
  168. Response parameters: <none>
  169. In case of an error, the error response will be returned.
  170. Opcode 0x07 - Get Remote Device Property command/response
  171. Command parameters: Remote address (6 octets)
  172. Property type (1 octet)
  173. Response parameters: <none>
  174. In case of an error, the error response will be returned.
  175. Opcode 0x08 - Set Remote Device Property command/response
  176. Command parameters: Remote address (6 octets)
  177. Property type (1 octet)
  178. Property length (2 octets)
  179. Property value (variable)
  180. Response parameters: <none>
  181. In case of an error, the error response will be returned.
  182. Opcode 0x09 - Get Remote Service Record command/response
  183. Command parameters: Remote address (6 octets)
  184. UUID (16 octets)
  185. Response parameters: <none>
  186. In case of an error, the error response will be returned.
  187. Opcode 0x0a - Get Remote Services command/response
  188. Command parameters: Remote address (6 octets)
  189. Response parameters: <none>
  190. In case of an error, the error response will be returned.
  191. Opcode 0x0b - Start Discovery command/response
  192. Command parameters: <none>
  193. Response parameters: <none>
  194. In case of an error, the error response will be returned.
  195. Opcode 0x0c - Cancel Discovery command/response
  196. Command parameters: <none>
  197. Response parameters: <none>
  198. In case of an error, the error response will be returned.
  199. Opcode 0x0d - Create Bond command/response
  200. Command parameters: Remote address (6 octets)
  201. Transport (1 octet)
  202. Response parameters: <none>
  203. In case of an error, the error response will be returned.
  204. Opcode 0x0e - Remove Bond command/response
  205. Command parameters: Remote address (6 octets)
  206. Response parameters: <none>
  207. In case of an error, the error response will be returned.
  208. Opcode 0x0f - Cancel Bond command/response
  209. Command parameters: Remote address (6 octets)
  210. Response parameters: <none>
  211. In case of an error, the error response will be returned.
  212. Opcode 0x10 - PIN Reply command/response
  213. Command parameters: Remote address (6 octets)
  214. Accept (1 octet)
  215. PIN length (1 octet)
  216. PIN code (16 octets)
  217. Response parameters: <none>
  218. In case of an error, the error response will be returned.
  219. Opcode 0x11 - SSP Reply command/response
  220. Command parameters: Remote address (6 octets)
  221. SSP variant (1 octet)
  222. Accept (1 octet)
  223. Passkey (4 octets)
  224. Response parameters: <none>
  225. Valid SSP variant values: 0x00 = Passkey Confirmation
  226. 0x01 = Passkey Entry
  227. 0x02 = Consent (for Just Works)
  228. 0x03 = Passkey Notification
  229. In case of an error, the error response will be returned.
  230. Opcode 0x12 - DUT Mode Configure command/response
  231. Command parameters: Enable (1 octet)
  232. Response parameters: <none>
  233. In case of an error, the error response will be returned.
  234. Opcode 0x13 - DUT Mode Send command/response
  235. Command parameters: Opcode (2 octets)
  236. Length (1 octet)
  237. Data (variable)
  238. Response parameters: <none>
  239. In case of an error, the error response will be returned.
  240. Opcode 0x14 - LE Test Mode command/response
  241. Command parameters: Opcode (2 octets)
  242. Length (1 octet)
  243. Data (variable)
  244. Response parameters: <none>
  245. In case of an error, the error response will be returned.
  246. Notifications:
  247. Opcode 0x81 - Adapter State Changed notification
  248. Notifications parameters: State (1 octet)
  249. Valid state values: 0x00 = Off
  250. 0x01 = On
  251. Opcode 0x82 - Adapter Properties Changed notification
  252. Notification parameters: Status (1 octet)
  253. Num properties (1 octet)
  254. Type # (1 octet)
  255. Length # (2 octets)
  256. Value # (variable)
  257. ...
  258. Opcode 0x83 - Remote Device Properties notification
  259. Notification parameters: Status (1 octet)
  260. Remote address (6 octets)
  261. Num properties (1 octet)
  262. Type # (1 octet)
  263. Length # (2 octets)
  264. Value # (variable)
  265. ...
  266. Opcode 0x84 - Device Found notification
  267. Notification parameters: Num properties (1 octet)
  268. Type # (1 octet)
  269. Length # (2 octets)
  270. Value # (variable)
  271. ...
  272. Opcode 0x85 - Discovery State Changed notification
  273. Notifications parameters: State (1 octet)
  274. Opcode 0x86 - PIN Request notification
  275. Notification parameters: Remote address (6 octets)
  276. Remote name (249 octets)
  277. Class of device (4 octets)
  278. Opcode 0x87 - SSP Request notification
  279. Notification parameters: Remote address (6 octets)
  280. Remote name (249 octets)
  281. Class of device (4 octets)
  282. Pairing variant (1 octet)
  283. Passkey (4 octets)
  284. Opcode 0x88 - Bond State Changed notification
  285. Notification parameters: Status (1 octet)
  286. Remote address (6 octets)
  287. Bond state (1 octet)
  288. Valid bond state values: 0x00 = None
  289. 0x01 = Bonding
  290. 0x02 = Bonded
  291. Opcode 0x89 - ACL State Changed notification
  292. Notification parameters: Status (1 octet)
  293. Remote address (6 octets)
  294. ACL state (1 octet)
  295. Opcode 0x8a - DUT Mode Receive notification
  296. Notification parameters: Opcode (2 octets)
  297. Length (1 octet)
  298. Data (variable)
  299. Opcode 0x8b - LE Test Mode notification
  300. Notification parameters: Status (1 octet)
  301. Num packets (2 octets)
  302. Bluetooth Socket HAL (ID 2)
  303. ===========================
  304. Android HAL name:: "socket" (BT_PROFILE_SOCKETS_ID)
  305. Commands and responses:
  306. Opcode 0x00 - Error response
  307. Opcode 0x01 - Listen command/response
  308. Command parameters: Socket type (1 octet)
  309. Service name (256 octets)
  310. Service UUID (16 octets)
  311. Channel (4 octets)
  312. Socket flags (1 octet)
  313. Response parameters: File descriptor (inline)
  314. Valid socket types: 0x01 = RFCOMM
  315. 0x02 = SCO
  316. 0x03 = L2CAP
  317. Valid socket flags: 0x01 = Encrypt
  318. 0x02 = Auth
  319. In case of an error, the error response will be returned.
  320. Opcode 0x02 - Connect command/response
  321. Command parameters: Remote address (6 octets)
  322. Socket type (1 octet)
  323. Service UUID (16 octets)
  324. Channel (4 octets)
  325. Socket flags (1 octet)
  326. Response parameters: File descriptor (inline)
  327. Valid socket types: 0x01 = RFCOMM
  328. 0x02 = SCO
  329. 0x03 = L2CAP
  330. Valid socket flags: 0x01 = Encrypt
  331. 0x02 = Auth
  332. In case of an error, the error response will be returned.
  333. Bluetooth HID Host HAL (ID 3)
  334. ============================
  335. Android HAL name: "hidhost" (BT_PROFILE_HIDHOST_ID)
  336. Commands and responses:
  337. Opcode 0x00 - Error response
  338. Opcode 0x01 - Connect command/response
  339. Command parameters: Remote address (6 octets)
  340. Response parameters: <none>
  341. In case of an error, the error response will be returned.
  342. Opcode 0x02 - Disconnect command/response
  343. Command parameters: Remote address (6 octets)
  344. Response parameters: <none>
  345. In case of an error, the error response will be returned.
  346. Opcode 0x03 - Virtual Unplug command/response
  347. Command parameters: Remote address (6 octets)
  348. Response parameters: <none>
  349. In case of an error, the error response will be returned.
  350. Opcode 0x04 - Set Info command/response
  351. Command parameters: Remote address (6 octets)
  352. Attribute mask (2 octets)
  353. Subclass (1 octet)
  354. Application ID (1 octet)
  355. Vendor ID (2 octets)
  356. Product ID (2 octets)
  357. Version (2 octets)
  358. Country code (1 octet)
  359. Descriptor length (2 octet)
  360. Descriptor value (884 octets)
  361. Response parameters: <none>
  362. In case of an error, the error response will be returned.
  363. Opcode 0x05 - Get Protocol command/response
  364. Command parameters: Remote address (6 octets)
  365. Protocol mode (1 octet)
  366. Response parameters: <none>
  367. Valid protocol modes: 0x00 = Report
  368. 0x01 = Boot
  369. 0xff = Unsupported
  370. In case of an error, the error response will be returned.
  371. Opcode 0x06 - Set Protocol command/response
  372. Command parameters: Remote address (6 octets)
  373. Protocol mode (1 octet)
  374. Response parameters: <none>
  375. Valid protocol modes: 0x00 = Report
  376. 0x01 = Boot
  377. 0xff = Unsupported
  378. In case of an error, the error response will be returned.
  379. Opcode 0x07 - Get Report command/response
  380. Command parameters: Remote address (6 octets)
  381. Report type (1 octet)
  382. Report ID (1 octet)
  383. Buffer size (2 octet)
  384. Response parameters: <none>
  385. Valid report types: 0x01 = Input
  386. 0x02 = Output
  387. 0x03 = Feature
  388. In case of an error, the error response will be returned.
  389. Opcode 0x08 - Set Report command/response
  390. Command parameters: Remote address (6 octets)
  391. Report type (1 octet)
  392. Report length (2 octets)
  393. Report data (Report length)
  394. Response parameters: <none>
  395. Valid report types: 0x01 = Input
  396. 0x02 = Output
  397. 0x03 = Feature
  398. In case of an error, the error response will be returned.
  399. Opcode 0x09 - Send Data command/response
  400. Command parameters: Remote address (6 octets)
  401. Data length (2 octets)
  402. Data (Data length)
  403. Response parameters: <none>
  404. In case of an error, the error response will be returned.
  405. Notifications:
  406. Status is common for many notifications and has fixed value range:
  407. Status values: 0x00 = Ok
  408. 0x01 = Handshake - Device not ready
  409. 0x02 = Handshake - Invalid report ID
  410. 0x03 = Handshake - Transaction not SPT
  411. 0x04 = Handshake - Invalid parameter
  412. 0x05 = Handshake - Generic error
  413. 0x06 = General error
  414. 0x07 = SDP error
  415. 0x08 = Set protocol error
  416. 0x09 = Device database full
  417. 0x0a = Device type not supported
  418. 0x0b = No resources
  419. 0x0c = Authentication failed
  420. 0x0d = HDL
  421. Opcode 0x81 - Connection State notification
  422. Notification parameters: Remote address (6 octets)
  423. Connection State (1 octets)
  424. Valid connection states: 0x00 = Connected
  425. 0x01 = Connecting
  426. 0x02 = Disconnected
  427. 0x03 = Disconnecting
  428. 0x04 = Failed - Mouse from host
  429. 0x05 = Failed - Keyboard from host
  430. 0x06 = Failed - Too many devices
  431. 0x07 = Failed - No HID driver
  432. 0x08 = Failed - generic
  433. 0x09 = Unknown
  434. Opcode 0x82 - HID Info notification
  435. Notification parameters: Remote address (6 octets)
  436. Attribute mask (2 octets)
  437. Subclass (1 octet)
  438. Application ID (1 octet)
  439. Vendor ID (2 octets)
  440. Product ID (2 octets)
  441. Version (2 octets)
  442. Country code (1 octet)
  443. Descriptor length (2 octet)
  444. Descriptor value (884 octets)
  445. Opcode 0x83 - Protocol Mode notification
  446. Notification parameters: Remote address (6 octets)
  447. Status (1 octet)
  448. Protocol mode (1 octet)
  449. Valid protocol modes: 0x00 = Report
  450. 0x01 = Boot
  451. 0xff = Unsupported
  452. Opcode 0x84 - Idle Time notification
  453. Notification parameters: Remote address (6 octets)
  454. Status (1 octet)
  455. Idle time (2 octets)
  456. Opcode 0x85 - Get Report notification
  457. Notification parameters: Remote address (6 octets)
  458. Status (1 octet)
  459. Report length (2 octets)
  460. Report data (variable)
  461. Opcode 0x86 - Virtual Unplug notification
  462. Notification parameters: Remote address (6 octets)
  463. Status (1 octet)
  464. Opcode 0x87 - Handshake notification
  465. Notification parameters: Remote address (6 octets)
  466. Status (1 octet)
  467. Only status values from 0x00 to 0x05 are valid as handshake
  468. status.
  469. Bluetooth PAN HAL (ID 4)
  470. ========================
  471. Android HAL name: "pan" (BT_PROFILE_PAN_ID)
  472. Commands and responses:
  473. Opcode 0x00 - Error response
  474. Opcode 0x01 - Enable command/response
  475. Command parameters: Local role (1 octet)
  476. Response parameters: <none>
  477. Valid role values: 0x00 = None
  478. 0x01 = NAP
  479. 0x02 = PANU
  480. In case of an error, the error response will be returned.
  481. Opcode 0x02 - Get Local Role command/response
  482. Command parameters: <none>
  483. Response parameters: Local role (1 octet)
  484. Valid role values: 0x00 = None
  485. 0x01 = NAP
  486. 0x02 = PANU
  487. In case of an error, the error response will be returned.
  488. Opcode 0x03 - Connect command/response
  489. Command parameters: Remote address (6 octets)
  490. Local role (1 octet)
  491. Remote role (1 octet)
  492. Response parameters: <none>
  493. Valid role values: 0x01 = NAP
  494. 0x02 = PANU
  495. In case of an error, the error response will be returned.
  496. Opcode 0x04 - Disconnect command/response
  497. Command parameters: Remote address (6 octets)
  498. Response parameters: <none>
  499. In case of an error, the error response will be returned.
  500. Notifications:
  501. Opcode 0x81 - Control State notification
  502. Notification parameters: Control state (1 octet)
  503. Status (1 octet)
  504. Local role (1 octet)
  505. Interface name (17 octet)
  506. Valid control states: 0x00 = Enabled
  507. 0x01 = Disabled
  508. Valid role values: 0x00 = None
  509. 0x01 = NAP
  510. 0x02 = PANU
  511. Opcode 0x82 - Connection State notification
  512. Notification parameters: Connection state (1 octet)
  513. Status (1 octet)
  514. Remote address (6 octets)
  515. Local role (1 octet)
  516. Remote role (1 octet)
  517. Valid connection states: 0x00 = Connected
  518. 0x01 = Connecting
  519. 0x02 = Disconnected
  520. 0x03 = Disconnecting
  521. Valid role values: 0x01 = NAP
  522. 0x02 = PANU
  523. Bluetooth Handsfree HAL (ID 5)
  524. ==============================
  525. Android HAL name: "handsfree" (BT_PROFILE_HANDSFREE_ID)
  526. Service modes: 0x00 = Headset Profile only mode (default)
  527. 0x01 = Handsfree Profile (narrowband speech)
  528. 0x02 = Handsfree Profile (narrowband and wideband speech)
  529. Commands and responses:
  530. Opcode 0x00 - Error response
  531. Opcode 0x01 - Connect command/response
  532. Command parameters: Remote address (6 octets)
  533. Response parameters: <none>
  534. In case of an error, the error response will be returned.
  535. Opcode 0x02 - Disconnect command/response
  536. Command parameters: Remote address (6 octets)
  537. Response parameters: <none>
  538. In case of an error, the error response will be returned.
  539. Opcode 0x03 - Connect Audio command/response
  540. Command parameters: Remote address (6 octets)
  541. Response parameters: <none>
  542. In case of an error, the error response will be returned.
  543. Opcode 0x04 - Disconnect Audio command/response
  544. Command parameters: Remote address (6 octets)
  545. Response parameters: <none>
  546. In case of an error, the error response will be returned.
  547. Opcode 0x05 - Start Voice Recognition command/response
  548. Command parameters: Remote address (6 octets)
  549. Response parameters: <none>
  550. In case of an error, the error response will be returned.
  551. Opcode 0x06 - Stop Voice Recognition command/response
  552. Command parameters: Remote address (6 octets)
  553. Response parameters: <none>
  554. In case of an error, the error response will be returned.
  555. Opcode 0x07 - Volume Control command/response
  556. Command parameters: Volume type (1 octet)
  557. Volume (1 octet)
  558. Remote address (6 octets)
  559. Response parameters: <none>
  560. Valid volume types: 0x00 = Speaker
  561. 0x01 = Microphone
  562. In case of an error, the error response will be returned.
  563. Opcode 0x08 - Device Status Notification command/response
  564. Command parameters: Network state (1 octet)
  565. Service type (1 octet)
  566. Signal strength (1 octet)
  567. Battery level (1 octet)
  568. Response parameters: <none>
  569. Valid network states: 0x00 = Not available
  570. 0x01 = Available
  571. Valid service types: 0x00 = Home network
  572. 0x01 = Roaming network
  573. In case of an error, the error response will be returned.
  574. Opcode 0x09 - COPS Response command/response
  575. Command parameters: COPS command response (string)
  576. Remote address (6 octets)
  577. Response parameters: <none>
  578. In case of an error, the error response will be returned.
  579. Opcode 0x0a - CIND Response command/response
  580. Command parameters: Service (1 octet)
  581. Number of active calls (1 octet)
  582. Number of held calls (1 octet)
  583. Call setup state (1 octet)
  584. Signal strength (1 octet)
  585. Roaming indicator (1 octet)
  586. Battery level (1 octet)
  587. Remote address (6 octets)
  588. Response parameters: <none>
  589. Valid call setup states: 0x00 = Active
  590. 0x01 = Held
  591. 0x02 = Dialing
  592. 0x03 = Alerting
  593. 0x04 = Incoming
  594. 0x05 = Waiting
  595. 0x06 = Idle
  596. In case of an error, the error response will be returned.
  597. Opcode 0x0b - Formatted AT Response command/response
  598. Command parameters: Pre-formatted AT response (string)
  599. Remote address (6 octets)
  600. Response parameters: <none>
  601. In case of an error, the error response will be returned.
  602. Opcode 0x0c - AT Response command/response
  603. Command parameters: Response code (1 octet)
  604. Error code (1 octet)
  605. Remote address (6 octets)
  606. Response parameters: <none>
  607. Valid response codes: 0x00 = ERROR
  608. 0x01 = OK
  609. In case of an error, the error response will be returned.
  610. Opcode 0x0d - CLCC Response command/response
  611. Command parameters: Call index (1 octet)
  612. Call direction (1 octet)
  613. Call state (1 octet)
  614. Call mode (1 octet)
  615. Call multiparty type (1 octet)
  616. Call number type (1 octet)
  617. Call number (string)
  618. Remote address (6 octets)
  619. Response parameters: <none>
  620. Valid call directions: 0x00 = Outgoing
  621. 0x01 = Incoming
  622. Valid call states: 0x00 = Active
  623. 0x01 = Held
  624. 0x02 = Dialing
  625. 0x03 = Alerting
  626. 0x04 = Incoming
  627. 0x05 = Waiting
  628. 0x06 = Idle
  629. Valid call modes: 0x00 = Voice
  630. 0x01 = Data
  631. 0x02 = Fax
  632. Valid multiparty types: 0x00 = Single call
  633. 0x01 = Multiparty call
  634. Valid number types: 0x81 = Unknown
  635. 0x91 = International
  636. In case of an error, the error response will be returned.
  637. Opcode 0x0e - Phone Status Change command/response
  638. Command parameters: Number of active calls (1 octet)
  639. Number of held calls (1 octet)
  640. Call setup state (1 octet)
  641. Call number type (1 octet)
  642. Call number (string)
  643. Response parameters: <none>
  644. Valid call setup states: 0x00 = Active
  645. 0x01 = Held
  646. 0x02 = Dialing
  647. 0x03 = Alerting
  648. 0x04 = Incoming
  649. 0x05 = Waiting
  650. 0x06 = Idle
  651. Valid number types: 0x81 = Unknown
  652. 0x91 = International
  653. In case of an error, the error response will be returned.
  654. Opcode 0x0f - Configure WBS command/response
  655. Command parameters: Remote address (6 octets)
  656. Config (1 octet)
  657. Response parameters: <none>
  658. Valid config values: 0x00 = None
  659. 0x01 = No
  660. 0x02 = Yes
  661. In case of an error, the error response will be returned.
  662. Notifications:
  663. Opcode 0x81 - Connection State notification
  664. Notification parameters: Connection state (1 octet)
  665. Remote address (6 octets)
  666. Valid connection states: 0x00 = Disconnected
  667. 0x01 = Connecting
  668. 0x02 = Connected
  669. 0x03 = SLC connected
  670. 0x04 = Disconnecting
  671. Opcode 0x82 - Audio State notification
  672. Notification parameters: Audio state (1 octet)
  673. Remote address (6 octets)
  674. Valid audio states: 0x00 = Disconnected
  675. 0x01 = Connecting
  676. 0x02 = Connected
  677. 0x03 = Disconnecting
  678. Opcode 0x83 - Voice Recognition Command notification
  679. Notification parameters: Voice recognition state (1 octet)
  680. Remote address (6 octets)
  681. Valid voice recognition states: 0x00 = Stopped
  682. 0x01 = Started
  683. Opcode 0x84 - Answer Call Command notification
  684. Notification parameters: Remote address (6 octets)
  685. Opcode 0x85 - Hangup Call Command notification
  686. Notification parameters: Remote address (6 octets)
  687. Opcode 0x86 - Volume Command notification
  688. Notification parameters: Volume type (1 octet)
  689. Volume (1 octet)
  690. Remote address (6 octets)
  691. Valid volume types: 0x00 = Speaker
  692. 0x01 = Microphone
  693. Opcode 0x87 - Dial Call Command notification
  694. Notification parameters: Remote address (6 octets)
  695. Number (string)
  696. Opcode 0x88 - DTMF Command notification
  697. Notification parameters: Tone (1 octet)
  698. Remote address (6 octets)
  699. Opcode 0x89 - NREC Command notification
  700. Notification parameters: NREC types (1 octet)
  701. Remote address (6 octets)
  702. Valid NREC types: 0x00 = Stop
  703. 0x01 = Start
  704. Opcode 0x8a - CHLD Command notification
  705. Notification parameters: NREC types (1 octet)
  706. Remote address (6 octets)
  707. Valid CHLD types: 0x00 = Release and hold
  708. 0x01 = Release active and accept held
  709. 0x02 = Hold active and accept held
  710. 0x03 = Add held call to conference
  711. Opcode 0x8b - CNUM Command notification
  712. Notification parameters: Remote address (6 octets)
  713. Opcode 0x8c - CIND Command notification
  714. Notification parameters: Remote address (6 octets)
  715. Opcode 0x8d - COPS Command notification
  716. Notification parameters: Remote address (6 octets)
  717. Opcode 0x8e - CLCC Command notification
  718. Notification parameters: Remote address (6 octets)
  719. Opcode 0x8f - Unknown AT Command notification
  720. Notification parameters: Remote address (6 octets)
  721. AT command (string)
  722. Opcode 0x90 - Key Pressed Command notification
  723. Notification parameters: Remote address (6 octets)
  724. Opcode 0x91 - WBS Command notification
  725. Notification parameters: WBS types (1 octet)
  726. Remote address (6 octets)
  727. Valid WBS types: 0x00 = None
  728. 0x01 = No
  729. 0x02 = Yes
  730. Bluetooth Advanced Audio HAL (ID 6)
  731. Bluetooth Advanced Audio Sink HAL (ID 13)
  732. =========================================
  733. Android HAL name: "a2dp" (BT_PROFILE_ADVANCED_AUDIO_ID)
  734. Android HAL name: "a2dp_sink" (BT_PROFILE_ADVANCED_AUDIO__SINK_ID)
  735. Commands and responses:
  736. Opcode 0x00 - Error response
  737. Opcode 0x01 - Connect command/response
  738. Command parameters: Remote address (6 octets)
  739. Response parameters: <none>
  740. In case of an error, the error response will be returned.
  741. Opcode 0x02 - Disconnect command/response
  742. Command parameters: Remote address (6 octets)
  743. Response parameters: <none>
  744. In case of an error, the error response will be returned.
  745. Notifications:
  746. Opcode 0x81 - Connection State notification
  747. Notification parameters: Connection state (1 octet)
  748. Remote address (6 octets)
  749. Valid connection states: 0x00 = Disconnected
  750. 0x01 = Connecting
  751. 0x02 = Connected
  752. 0x03 = Disconnecting
  753. Opcode 0x82 - Audio State notification
  754. Notification parameters: Audio state (1 octet)
  755. Remote address (6 octets)
  756. Valid connection states: 0x00 = Remote suspend
  757. 0x01 = Stopped
  758. 0x02 = Started
  759. Opcode 0x83 - Audio Configuration notification
  760. Notification parameters: Remote address (6 octets)
  761. Sample Rate in Hz (4 octets)
  762. Channel Count (1 octet)
  763. Valid channel count: 0x01 = Mono
  764. 0x02 = Stereo
  765. Bluetooth Health HAL (ID 7)
  766. ===========================
  767. Android HAL name: "health" (BT_PROFILE_HEALTH_ID)
  768. Commands and responses:
  769. Opcode 0x00 - Error response
  770. Opcode 0x01 - Register Application command/response
  771. Command parameters: Number of MDEP (1 octet)
  772. Application name offset (2 octets)
  773. Provider name offset (2 octets)
  774. Service name offset (2 octets)
  775. Service description offset (2 octets)
  776. Data length (2 octets)
  777. Data (data length)
  778. Response parameters: Application ID (2 octets)
  779. Strings are null terminated.
  780. In case of an error, the error response will be returned.
  781. Opcode 0x02 - Register Application MDEP data command/response
  782. Command parameters: Application ID (2 octets)
  783. MDEP Role (1 octet)
  784. Data type (2 octets)
  785. Channel type (1 octet)
  786. MDEP description length (2 octets)
  787. MDEP description (MDEP desciption length)
  788. Response parameters: <none>
  789. In case of an error, the error response will be returned.
  790. Opcode 0x03 - Unregister Application command/response
  791. Command parameters: Application ID (2 octets)
  792. Response parameters: <none>
  793. In case of an error, the error response will be returned.
  794. Opcode 0x04 - Connect Channel command/response
  795. Command parameters: Application ID (2 octets)
  796. Remote address (6 octets)
  797. MDEP index (1 octet)
  798. Response parameters: Channel ID (2 octets)
  799. In case of an error, the error response will be returned.
  800. Opcode 0x05 - Destroy Channel command/response
  801. Command parameters: Channel ID (2 octets)
  802. Response parameters: <none>
  803. In case of an error, the error response will be returned.
  804. Notifications:
  805. Opcode 0x81 - Application Registration State notification
  806. Notification parameters: Application ID (2 octets)
  807. Application state (1 octet)
  808. Valid application states: 0x00 = Registration success
  809. 0x01 = Registration failed
  810. 0x02 = Deregistration success
  811. 0x03 = Deregistration failed
  812. Opcode 0x82 - Channel State notification
  813. Notification parameters: Application ID (2 octets)
  814. Remote address (6 octets)
  815. MDEP index (1 octet)
  816. Channel ID (2 octets)
  817. Channel state (1 octet)
  818. File descriptor (inline)
  819. Valid channel states: 0x00 = Connecting
  820. 0x01 = Connected
  821. 0x02 = Disconnecting
  822. 0x03 = Disconnected
  823. 0x04 = Destroyed
  824. Bluetooth Remote Control Target HAL (ID 8)
  825. ===================================
  826. Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
  827. Commands and responses:
  828. Opcode 0x00 - Error response
  829. Opcode 0x01 - Get Play Status Response command/response
  830. Command parameters: Status (1 octet)
  831. Duration (4 octets)
  832. Position (4 octets)
  833. In case of an error, the error response will be returned.
  834. Valid status values: 0x00 = Stopped
  835. 0x01 = Playing
  836. 0x02 = Paused
  837. 0x03 = Fwd seek
  838. 0x04 = Rev seek
  839. 0xff = Error
  840. Opcode 0x02 - List Player Attributes Response command/response
  841. Command parameters: Number of attributes (1 octet)
  842. Attribute # (1 octet)
  843. ...
  844. In case of an error, the error response will be returned.
  845. Valid attributes: 0x01 = Equalizer
  846. 0x02 = Repead
  847. 0x03 = Shuffle
  848. 0x04 = Scan
  849. Opcode 0x03 - List Player Values Response command/response
  850. Command parameters: Number of values (1 octet)
  851. Value # (1 octet)
  852. ...
  853. In case of an error, the error response will be returned.
  854. Opcode 0x04 - Get Player Values Response command/response
  855. Command parameters: Number of attributes (1 octet)
  856. Attribute # (1 octet)
  857. Value # (1 octet)
  858. ...
  859. In case of an error, the error response will be returned.
  860. Valid attributes: Same as in List Player Attributes
  861. Opcode 0x05 - Get Player Attributes Text Response command/response
  862. Command parameters: Number of attributes (1 octet)
  863. Attribute # (1 octet)
  864. Attribute # text length (1 octet)
  865. Attribute # text (variable)
  866. ...
  867. In case of an error, the error response will be returned.
  868. Valid attributes: Same as in List Player Attributes
  869. Opcode 0x06 - Get Player Values Text Response command/response
  870. Command parameters: Number of values (1 octet)
  871. Value # (1 octet)
  872. Value # text length (1 octet)
  873. Value # text (variable)
  874. ...
  875. In case of an error, the error response will be returned.
  876. Opcode 0x07 - Get Element Attributes Text Response command/response
  877. Command parameters: Number of elements (1 octet)
  878. Element # (1 octet)
  879. Element # text length (1 octet)
  880. Element # text (variable)
  881. ...
  882. In case of an error, the error response will be returned.
  883. Valid elements: 0x01 = Title
  884. 0x02 = Artist
  885. 0x03 = Album
  886. 0x04 = Track Number
  887. 0x05 = Number of Tracks
  888. 0x06 = Genre
  889. 0x06 = Duration
  890. Opcode 0x08 - Set Player Attributes Value Response command/response
  891. Command parameters: Status (1 octet)
  892. In case of an error, the error response will be returned.
  893. Valid status values: Same as in Get Play Status Response
  894. Opcode 0x09 - Register Notification Response command/response
  895. Command parameters: Event (1 octet)
  896. Type (1 octet)
  897. Data length (1 octet)
  898. Data (variable)
  899. In case of an error, the error response will be returned.
  900. Valid event values: 0x01 = Status Changed
  901. 0x02 = Track Changed
  902. 0x03 = Track Reached End
  903. 0x04 = Track Reached Start
  904. 0x05 = Position Changed
  905. 0x08 = Setting Changed
  906. Valid type values : 0x00 = Interim
  907. 0x01 = Changed
  908. Opcode 0x0a - Set Volume command/response
  909. Command parameters: Value (1 octet)
  910. In case of an error, the error response will be returned.
  911. Notifications:
  912. Opcode 0x81 - Remote Features notification
  913. Notification parameters: Remote address (6 octets)
  914. Features (1 octet)
  915. Valid features values : 0x00 = None
  916. 0x01 = Metadata
  917. 0x02 = Absolute Volume
  918. 0x03 = Browse
  919. Opcode 0x82 - Get Play Status notification
  920. Notification parameters: <none>
  921. Opcode 0x83 - List Player Attributes notification
  922. Notification parameters: <none>
  923. Opcode 0x84 - List Player Values notification
  924. Notification parameters: Attribute (1 octet)
  925. Valid attribute values: Same as in List Player Attributes
  926. Opcode 0x85 - Get Player Values notification
  927. Notification parameters: Number of attributes (1 octet)
  928. Attribute # (1 octet)
  929. ...
  930. Valid attribute values: Same as in List Player Attributes
  931. Opcode 0x86 - Get Player Attributes Text notification
  932. Notification parameters: Number of attributes (1 octet)
  933. Attribute # (1 octet)
  934. ...
  935. Valid attribute values: Same as in List Player Attributes
  936. Opcode 0x87 - Get Player Values Text notification
  937. Notification parameters: Attribute (1 octet)
  938. Number of values (1 octet)
  939. Value # (1 octet)
  940. ...
  941. Valid attribute values: Same as in List Player Attributes
  942. Opcode 0x88 - Set Player Values notification
  943. Notification parameters: Number of attributes (1 octet)
  944. Attribute # (1 octet)
  945. Value # (1 octet)
  946. ...
  947. Valid attribute values: Same as in List Player Attributes
  948. Opcode 0x89 - Get Element Attributes notification
  949. Notification parameters: Number of attributes (1 octet)
  950. Attribute # (1 octet)
  951. ...
  952. Valid attribute values: Same as in Get Element Attribute
  953. Opcode 0x8a - Register Notification notification
  954. Notification parameters: Event (1 octet)
  955. Parameter (4 octets)
  956. Valid event values: Same as in Register Notification
  957. Opcode 0x8b - Volume Changed notification
  958. Notification parameters: Volume (1 octet)
  959. Type (1 octet)
  960. Valid type values: Same as in Register Notification
  961. Opcode 0x8c - Passthrough Command notification
  962. Notification parameters: ID (1 octet)
  963. State (1 octet)
  964. Bluetooth GATT HAL (ID 9)
  965. =========================
  966. Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
  967. Structures:
  968. GATT Service ID: UUID (16 octets)
  969. Instance ID (1 octet)
  970. Is Primary (1 octet)
  971. GATT Included Service ID: UUID (16 octets)
  972. Instance ID (1 octet)
  973. Is Primary (1 octet)
  974. GATT Characteristic ID: UUID (16 octets)
  975. Instance ID (1 octet)
  976. GATT Descriptor ID: UUID (16 octets)
  977. Instance ID (1 octet)
  978. Commands and responses:
  979. Opcode 0x00 - Error response
  980. Opcode 0x01 - Client Register command/response
  981. Command parameters: Service UUID (16 octets)
  982. Response parameters: <none>
  983. In case of an error, the error response will be returned.
  984. Opcode 0x02 - Client Unregister command/response
  985. Command parameters: Client Interface (4 octets)
  986. Response parameters: <none>
  987. In case of an error, the error response will be returned.
  988. Opcode 0x03 - Client Scan command/response
  989. Command parameters: Client Interface (4 octets)
  990. Start (1 octet)
  991. Response parameters: <none>
  992. In case of an error, the error response will be returned.
  993. Opcode 0x04 - Client Connect Device command/response
  994. Command parameters: Client Interface (4 octets)
  995. Remote address (6 octets)
  996. Is Direct (1 octet)
  997. Transport (4 octets)
  998. Response parameters: <none>
  999. Valid transport value: 0x00 = Auto
  1000. 0x01 = BR/EDR
  1001. 0x02 = LE
  1002. In case of an error, the error response will be returned.
  1003. Opcode 0x05 - Client Disconnect Device command/response
  1004. Command parameters: Client Interface (4 octets)
  1005. Remote address (6 octets)
  1006. Connection ID (4 octets)
  1007. Response parameters: <none>
  1008. In case of an error, the error response will be returned.
  1009. Opcode 0x06 - Client Listen command/response
  1010. Command parameters: Client Interface (4 octets)
  1011. Start (1 octet)
  1012. Response parameters: <none>
  1013. In case of an error, the error response will be returned.
  1014. Opcode 0x07 - Client Refresh command/response
  1015. Command parameters: Client Interface (4 octets)
  1016. Remote address (6 octets)
  1017. Response parameters: <none>
  1018. In case of an error, the error response will be returned.
  1019. Opcode 0x08 - Client Search Service command/response
  1020. Command parameters: Connection ID (4 octets)
  1021. Filtered (1 octet)
  1022. Filter UUID (16 octets)
  1023. Response parameters: <none>
  1024. Filter UUID shall only be present when Filtered is non-zero.
  1025. In case of an error, the error response will be returned.
  1026. Opcode 0x09 - Client Get Included Service command/response
  1027. Command parameters: Connection ID (4 octets)
  1028. GATT Service ID (18 octets)
  1029. Continuation (1 octet)
  1030. GATT Included Service ID (18 octets)
  1031. ...
  1032. Response parameters: <none>
  1033. GATT Included Service ID shall only be present when Continuation
  1034. is non-zero.
  1035. In case of an error, the error response will be returned.
  1036. Opcode 0x0a - Client Get Characteristic command/response
  1037. Command parameters: Connection ID (4 octets)
  1038. GATT Service ID (18 octets)
  1039. Continuation (1 octet)
  1040. GATT Characteristic ID (17 octets)
  1041. ...
  1042. Response parameters: <none>
  1043. GATT Characteristic ID shall only be present when Continuation
  1044. is non-zero.
  1045. In case of an error, the error response will be returned.
  1046. Opcode 0x0b - Client Get Descriptor command/response
  1047. Command parameters: Connection ID (4 octets)
  1048. GATT Service ID (18 octets)
  1049. GATT Characteristic ID (17 octets)
  1050. Continuation (1 octet)
  1051. GATT Descriptor ID (17 octets)
  1052. ...
  1053. Response parameters: <none>
  1054. GATT Descriptor ID shall only be present when Continuation is
  1055. non-zero.
  1056. In case of an error, the error response will be returned.
  1057. Opcode 0x0c - Client Read Characteristic command/response
  1058. Command parameters: Connection ID (4 octets)
  1059. GATT Service ID (18 octets)
  1060. GATT Characteristic ID (17 octets)
  1061. Authorization (4 octets)
  1062. Response parameters: <none>
  1063. In case of an error, the error response will be returned.
  1064. Opcode 0x0d - Client Write Characteristic command/response
  1065. Command parameters: Connection ID (4 octets)
  1066. GATT Service ID (18 octets)
  1067. GATT Characteristic ID (17 octets)
  1068. Write Type (4 octets)
  1069. Length (4 octets)
  1070. Authorization Req. (4 octets)
  1071. Value (variable)
  1072. Response parameters: <none>
  1073. Valid Write Type: 0x01 = No response
  1074. 0x02 = Default
  1075. 0x03 = Prepare
  1076. 0x04 = Signed
  1077. In case of an error, the error response will be returned.
  1078. Opcode 0x0e - Client Read Descriptor command/response
  1079. Command parameters: Connection ID (4 octets)
  1080. GATT Service ID (18 octets)
  1081. GATT Characteristic ID (17 octets)
  1082. GATT Descriptor ID (17 octets)
  1083. Authorization Req. (4 octets)
  1084. Response parameters: <none>
  1085. In case of an error, the error response will be returned.
  1086. Opcode 0x0f - Client Write Descriptor command/response
  1087. Command parameters: Connection ID (4 octets)
  1088. GATT Service ID (18 octets)
  1089. GATT Characteristic ID (17 octets)
  1090. GATT Descriptor ID (17 octets)
  1091. Write Type (4 octets)
  1092. Length (4 octets)
  1093. Authorization Req. (4 octets)
  1094. Value (variable)
  1095. Response parameters: <none>
  1096. Valid Write Type: 0x01 = No response
  1097. 0x02 = Default
  1098. 0x03 = Prepare
  1099. 0x04 = Signed
  1100. In case of an error, the error response will be returned.
  1101. Opcode 0x10 - Client Execute Write command/response
  1102. Command parameters: Connection ID (4 octets)
  1103. Execute (4 octets)
  1104. Response parameters: <none>
  1105. In case of an error, the error response will be returned.
  1106. Opcode 0x11 - Client Register For Notification command/response
  1107. Command parameters: Client Interface (4 octets)
  1108. Remote address (6 octets)
  1109. GATT Service ID (18 octets)
  1110. GATT Characteristic ID (17 octets)
  1111. Response parameters: <none>
  1112. In case of an error, the error response will be returned.
  1113. Opcode 0x12 - Client Deregister For Notification command/response
  1114. Command parameters: Client Interface (4 octets)
  1115. Remote address (6 octets)
  1116. GATT Service ID (18 octets)
  1117. GATT Characteristic ID (17 octets)
  1118. Response parameters: <none>
  1119. In case of an error, the error response will be returned.
  1120. Opcode 0x13 - Client Read Remote RSSI command/response
  1121. Command parameters: Client Interface (4 octets)
  1122. Remote address (6 octets)
  1123. Response parameters: <none>
  1124. In case of an error, the error response will be returned.
  1125. Opcode 0x14 - Client Get Device Type command/response
  1126. Command parameters: Remote address (6 octets)
  1127. Response parameters: Device Type
  1128. Valid Device Type: 0x01 = BREDR
  1129. 0x02 = BLE
  1130. 0x03 = DUAL
  1131. In case of an error, the error response will be returned.
  1132. Opcode 0x15 - Client Set Advertising data command/response
  1133. Command parameters: Server Interface (4 octets)
  1134. Set Scan Resp. (1 octet)
  1135. Include Name (1 octet)
  1136. Include TX Power (1 octet)
  1137. Min. Interval (4 octets)
  1138. Max. Interval (4 octets)
  1139. Appearance (4 octets)
  1140. Manufacturer Len. (2 octets)
  1141. Manufacturer Data (variable)
  1142. Response parameters: <none>
  1143. In case of an error, the error response will be returned.
  1144. Opcode 0x16 - Client Test Command command/response
  1145. Command parameters: Command (4 octets)
  1146. Address (6 octets)
  1147. UUID (16 octets)
  1148. U1 (2 octets)
  1149. U2 (2 octets)
  1150. U3 (2 octets)
  1151. U4 (2 octets)
  1152. U5 (2 octets)
  1153. Response parameters: <none>
  1154. In case of an error, the error response will be returned.
  1155. Opcode 0x17 - Server Register command/response
  1156. Command parameters: UUID (16 octets)
  1157. Response parameters: <none>
  1158. In case of an error, the error response will be returned.
  1159. Opcode 0x18 - Server Unregister command/response
  1160. Command parameters: Server (4 octets)
  1161. Response parameters: <none>
  1162. In case of an error, the error response will be returned.
  1163. Opcode 0x19 - Server Connect Peripheral command/response
  1164. Command parameters: Server (4 octets)
  1165. Remote address (6 octets)
  1166. Is Direct (1 octet)
  1167. Transport (4 octets)
  1168. Response parameters: <none>
  1169. In case of an error, the error response will be returned.
  1170. Opcode 0x1a - Server Disconnect Peripheral command/response
  1171. Command parameters: Server (4 octets)
  1172. Remote address (6 octets)
  1173. Connection ID (1 octet)
  1174. Response parameters: <none>
  1175. In case of an error, the error response will be returned.
  1176. Opcode 0x1b - Server Add Service command/response
  1177. Command parameters: Server (4 octets)
  1178. GATT Service ID (18 octets)
  1179. Number of Handles (4 octet)
  1180. Response parameters: <none>
  1181. Valid GATT Service ID: UUID (16 octets)
  1182. Instance ID (1 octet)
  1183. Is Primary (1 octet)
  1184. In case of an error, the error response will be returned.
  1185. Opcode 0x1c - Server Add Included Service command/response
  1186. Command parameters: Server (4 octets)
  1187. Service handle (4 octets)
  1188. Included handle (4 octets)
  1189. Response parameters: <none>
  1190. In case of an error, the error response will be returned.
  1191. Opcode 0x1d - Server Add Characteristic command/response
  1192. Command parameters: Server (4 octets)
  1193. Service handle (4 octets)
  1194. UUID (16 octets)
  1195. Properties (4 octets)
  1196. Permissions (4 octets)
  1197. Response parameters: <none>
  1198. In case of an error, the error response will be returned.
  1199. Opcode 0x1e - Server Add Descriptor command/response
  1200. Command parameters: Server (4 octets)
  1201. Service handle (4 octets)
  1202. UUID (16 octets)
  1203. Permissions (4 octets)
  1204. Response parameters: <none>
  1205. In case of an error, the error response will be returned.
  1206. Opcode 0x1f - Server Start Service command/response
  1207. Command parameters: Server (4 octets)
  1208. Service handle (4 octets)
  1209. Transport (4 octets)
  1210. Response parameters: <none>
  1211. In case of an error, the error response will be returned.
  1212. Opcode 0x20 - Server Stop Service command/response
  1213. Command parameters: Server (4 octets)
  1214. Service handle (4 octets)
  1215. Response parameters: <none>
  1216. In case of an error, the error response will be returned.
  1217. Opcode 0x21 - Server Delete Service command/response
  1218. Command parameters: Server (4 octets)
  1219. Service handle (4 octets)
  1220. Response parameters: <none>
  1221. In case of an error, the error response will be returned.
  1222. Opcode 0x22 - Server Send Indication command/response
  1223. Command parameters: Server (4 octets)
  1224. Attribute handle (4 octets)
  1225. Connection ID (4 octets)
  1226. Length (4 octets)
  1227. Confirmation (4 octets)
  1228. Value (variable)
  1229. Response parameters: <none>
  1230. In case of an error, the error response will be returned.
  1231. Opcode 0x23 - Server Send Response command/response
  1232. Command parameters: Connection ID (4 octets)
  1233. Transaction ID (4 octets)
  1234. Handle (2 octets)
  1235. Offset (2 octets)
  1236. Auth Request (1 octect)
  1237. Status (4 octets)
  1238. GATT Response (4 octets)
  1239. Response parameters: <none>
  1240. Valid GATT Response: GATT Value (607 octets)
  1241. Handle (2 octets)
  1242. Valid GATT Value: Value (600 octets)
  1243. Handle (2 octets)
  1244. Offset (2 octets)
  1245. Length (2 octets)
  1246. Authentication Request (1 octet)
  1247. In case of an error, the error response will be returned.
  1248. Opcode 0x24 - Client Scan Filter Params Setup command/response
  1249. Command parameters: Client Interface (4 octets)
  1250. Action (4 octets)
  1251. Filter Index (4 octets)
  1252. Features (4 octets)
  1253. List Type (4 octets)
  1254. Filter Type (4 octets)
  1255. RSSI High Threshold (4 octets)
  1256. RSSI Low Threshold (4 octets)
  1257. Delivery Mode (4 octets)
  1258. Found Timeout (4 octets)
  1259. Lost Timeout (4 octets)
  1260. Found Timeout Count (4 octets)
  1261. Response parameters: <none>
  1262. In case of an error, the error response will be returned.
  1263. Opcode 0x25 - Client Scan Filter Add Remove command/response
  1264. Command parameters: Client Interface (4 octets)
  1265. Action (4 octets)
  1266. Filter Type (4 octets)
  1267. Filter Index (4 octets)
  1268. Company ID (4 octets)
  1269. Company ID Mask (4 octets)
  1270. UUID (16 octets)
  1271. UUID Mask (16 octets)
  1272. Address (6 octets)
  1273. Address Type (1 octet)
  1274. Data Length (4 octets)
  1275. Data (variable)
  1276. Mask Length (4 octets)
  1277. Mask (variable)
  1278. Response parameters: <none>
  1279. In case of an error, the error response will be returned.
  1280. Opcode 0x26 - Client Scan Filter Clear command/response
  1281. Command parameters: Client Interface (4 octets)
  1282. Filter Index (4 octets)
  1283. Response parameters: <none>
  1284. In case of an error, the error response will be returned.
  1285. Opcode 0x27 - Client Scan Filter Enable command/response
  1286. Command parameters: Client Interface (4 octets)
  1287. Enable (1 octet)
  1288. Response parameters: <none>
  1289. In case of an error, the error response will be returned.
  1290. Opcode 0x28 - Client Configure MTU command/response
  1291. Command parameters: Connection ID (4 octets)
  1292. MTU (4 octets)
  1293. Response parameters: <none>
  1294. In case of an error, the error response will be returned.
  1295. Opcode 0x29 - Client Connection Parameter Update command/response
  1296. Command parameters: Address (6 octets)
  1297. Min Interval (4 octets)
  1298. Max Interval (4 octets)
  1299. Latency (4 octets)
  1300. Timeoutl (4 octets)
  1301. Response parameters: <none>
  1302. In case of an error, the error response will be returned.
  1303. Opcode 0x2a - Client Set Scan Parameters command/response
  1304. Command parameters: Scan Interval (4 octets)
  1305. Scan Window (4 octets)
  1306. Response parameters: <none>
  1307. In case of an error, the error response will be returned.
  1308. Opcode 0x2b - Client Setup Multi Advertising command/response
  1309. Command parameters: Client ID (4 octets)
  1310. Min Interval (4 octets)
  1311. Max Interval (4 octets)
  1312. ADV Type (4 octets)
  1313. Channel Map (4 octets)
  1314. TX Power (4 octets)
  1315. Timeout (4 octets)
  1316. Response parameters: <none>
  1317. In case of an error, the error response will be returned.
  1318. Opcode 0x2c - Client Update Multi Advertising command/response
  1319. Command parameters: Client ID (4 octets)
  1320. Min Interval (4 octets)
  1321. Max Interval (4 octets)
  1322. ADV Type (4 octets)
  1323. Channel Map (4 octets)
  1324. TX Power (4 octets)
  1325. Timeout (4 octets)
  1326. Response parameters: <none>
  1327. In case of an error, the error response will be returned.
  1328. Opcode 0x2d - Client Setup Multi Advertising Instance command/response
  1329. Command parameters: Client ID (4 octets)
  1330. Set Scan Response (1 octet)
  1331. Include Name (1 octet)
  1332. Include TX Power (1 octet)
  1333. Appearance (4 octets)
  1334. Manufacturer Data Length (4 octets)
  1335. Manufacturer Data (variable)
  1336. Service Data Length (4 octets)
  1337. Service Data (variable)
  1338. Service UUID Length (4 octets)
  1339. Service UUID (variable)
  1340. Response parameters: <none>
  1341. In case of an error, the error response will be returned.
  1342. Opcode 0x2e - Client Disable Multi Advertising Instance command/response
  1343. Command parameters: Client ID (4 octets)
  1344. Response parameters: <none>
  1345. In case of an error, the error response will be returned.
  1346. Opcode 0x2f - Client Configure Batchscan command/response
  1347. Command parameters: Client ID (4 octets)
  1348. Full Max (4 octets)
  1349. Trunc Max (4 octets)
  1350. Notify Threshold (4 octets)
  1351. Response parameters: <none>
  1352. In case of an error, the error response will be returned.
  1353. Opcode 0x30 - Client Enable Batchscan command/response
  1354. Command parameters: Client ID (4 octets)
  1355. Scan Mode (4 octets)
  1356. Scan Interval (4 octets)
  1357. Scan Window (4 octets)
  1358. Address Type (4 octets)
  1359. Discard Rule (4 octets)
  1360. Response parameters: <none>
  1361. In case of an error, the error response will be returned.
  1362. Opcode 0x31 - Client Disable Batchscan command/response
  1363. Command parameters: Client ID (4 octets)
  1364. Response parameters: <none>
  1365. In case of an error, the error response will be returned.
  1366. Opcode 0x32 - Client Read Batchscan Resports command/response
  1367. Command parameters: Client ID (4 octets)
  1368. Scan Mode (4 octets)
  1369. Response parameters: <none>
  1370. In case of an error, the error response will be returned.
  1371. Notifications:
  1372. Opcode 0x81 - Client Register notification
  1373. Notification parameters: Status (4 octets)
  1374. Client Interface (4 octets)
  1375. UUID (16 octets)
  1376. Opcode 0x82 - Client Scan Result notification
  1377. Notification parameters: Address (6 octets)
  1378. RSSI (4 octets)
  1379. Length (2 octets)
  1380. Data (variable)
  1381. Opcode 0x83 - Client Connect Device notification
  1382. Notification parameters: Connection ID (4 octets)
  1383. Status (4 octets)
  1384. Client Interface (4 octets)
  1385. Address (6 octets)
  1386. Opcode 0x84 - Client Disconnect Device notification
  1387. Notification parameters: Connection ID (4 octets)
  1388. Status (4 octets)
  1389. Client Interface (4 octets)
  1390. Address (6 octets)
  1391. Opcode 0x85 - Client Search Complete notification
  1392. Notification parameters: Connection ID (4 octets)
  1393. Status (4 octets)
  1394. Opcode 0x86 - Client Search Result notification
  1395. Notification parameters: Connection ID (4 octets)
  1396. GATT Service ID (18 octets)
  1397. Opcode 0x87 - Client Get Characteristic notification
  1398. Notification parameters: Connection ID (4 octets)
  1399. Status (4 octets)
  1400. GATT Service ID (18 octets)
  1401. GATT Characteristic ID (17 octets)
  1402. Char Prop. (4 octets)
  1403. Opcode 0x88 - Client Get Descriptor notification
  1404. Notification parameters: Connection ID (4 octets)
  1405. Status (4 octets)
  1406. GATT Service ID (18 octets)
  1407. GATT Characteristic ID (17 octets)
  1408. GATT Descriptor ID (17 octets)
  1409. Opcode 0x89 - Client Get Included Service notification
  1410. Notification parameters: Connection ID (4 octets)
  1411. Status (4 octets)
  1412. GATT Service ID (18 octets)
  1413. GATT Included Service ID (18 octets)
  1414. Opcode 0x8a - Client Register For Notification notification
  1415. Notification parameters: Connection ID (4 octets)
  1416. Registered (4 octets)
  1417. Status (4 octets)
  1418. GATT Service ID (18 octets)
  1419. GATT Characteristic ID (17 octets)
  1420. Opcode 0x8b - Client Notify notification
  1421. Notification parameters: Connection ID (4 octets)
  1422. Address (6 octets)
  1423. GATT Service ID (18 octets)
  1424. GATT Characteristic ID (17 octets)
  1425. Is Notify (1 octet)
  1426. Length (2 octets)
  1427. Value (variable)
  1428. Opcode 0x8c - Client Read Characteristic notification
  1429. Notification parameters: Connection ID (4 octets)
  1430. Status (4 octets)
  1431. GATT Read Parameters (variable)
  1432. Valid GATT Read Parameters: GATT Service ID (18 octets)
  1433. GATT Characteristic ID (17 octets)
  1434. GATT Descriptor ID (17 octets)
  1435. Value Type (4 octets)
  1436. Status (1 octet)
  1437. Length (2 octets)
  1438. Value (variable)
  1439. Opcode 0x8d - Client Write Characteristic notification
  1440. Notification parameters: Connection ID (4 octets)
  1441. Status (4 octets)
  1442. GATT Write Parameters (53 octets)
  1443. Valid GATT Write Parameters: GATT Service ID (18 octets)
  1444. GATT Characteristic ID (17 octets)
  1445. GATT Description ID (17 octets)
  1446. Status (1 octet)
  1447. Opcode 0x8e - Client Read Descriptor notification
  1448. Notification parameters: Connection ID (4 octets)
  1449. Status (4 octets)
  1450. GATT Read Parameters (variable)
  1451. Valid GATT Read Parameters: As described in Read Characteristic
  1452. Opcode 0x8f - Client Write Descriptor notification
  1453. Notification parameters: Connection ID (4 octets)
  1454. Status (4 octets)
  1455. GATT Write Parameters (53 octets)
  1456. Valid GATT Write Parameters: As described in Write Characteristic
  1457. Opcode 0x90 - Client Execute Write notification
  1458. Notification parameters: Connection ID (4 octets)
  1459. Status (4 octets)
  1460. Opcode 0x91 - Client Read Remote RSSI notification
  1461. Notification parameters: Client (4 octets)
  1462. Address (6 octets)
  1463. RSSI (4 octets)
  1464. Status (4 octets)
  1465. Opcode 0x92 - Client Listen notification
  1466. Notification parameters: Status (4 octets)
  1467. Server Interface (4 octets)
  1468. Opcode 0x93 - Server Register notification
  1469. Notification parameters: Status (4 octets)
  1470. Server (4 octets)
  1471. UUID (16 octets)
  1472. Opcode 0x94 - Server Connection notification
  1473. Notification parameters: Connection ID (4 octets)
  1474. Server (4 octets)
  1475. Connected (4 octets)
  1476. Address (6 octets)
  1477. Opcode 0x95 - Server Service Added notification
  1478. Notification parameters: Status (4 octets)
  1479. Server (4 octets)
  1480. GATT Service ID (18 octets)
  1481. Service Handle (4 octets)
  1482. Opcode 0x96 - Server Included Service Added notification
  1483. Notification patemeters: Status (4 octets)
  1484. Server (4 octets)
  1485. Service Handle (4 octets)
  1486. Included Service Handle (4 octets)
  1487. Opcode 0x97 - Server Characteristic Added notification
  1488. Notification parameters: Status (4 octets)
  1489. Server (4 octets)
  1490. UUID (16 octets)
  1491. Service Handle (4 octets)
  1492. Characteristic Handle (4 octets)
  1493. Opcode 0x98 - Server Descriptor Added notification
  1494. Notification parameters: Status (4 octets)
  1495. Server (4 octets)
  1496. UUID (6 octets)
  1497. Service Handle (4 octets)
  1498. Descriptor Handle (4 octets)
  1499. Opcode 0x99 - Server Service Started notification
  1500. Notification parameters: Status (4 octets)
  1501. Server (4 octets)
  1502. Service Handle (4 octets)
  1503. Opcode 0x9a - Server Service Stopped notification
  1504. Notification parameters: Status (4 octets)
  1505. Server (4 octets)
  1506. Service Handle (4 octets)
  1507. Opcode 0x9b - Server Service Deleted notification
  1508. Notification parameters: Status (4 octets)
  1509. Server (4 octets)
  1510. Service Handle (4 octets)
  1511. Opcode 0x9c - Server Request Read notification
  1512. Notification parameters: Connection ID (4 octets)
  1513. Trans ID (4 octets)
  1514. Address (6 octets)
  1515. Attribute Handle (4 octets)
  1516. Offset (4 octets)
  1517. Is Long (1 octet)
  1518. Opcode 0x9d - Server Request Write notification
  1519. Notification parameters: Connection ID (4 octets)
  1520. Trans ID (4 octets)
  1521. Address (6 octets)
  1522. Attribute Handle (4 octets)
  1523. Offset (4 octets)
  1524. Length (4 octets)
  1525. Need Response (4 octets)
  1526. Is Prepare (1 octet)
  1527. Value (variable)
  1528. Opcode 0x9e - Server Request Execute Write notification
  1529. Notification parameters: Connection ID (4 octets)
  1530. Trans ID (4 octets)
  1531. Address (6 octets)
  1532. Execute Write (4 octets)
  1533. Opcode 0x9f - Server Response Confirmation notification
  1534. Notification parameters: Status (4 octets)
  1535. Handle (4 octets)
  1536. Opcode 0xa0 - Client Configure MTU notification
  1537. Notification parameters: Connection ID (4 octets)
  1538. Status (4 octets)
  1539. MTU (4 octets)
  1540. Opcode 0xa1 - Client Filter Configuration notification
  1541. Notification parameters: Action (4 octets)
  1542. Client ID (4 octets)
  1543. Status (4 octets)
  1544. Filter Type (4 octets)
  1545. Available Space (4 octets)
  1546. Opcode 0xa2 - Client Filter Parameters notification
  1547. Notification parameters: Action (4 octets)
  1548. Client ID (4 octets)
  1549. Status (4 octets)
  1550. Available Space (4 octets)
  1551. Opcode 0xa3 - Client Filter Status notification
  1552. Notification parameters: Enable (4 octets)
  1553. Client ID (4 octets)
  1554. Status (4 octets)
  1555. Opcode 0xa4 - Client Multi Advertising Enable notification
  1556. Notification parameters: Client ID (4 octets)
  1557. Status (4 octets)
  1558. Opcode 0xa5 - Client Multi Advertising Update notification
  1559. Notification parameters: Client ID (4 octets)
  1560. Status (4 octets)
  1561. Opcode 0xa6 - Client Multi Advertising Data notification
  1562. Notification parameters: Client ID (4 octets)
  1563. Status (4 octets)
  1564. Opcode 0xa7 - Client Multi Advertising Disable notification
  1565. Notification parameters: Client ID (4 octets)
  1566. Status (4 octets)
  1567. Opcode 0xa8 - Client Congestion notification
  1568. Notification parameters: Connection ID (4 octets)
  1569. Congested (1 octet)
  1570. Opcode 0xa9 - Client Configure Batchscan notification
  1571. Notification parameters: Client ID (4 octets)
  1572. Status (4 octets)
  1573. Opcode 0xaa - Client Enable Batchscan notification
  1574. Notification parameters: Action (4 octets)
  1575. Client ID (4 octets)
  1576. Status (4 octets)
  1577. Opcode 0xab - Client Batchscan Reports notification
  1578. Notification parameters: Client ID (4 octets)
  1579. Status (4 octets)
  1580. Report Format (4 octets)
  1581. Num Reports (4 octets)
  1582. Data Length (4 octets)
  1583. Data (variable)
  1584. Opcode 0xac - Client Batchscan Threshold notification
  1585. Notification parameters: Client ID (4 octets)
  1586. Opcode 0xad - Client Track ADV notification
  1587. Notification parameters: Client ID (4 octets)
  1588. Filter Index (4 octets)
  1589. Address Type (4 octets)
  1590. Address (6 octets)
  1591. State (4 octets)
  1592. Opcode 0xae - Server Indication Sent notification
  1593. Notification parameters: Connection ID (4 octets)
  1594. Status (4 octets)
  1595. Opcode 0xaf - Server Congestion notification
  1596. Notification parameters: Connection ID (4 octets)
  1597. Congested (1 octet)
  1598. Opcode 0xb0 - Server MTU Changed notification
  1599. Notification parameters: Connection ID (4 octets)
  1600. MTU (4 octets)
  1601. Bluetooth Handsfree Client HAL (ID 10)
  1602. ======================================
  1603. Android HAL name: "hf_client" (BT_PROFILE_HANDSFREE_CLIENT_ID)
  1604. Commands and response:
  1605. Opcode 0x00 - Error response
  1606. Opcode 0x01 - Connect command/respose
  1607. Command parameters: Remote address (6 octects)
  1608. Response parameters: <none>
  1609. In case of an error, the error response will be returned.
  1610. Opcode 0x02 - Disonnect command/response
  1611. Command parameters: Remote address (6 octetcs)
  1612. Response parameters: <none>
  1613. In case of an error, the error response will be returned.
  1614. Opcode 0x03 - Connect Audio command/response
  1615. Command parameters: Remote address (6 octets)
  1616. Response parameters: <none>
  1617. In case of an error, the error response will be returned.
  1618. Opcode 0x04 - Disconnect Audio command/response
  1619. Command parameters: Remote address (6 octets)
  1620. Response parameters: <none>
  1621. In case of an error, the error response will be returned.
  1622. Opcode 0x05 - Start Voice Recognition command/response
  1623. Command parameters: <none>
  1624. Response parameters: <none>
  1625. In case of an error, the error response will be returned.
  1626. Opcode 0x06 - Stop Voice Recognition command/response
  1627. Command parameters: <none>
  1628. Response parameters: <none>
  1629. In case of an error, the error response will be returned.
  1630. Opcode 0x07 - Volume Control command/response
  1631. Command parameters: Volume type (1 octet)
  1632. Volume (1 octet)
  1633. Response parameters: <none>
  1634. Valid volume types: 0x00 = Speaker
  1635. 0x01 = Microphone
  1636. In case of an error, the error response will be returned.
  1637. Opcode 0x08 - Dial command/response
  1638. Command parameters: Number (string)
  1639. Response parameters: <none>
  1640. In case of an error, the error response will be returned.
  1641. Opcode 0x09 - Dial Memory command/response
  1642. Command parameters: Location (4 octet)
  1643. Response parameters: <none>
  1644. In case of an error, the error response will be returned.
  1645. Opcode 0x10 - Handle Call Action command/response
  1646. Command parameters: Action (1 octet)
  1647. Call Index (1 octet)
  1648. Response parameters: <none>
  1649. Valid actions: 0x00 = CHLD_0
  1650. 0x01 = CHLD_1
  1651. 0x02 = CHLD_2
  1652. 0x03 = CHLD_3
  1653. 0x04 = CHLD_4
  1654. 0x05 = CHLD_1x
  1655. 0x06 = CHLD_2x
  1656. 0x07 = ATA
  1657. 0x08 = CHUP
  1658. 0x09 = BTRH_0
  1659. 0x10 = BTRH_1
  1660. 0x11 = BTRH_2
  1661. In case of an error, the error response will be returned.
  1662. Opcode 0x11 - Query Current Calls commad/response
  1663. Command parameters: <none>
  1664. Response parameters: <none>
  1665. In case of an error, the error response will be returned.
  1666. Opcode 0x12 - Query Current Operator Name
  1667. Command parameters: <none>
  1668. Response parameters: <none>
  1669. In case of an error, the error response will be returned.
  1670. Opcode 0x13 - Retrieve Subscriber Info command/response
  1671. Command parameters: <none>
  1672. Response parameters: <none>
  1673. In case of an error, the error response will be returned.
  1674. Opcode 0x14 - Send DTMF Tone command/response
  1675. Command parameters: Tone (1 octet)
  1676. Response parameters: <none>
  1677. In case of an error, the error response will be returned.
  1678. Opcode 0x15 - Request Last Voice Tag Number command/response
  1679. Command parameters: <none>
  1680. Response parameters: <none>
  1681. In case of an error, the error response will be returned.
  1682. Notifications:
  1683. Opcode 0x81 - Connection State Changed notification
  1684. Notification parameters: State (1 octet)
  1685. Peer Features (4 octets)
  1686. CHLD Features (4 octets)
  1687. Address (6 octets)
  1688. Valid State values: 0x00 = Disconnected
  1689. 0x01 = Connecting
  1690. 0x02 = Connected
  1691. 0x03 = SLC Connected
  1692. 0x04 = Disconnecting
  1693. Peer Features is a bitmask of the supported features. Currently
  1694. available bits:
  1695. 0 Three way calling
  1696. 1 Echo cancellation and/or noise reduction
  1697. 2 Voice recognition
  1698. 3 In band ring tone
  1699. 4 Attach a number to a voice tag
  1700. 5 Ability to reject a call
  1701. 6 Enhanced call status
  1702. 7 Enhanced call control
  1703. 8 Extended Error Result Codes
  1704. 9 Codec negotiations
  1705. 10-31 Reserved for future use
  1706. CHLD Features is a bitmask of the supported features. Currently
  1707. available bits:
  1708. 0 Release waiting call or held calls
  1709. 1 Release active calls and accept other call
  1710. 2 Release specified active call only
  1711. 3 Place all active calls on hold and accept other call
  1712. 4 Request private mode with secified call
  1713. 5 Add a held call to the multiparty
  1714. 6 Connect two calls and leave multiparty
  1715. 7-31 Reserved for future use
  1716. Note: Peer and CHLD Features are valid only in SCL Connected state
  1717. Opcode 0x82 - Audio State Changed notification
  1718. Notification parameters: State (1 octet)
  1719. Address (6 octets)
  1720. Valid State values: 0x00 = Disconnected
  1721. 0x01 = Connecting
  1722. 0x02 = Connected
  1723. 0x03 = Connected mSBC
  1724. Opcode 0x83 - Voice Recognition State Changed notification
  1725. Notification parameters: State (1 octet)
  1726. Valid State values: 0x00 = VR Stopped
  1727. 0x01 = VR Started
  1728. Opcode 0x84 - Network State Changed notification
  1729. Notification parameters: State (1 octet)
  1730. Valid State values: 0x00 = Network Not Available
  1731. 0x01 = Network Available
  1732. Opcode 0x85 - Network Roaming Type Changed notification
  1733. Notification parameters: Type (1 octet)
  1734. Valid Type values: 0x00 = Home
  1735. 0x01 = Roaming
  1736. Opcode 0x86 - Network Signal Strength notification
  1737. Notification parameters: Signal Strength (1 octet)
  1738. Opcode 0x87 - Battery Level notification
  1739. Notification parameters: Battery Level (1 octet)
  1740. Opcode 0x88 - Current Operator Name notification
  1741. Notification parameters: Name (string)
  1742. Opcode 0x89 - Call Indicatior notification
  1743. Notification parameters: Call (1 octet)
  1744. Valid Call values: 0x00 = No Call In Progress
  1745. 0x01 = Call In Progress
  1746. Opcode 0x8a - Call Setup Indicator notification
  1747. Notification parameters: Call Setup (1 octet)
  1748. Valid Call Setup values: 0x00 = None
  1749. 0x01 = Incoming
  1750. 0x02 = Outgoing
  1751. 0x03 = Alerting
  1752. Opcode 0x8b - Call Held Indicator notification
  1753. Notification parameters: Call Held (1 octet)
  1754. Valid Call Held values: 0x00 = None
  1755. 0x01 = Hold and Active
  1756. 0x02 = Hold
  1757. Opcode 0x8c - Resposne and Hold Status notification
  1758. Notification parameters: Status (1 octet)
  1759. Valid Status values: 0x00 = Held
  1760. 0x01 = Accept
  1761. 0x02 = Reject
  1762. Opcode 0x8d - Calling Line Identification notification
  1763. Notification parameters: Number (string)
  1764. Note: This will be called only on incoming call if number is
  1765. provided.
  1766. Opcode 0x8e - Call Waiting notification
  1767. Notification parameters: Nunmber (string)
  1768. Opcode 0x8f - Current Calls List notification
  1769. Notification parameters: Index (1 octet)
  1770. Direction (1 octet)
  1771. Call State (1 octet)
  1772. Multiparty (1 octet)
  1773. Number (string)
  1774. Valid Direction values: 0x00 = Outgoing
  1775. 0x01 = Incoming
  1776. Valid Call Sate values: 0x00 = Active
  1777. 0x01 = Held
  1778. 0x02 = Dialing
  1779. 0x03 = Alerting
  1780. 0x04 = Incoming
  1781. 0x05 = Waiting
  1782. 0x06 = Call held by Response and Hold
  1783. Valid Multiparty values: 0x00 = Single Call
  1784. 0x01 = Multiparty (conference) Call
  1785. Note: Number might be empty
  1786. Opcode 0x90 - Volume Changed notification
  1787. Notification parameters: Type (1 octet)
  1788. Volume (1 octet)
  1789. Valid Type values: 0x00 = Speaker
  1790. 0x01 = Microphone
  1791. Opcode 0x91 - Command Complete Callback notification
  1792. Notification parameters: Type (1 octet)
  1793. CME (1 octet)
  1794. Valid Type values: 0x00 = OK
  1795. 0x01 = Error
  1796. 0x02 = Error no carrier
  1797. 0x03 = Error busy
  1798. 0x04 = Error no answer
  1799. 0x05 = Error delayed
  1800. 0x06 = Error blacklisted
  1801. 0x07 = Error CME
  1802. Note: CME parameter is valid only for Error CME type
  1803. Opcode 0x92 - Subscriber Service Info Callback notification
  1804. Notification parameters: Name (string)
  1805. Type (1 octet)
  1806. Valid Type values: 0x00 = Service unknown
  1807. 0x01 = Service voice
  1808. 0x02 = Service fax
  1809. Opcode 0x93 - In Band Ring Settings Callback notification
  1810. Notification parameters: State (1 octet)
  1811. Valid State values: 0x00 = In band ringtone not provided
  1812. 0x01 = In band ringtone provided
  1813. Opcode 0x94 - Last Voice Call Tag Number Callback notification
  1814. Notification parameters: Number (string)
  1815. Opcode 0x95 - Ring Indication notification
  1816. Notification parameters: <none>
  1817. Bluetooth Map Client HAL (ID 11)
  1818. =========================
  1819. Android HAL name: "map_client" (BT_PROFILE_MAP_CLIENT_ID)
  1820. Commands and responses:
  1821. Opcode 0x00 - Error response
  1822. Opcode 0x01 - Get Remote MAS Instances
  1823. Command parameters: Remote address (6 octets)
  1824. Response parameters: <none>
  1825. In case of an error, the error response will be returned.
  1826. Notifications:
  1827. Opcode 0x81 - Remote MAS Instances notification
  1828. Notification parameters: Status (1 octet)
  1829. Remote address (6 octets)
  1830. Number of instances (4 octets)
  1831. Instance ID # (4 octets)
  1832. Channel # (4 octets)
  1833. Message types (4 octets)
  1834. Name # (string)
  1835. Bluetooth Remote Control Controller HAL (ID 12)
  1836. ===================================
  1837. Android HAL name: "avrcp-ctrl" (BT_PROFILE_AV_RC_CTRL_ID)
  1838. Commands and responses:
  1839. Opcode 0x00 - Error response
  1840. Opcode 0x01 - Send Pass Through command/response
  1841. Command parameters: Remote Address (6 octets)
  1842. Key Code (1 octet)
  1843. Key State (1 octet)
  1844. In case of an error, the error response will be returned.
  1845. Notifications:
  1846. Opcode 0x81 - Passthrough Response Notification
  1847. Notification parameters: ID (1 octet)
  1848. Key State (1 octet)
  1849. Opcode 0x82 - Connection State Notification
  1850. Notification parameters: State (1 octet)
  1851. Remote Address (6 octets)