hal-msg.h 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322
  1. /* SPDX-License-Identifier: LGPL-2.1-or-later */
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2013 Intel Corporation. All rights reserved.
  7. *
  8. *
  9. */
  10. static const char BLUEZ_HAL_SK_PATH[] = "\0bluez_hal_socket";
  11. #define HAL_MINIMUM_EVENT 0x81
  12. #define HAL_SERVICE_ID_CORE 0
  13. #define HAL_SERVICE_ID_BLUETOOTH 1
  14. #define HAL_SERVICE_ID_SOCKET 2
  15. #define HAL_SERVICE_ID_HIDHOST 3
  16. #define HAL_SERVICE_ID_PAN 4
  17. #define HAL_SERVICE_ID_HANDSFREE 5
  18. #define HAL_SERVICE_ID_A2DP 6
  19. #define HAL_SERVICE_ID_HEALTH 7
  20. #define HAL_SERVICE_ID_AVRCP 8
  21. #define HAL_SERVICE_ID_GATT 9
  22. #define HAL_SERVICE_ID_HANDSFREE_CLIENT 10
  23. #define HAL_SERVICE_ID_MAP_CLIENT 11
  24. #define HAL_SERVICE_ID_AVRCP_CTRL 12
  25. #define HAL_SERVICE_ID_A2DP_SINK 13
  26. #define HAL_SERVICE_ID_MAX HAL_SERVICE_ID_A2DP_SINK
  27. /* Core Service */
  28. #define HAL_STATUS_SUCCESS IPC_STATUS_SUCCESS
  29. #define HAL_STATUS_FAILED 0x01
  30. #define HAL_STATUS_NOT_READY 0x02
  31. #define HAL_STATUS_NOMEM 0x03
  32. #define HAL_STATUS_BUSY 0x04
  33. #define HAL_STATUS_DONE 0x05
  34. #define HAL_STATUS_UNSUPPORTED 0x06
  35. #define HAL_STATUS_INVALID 0x07
  36. #define HAL_STATUS_UNHANDLED 0x08
  37. #define HAL_STATUS_AUTH_FAILURE 0x09
  38. #define HAL_STATUS_REMOTE_DEVICE_DOWN 0x0a
  39. #define HAL_OP_STATUS IPC_OP_STATUS
  40. #define HAL_MODE_DEFAULT 0x00
  41. #define HAL_MODE_BREDR 0x01
  42. #define HAL_MODE_LE 0x02
  43. #define HAL_OP_REGISTER_MODULE 0x01
  44. struct hal_cmd_register_module {
  45. uint8_t service_id;
  46. uint8_t mode;
  47. int32_t max_clients;
  48. } __attribute__((packed));
  49. #define HAL_OP_UNREGISTER_MODULE 0x02
  50. struct hal_cmd_unregister_module {
  51. uint8_t service_id;
  52. } __attribute__((packed));
  53. #define HAL_CONFIG_VENDOR 0x00
  54. #define HAL_CONFIG_MODEL 0x01
  55. #define HAL_CONFIG_NAME 0x02
  56. #define HAL_CONFIG_SERIAL_NUMBER 0x03
  57. #define HAL_CONFIG_SYSTEM_ID 0x04
  58. #define HAL_CONFIG_PNP_ID 0x05
  59. #define HAL_CONFIG_FW_REV 0x06
  60. #define HAL_CONFIG_HW_REV 0x07
  61. struct hal_config_prop {
  62. uint8_t type;
  63. uint16_t len;
  64. uint8_t val[0];
  65. } __attribute__((packed));
  66. #define HAL_OP_CONFIGURATION 0x03
  67. struct hal_cmd_configuration {
  68. uint8_t num;
  69. struct hal_config_prop props[0];
  70. } __attribute__((packed));
  71. /* Bluetooth Core HAL API */
  72. #define HAL_OP_ENABLE 0x01
  73. #define HAL_OP_DISABLE 0x02
  74. #define HAL_OP_GET_ADAPTER_PROPS 0x03
  75. #define HAL_OP_GET_ADAPTER_PROP 0x04
  76. struct hal_cmd_get_adapter_prop {
  77. uint8_t type;
  78. } __attribute__((packed));
  79. #define HAL_MAX_NAME_LENGTH 249
  80. #define HAL_PROP_ADAPTER_NAME 0x01
  81. #define HAL_PROP_ADAPTER_ADDR 0x02
  82. #define HAL_PROP_ADAPTER_UUIDS 0x03
  83. #define HAL_PROP_ADAPTER_CLASS 0x04
  84. #define HAL_PROP_ADAPTER_TYPE 0x05
  85. #define HAL_PROP_ADAPTER_SERVICE_REC 0x06
  86. #define HAL_PROP_ADAPTER_SCAN_MODE 0x07
  87. #define HAL_PROP_ADAPTER_BONDED_DEVICES 0x08
  88. #define HAL_PROP_ADAPTER_DISC_TIMEOUT 0x09
  89. #define HAL_PROP_DEVICE_NAME 0x01
  90. #define HAL_PROP_DEVICE_ADDR 0x02
  91. #define HAL_PROP_DEVICE_UUIDS 0x03
  92. #define HAL_PROP_DEVICE_CLASS 0x04
  93. #define HAL_PROP_DEVICE_TYPE 0x05
  94. #define HAL_PROP_DEVICE_SERVICE_REC 0x06
  95. struct hal_prop_device_service_rec {
  96. uint8_t uuid[16];
  97. uint16_t channel;
  98. uint8_t name_len;
  99. uint8_t name[];
  100. } __attribute__((packed));
  101. #define HAL_PROP_DEVICE_FRIENDLY_NAME 0x0a
  102. #define HAL_PROP_DEVICE_RSSI 0x0b
  103. #define HAL_PROP_DEVICE_VERSION_INFO 0x0c
  104. struct hal_prop_device_info {
  105. uint8_t version;
  106. uint16_t sub_version;
  107. uint16_t manufacturer;
  108. } __attribute__((packed));
  109. #define HAL_PROP_ADAPTER_LOCAL_LE_FEAT 0x0d
  110. #define HAL_PROP_DEVICE_TIMESTAMP 0xFF
  111. #define HAL_ADAPTER_SCAN_MODE_NONE 0x00
  112. #define HAL_ADAPTER_SCAN_MODE_CONN 0x01
  113. #define HAL_ADAPTER_SCAN_MODE_CONN_DISC 0x02
  114. #define HAL_TYPE_BREDR 0x01
  115. #define HAL_TYPE_LE 0x02
  116. #define HAL_TYPE_DUAL 0x03
  117. #define HAL_OP_SET_ADAPTER_PROP 0x05
  118. struct hal_cmd_set_adapter_prop {
  119. uint8_t type;
  120. uint16_t len;
  121. uint8_t val[0];
  122. } __attribute__((packed));
  123. #define HAL_OP_GET_REMOTE_DEVICE_PROPS 0x06
  124. struct hal_cmd_get_remote_device_props {
  125. uint8_t bdaddr[6];
  126. } __attribute__((packed));
  127. #define HAL_OP_GET_REMOTE_DEVICE_PROP 0x07
  128. struct hal_cmd_get_remote_device_prop {
  129. uint8_t bdaddr[6];
  130. uint8_t type;
  131. } __attribute__((packed));
  132. #define HAL_OP_SET_REMOTE_DEVICE_PROP 0x08
  133. struct hal_cmd_set_remote_device_prop {
  134. uint8_t bdaddr[6];
  135. uint8_t type;
  136. uint16_t len;
  137. uint8_t val[0];
  138. } __attribute__((packed));
  139. #define HAL_OP_GET_REMOTE_SERVICE_REC 0x09
  140. struct hal_cmd_get_remote_service_rec {
  141. uint8_t bdaddr[6];
  142. uint8_t uuid[16];
  143. } __attribute__((packed));
  144. #define HAL_OP_GET_REMOTE_SERVICES 0x0a
  145. struct hal_cmd_get_remote_services {
  146. uint8_t bdaddr[6];
  147. } __attribute__((packed));
  148. #define HAL_OP_START_DISCOVERY 0x0b
  149. #define HAL_OP_CANCEL_DISCOVERY 0x0c
  150. #define BT_TRANSPORT_UNKNOWN 0x00
  151. #define BT_TRANSPORT_BR_EDR 0x01
  152. #define BT_TRANSPORT_LE 0x02
  153. #define HAL_OP_CREATE_BOND 0x0d
  154. struct hal_cmd_create_bond {
  155. uint8_t bdaddr[6];
  156. uint8_t transport;
  157. } __attribute__((packed));
  158. #define HAL_OP_REMOVE_BOND 0x0e
  159. struct hal_cmd_remove_bond {
  160. uint8_t bdaddr[6];
  161. } __attribute__((packed));
  162. #define HAL_OP_CANCEL_BOND 0x0f
  163. struct hal_cmd_cancel_bond {
  164. uint8_t bdaddr[6];
  165. } __attribute__((packed));
  166. #define HAL_OP_PIN_REPLY 0x10
  167. struct hal_cmd_pin_reply {
  168. uint8_t bdaddr[6];
  169. uint8_t accept;
  170. uint8_t pin_len;
  171. uint8_t pin_code[16];
  172. } __attribute__((packed));
  173. #define HAL_SSP_VARIANT_CONFIRM 0x00
  174. #define HAL_SSP_VARIANT_ENTRY 0x01
  175. #define HAL_SSP_VARIANT_CONSENT 0x02
  176. #define HAL_SSP_VARIANT_NOTIF 0x03
  177. #define HAL_OP_SSP_REPLY 0x11
  178. struct hal_cmd_ssp_reply {
  179. uint8_t bdaddr[6];
  180. uint8_t ssp_variant;
  181. uint8_t accept;
  182. uint32_t passkey;
  183. } __attribute__((packed));
  184. #define HAL_OP_DUT_MODE_CONF 0x12
  185. struct hal_cmd_dut_mode_conf {
  186. uint8_t enable;
  187. } __attribute__((packed));
  188. #define HAL_OP_DUT_MODE_SEND 0x13
  189. struct hal_cmd_dut_mode_send {
  190. uint16_t opcode;
  191. uint8_t len;
  192. uint8_t data[0];
  193. } __attribute__((packed));
  194. #define HAL_OP_LE_TEST_MODE 0x14
  195. struct hal_cmd_le_test_mode {
  196. uint16_t opcode;
  197. uint8_t len;
  198. uint8_t data[0];
  199. } __attribute__((packed));
  200. #define HAL_OP_GET_CONNECTION_STATE 0x15
  201. struct hal_cmd_get_connection_state {
  202. uint8_t bdaddr[6];
  203. } __attribute__((packed));
  204. struct hal_rsp_get_connection_state {
  205. int32_t connection_state;
  206. } __attribute__((packed));
  207. #define HAL_OP_READ_ENERGY_INFO 0x16
  208. /* Bluetooth Socket HAL api */
  209. #define HAL_MODE_SOCKET_DEFAULT HAL_MODE_DEFAULT
  210. #define HAL_MODE_SOCKET_DYNAMIC_MAP 0x01
  211. #define HAL_SOCK_RFCOMM 0x01
  212. #define HAL_SOCK_SCO 0x02
  213. #define HAL_SOCK_L2CAP 0x03
  214. #define HAL_SOCK_FLAG_ENCRYPT 0x01
  215. #define HAL_SOCK_FLAG_AUTH 0x02
  216. #define HAL_OP_SOCKET_LISTEN 0x01
  217. struct hal_cmd_socket_listen {
  218. uint8_t type;
  219. uint8_t name[256];
  220. uint8_t uuid[16];
  221. int32_t channel;
  222. uint8_t flags;
  223. } __attribute__((packed));
  224. #define HAL_OP_SOCKET_CONNECT 0x02
  225. struct hal_cmd_socket_connect {
  226. uint8_t bdaddr[6];
  227. uint8_t type;
  228. uint8_t uuid[16];
  229. int32_t channel;
  230. uint8_t flags;
  231. } __attribute__((packed));
  232. /* Bluetooth HID Host HAL API */
  233. #define HAL_OP_HIDHOST_CONNECT 0x01
  234. struct hal_cmd_hidhost_connect {
  235. uint8_t bdaddr[6];
  236. } __attribute__((packed));
  237. #define HAL_OP_HIDHOST_DISCONNECT 0x02
  238. struct hal_cmd_hidhost_disconnect {
  239. uint8_t bdaddr[6];
  240. } __attribute__((packed));
  241. #define HAL_OP_HIDHOST_VIRTUAL_UNPLUG 0x03
  242. struct hal_cmd_hidhost_virtual_unplug {
  243. uint8_t bdaddr[6];
  244. } __attribute__((packed));
  245. #define HAL_OP_HIDHOST_SET_INFO 0x04
  246. struct hal_cmd_hidhost_set_info {
  247. uint8_t bdaddr[6];
  248. uint8_t attr;
  249. uint8_t subclass;
  250. uint8_t app_id;
  251. uint16_t vendor;
  252. uint16_t product;
  253. uint16_t country;
  254. uint16_t descr_len;
  255. uint8_t descr[0];
  256. } __attribute__((packed));
  257. #define HAL_HIDHOST_REPORT_PROTOCOL 0x00
  258. #define HAL_HIDHOST_BOOT_PROTOCOL 0x01
  259. #define HAL_HIDHOST_UNSUPPORTED_PROTOCOL 0xff
  260. #define HAL_OP_HIDHOST_GET_PROTOCOL 0x05
  261. struct hal_cmd_hidhost_get_protocol {
  262. uint8_t bdaddr[6];
  263. uint8_t mode;
  264. } __attribute__((packed));
  265. #define HAL_OP_HIDHOST_SET_PROTOCOL 0x06
  266. struct hal_cmd_hidhost_set_protocol {
  267. uint8_t bdaddr[6];
  268. uint8_t mode;
  269. } __attribute__((packed));
  270. #define HAL_HIDHOST_INPUT_REPORT 0x01
  271. #define HAL_HIDHOST_OUTPUT_REPORT 0x02
  272. #define HAL_HIDHOST_FEATURE_REPORT 0x03
  273. #define HAL_OP_HIDHOST_GET_REPORT 0x07
  274. struct hal_cmd_hidhost_get_report {
  275. uint8_t bdaddr[6];
  276. uint8_t type;
  277. uint8_t id;
  278. uint16_t buf_size;
  279. } __attribute__((packed));
  280. #define HAL_OP_HIDHOST_SET_REPORT 0x08
  281. struct hal_cmd_hidhost_set_report {
  282. uint8_t bdaddr[6];
  283. uint8_t type;
  284. uint16_t len;
  285. uint8_t data[0];
  286. } __attribute__((packed));
  287. #define HAL_OP_HIDHOST_SEND_DATA 0x09
  288. struct hal_cmd_hidhost_send_data {
  289. uint8_t bdaddr[6];
  290. uint16_t len;
  291. uint8_t data[0];
  292. } __attribute__((packed));
  293. /* a2dp source and sink HAL API */
  294. #define HAL_OP_A2DP_CONNECT 0x01
  295. struct hal_cmd_a2dp_connect {
  296. uint8_t bdaddr[6];
  297. } __attribute__((packed));
  298. #define HAL_OP_A2DP_DISCONNECT 0x02
  299. struct hal_cmd_a2dp_disconnect {
  300. uint8_t bdaddr[6];
  301. } __attribute__((packed));
  302. /* PAN HAL API */
  303. /* PAN Roles */
  304. #define HAL_PAN_ROLE_NONE 0x00
  305. #define HAL_PAN_ROLE_NAP 0x01
  306. #define HAL_PAN_ROLE_PANU 0x02
  307. /* PAN Control states */
  308. #define HAL_PAN_CTRL_ENABLED 0x00
  309. #define HAL_PAN_CTRL_DISABLED 0x01
  310. /* PAN Connection states */
  311. #define HAL_PAN_STATE_CONNECTED 0x00
  312. #define HAL_PAN_STATE_CONNECTING 0x01
  313. #define HAL_PAN_STATE_DISCONNECTED 0x02
  314. #define HAL_PAN_STATE_DISCONNECTING 0x03
  315. /* PAN status values */
  316. #define HAL_PAN_STATUS_FAIL 0x01
  317. #define HAL_PAN_STATUS_NOT_READY 0x02
  318. #define HAL_PAN_STATUS_NO_MEMORY 0x03
  319. #define HAL_PAN_STATUS_BUSY 0x04
  320. #define HAL_PAN_STATUS_DONE 0x05
  321. #define HAL_PAN_STATUS_UNSUPORTED 0x06
  322. #define HAL_PAN_STATUS_INVAL 0x07
  323. #define HAL_PAN_STATUS_UNHANDLED 0x08
  324. #define HAL_PAN_STATUS_AUTH_FAILED 0x09
  325. #define HAL_PAN_STATUS_DEVICE_DOWN 0x0A
  326. #define HAL_OP_PAN_ENABLE 0x01
  327. struct hal_cmd_pan_enable {
  328. uint8_t local_role;
  329. } __attribute__((packed));
  330. #define HAL_OP_PAN_GET_ROLE 0x02
  331. struct hal_rsp_pan_get_role {
  332. uint8_t local_role;
  333. } __attribute__((packed));
  334. #define HAL_OP_PAN_CONNECT 0x03
  335. struct hal_cmd_pan_connect {
  336. uint8_t bdaddr[6];
  337. uint8_t local_role;
  338. uint8_t remote_role;
  339. } __attribute__((packed));
  340. #define HAL_OP_PAN_DISCONNECT 0x04
  341. struct hal_cmd_pan_disconnect {
  342. uint8_t bdaddr[6];
  343. } __attribute__((packed));
  344. #define HAL_HEALTH_MDEP_ROLE_SOURCE 0x00
  345. #define HAL_HEALTH_MDEP_ROLE_SINK 0x01
  346. #define HAL_HEALTH_CHANNEL_TYPE_RELIABLE 0x00
  347. #define HAL_HEALTH_CHANNEL_TYPE_STREAMING 0x01
  348. #define HAL_HEALTH_CHANNEL_TYPE_ANY 0x02
  349. #define HAL_OP_HEALTH_REG_APP 0x01
  350. struct hal_cmd_health_reg_app {
  351. uint8_t num_of_mdep;
  352. uint16_t app_name_off;
  353. uint16_t provider_name_off;
  354. uint16_t service_name_off;
  355. uint16_t service_descr_off;
  356. uint16_t len;
  357. uint8_t data[0];
  358. } __attribute__((packed));
  359. struct hal_rsp_health_reg_app {
  360. uint16_t app_id;
  361. } __attribute__((packed));
  362. #define HAL_OP_HEALTH_MDEP 0x02
  363. struct hal_cmd_health_mdep {
  364. uint16_t app_id;
  365. uint8_t role;
  366. uint16_t data_type;
  367. uint8_t channel_type;
  368. uint16_t descr_len;
  369. uint8_t descr[0];
  370. } __attribute__((packed));
  371. #define HAL_OP_HEALTH_UNREG_APP 0x03
  372. struct hal_cmd_health_unreg_app {
  373. uint16_t app_id;
  374. } __attribute__((packed));
  375. #define HAL_OP_HEALTH_CONNECT_CHANNEL 0x04
  376. struct hal_cmd_health_connect_channel {
  377. uint16_t app_id;
  378. uint8_t bdaddr[6];
  379. uint8_t mdep_index;
  380. } __attribute__((packed));
  381. struct hal_rsp_health_connect_channel {
  382. uint16_t channel_id;
  383. } __attribute__((packed));
  384. #define HAL_OP_HEALTH_DESTROY_CHANNEL 0x05
  385. struct hal_cmd_health_destroy_channel {
  386. uint16_t channel_id;
  387. } __attribute__((packed));
  388. /* Handsfree HAL API */
  389. #define HAL_MODE_HANDSFREE_HSP_ONLY HAL_MODE_DEFAULT
  390. #define HAL_MODE_HANDSFREE_HFP 0x01
  391. #define HAL_MODE_HANDSFREE_HFP_WBS 0x02
  392. #define HAL_OP_HANDSFREE_CONNECT 0x01
  393. struct hal_cmd_handsfree_connect {
  394. uint8_t bdaddr[6];
  395. } __attribute__((packed));
  396. #define HAL_OP_HANDSFREE_DISCONNECT 0x02
  397. struct hal_cmd_handsfree_disconnect {
  398. uint8_t bdaddr[6];
  399. } __attribute__((packed));
  400. #define HAL_OP_HANDSFREE_CONNECT_AUDIO 0x03
  401. struct hal_cmd_handsfree_connect_audio {
  402. uint8_t bdaddr[6];
  403. } __attribute__((packed));
  404. #define HAL_OP_HANDSFREE_DISCONNECT_AUDIO 0x04
  405. struct hal_cmd_handsfree_disconnect_audio {
  406. uint8_t bdaddr[6];
  407. } __attribute__((packed));
  408. #define HAL_OP_HANDSFREE_START_VR 0x05
  409. struct hal_cmd_handsfree_start_vr {
  410. uint8_t bdaddr[6];
  411. } __attribute__((packed));
  412. #define HAL_OP_HANDSFREE_STOP_VR 0x06
  413. struct hal_cmd_handsfree_stop_vr {
  414. uint8_t bdaddr[6];
  415. } __attribute__((packed));
  416. #define HAL_HANDSFREE_VOLUME_TYPE_SPEAKER 0x00
  417. #define HAL_HANDSFREE_VOLUME_TYPE_MIC 0x01
  418. #define HAL_OP_HANDSFREE_VOLUME_CONTROL 0x07
  419. struct hal_cmd_handsfree_volume_control {
  420. uint8_t type;
  421. uint8_t volume;
  422. uint8_t bdaddr[6];
  423. } __attribute__((packed));
  424. #define HAL_HANDSFREE_NETWORK_STATE_NOT_AVAILABLE 0x00
  425. #define HAL_HANDSFREE_NETWORK_STATE_AVAILABLE 0x01
  426. #define HAL_HANDSFREE_SERVICE_TYPE_HOME 0x00
  427. #define HAL_HANDSFREE_SERVICE_TYPE_ROAMING 0x01
  428. #define HAL_OP_HANDSFREE_DEVICE_STATUS_NOTIF 0x08
  429. struct hal_cmd_handsfree_device_status_notif {
  430. uint8_t state;
  431. uint8_t type;
  432. uint8_t signal;
  433. uint8_t battery;
  434. } __attribute__((packed));
  435. #define HAL_OP_HANDSFREE_COPS_RESPONSE 0x09
  436. struct hal_cmd_handsfree_cops_response {
  437. uint16_t len;
  438. uint8_t bdaddr[6];
  439. uint8_t buf[0];
  440. } __attribute__((packed));
  441. #define HAL_HANDSFREE_CALL_STATE_ACTIVE 0x00
  442. #define HAL_HANDSFREE_CALL_STATE_HELD 0x01
  443. #define HAL_HANDSFREE_CALL_STATE_DIALING 0x02
  444. #define HAL_HANDSFREE_CALL_STATE_ALERTING 0x03
  445. #define HAL_HANDSFREE_CALL_STATE_INCOMING 0x04
  446. #define HAL_HANDSFREE_CALL_STATE_WAITING 0x05
  447. #define HAL_HANDSFREE_CALL_STATE_IDLE 0x06
  448. #define HAL_OP_HANDSFREE_CIND_RESPONSE 0x0A
  449. struct hal_cmd_handsfree_cind_response {
  450. uint8_t svc;
  451. uint8_t num_active;
  452. uint8_t num_held;
  453. uint8_t state;
  454. uint8_t signal;
  455. uint8_t roam;
  456. uint8_t batt_chg;
  457. uint8_t bdaddr[6];
  458. } __attribute__((packed));
  459. #define HAL_OP_HANDSFREE_FORMATTED_AT_RESPONSE 0x0B
  460. struct hal_cmd_handsfree_formatted_at_response {
  461. uint16_t len;
  462. uint8_t bdaddr[6];
  463. uint8_t buf[0];
  464. } __attribute__((packed));
  465. #define HAL_HANDSFREE_AT_RESPONSE_ERROR 0x00
  466. #define HAL_HANDSFREE_AT_RESPONSE_OK 0x01
  467. #define HAL_OP_HANDSFREE_AT_RESPONSE 0x0C
  468. struct hal_cmd_handsfree_at_response {
  469. uint8_t response;
  470. uint8_t error;
  471. uint8_t bdaddr[6];
  472. } __attribute__((packed));
  473. #define HAL_HANDSFREE_CALL_DIRECTION_OUTGOING 0x00
  474. #define HAL_HANDSFREE_CALL_DIRECTION_INCOMING 0x01
  475. #define HAL_HANDSFREE_CALL_TYPE_VOICE 0x00
  476. #define HAL_HANDSFREE_CALL_TYPE_DATA 0x01
  477. #define HAL_HANDSFREE_CALL_TYPE_FAX 0x02
  478. #define HAL_HANDSFREE_CALL_MPTY_TYPE_SINGLE 0x00
  479. #define HAL_HANDSFREE_CALL_MPTY_TYPE_MULTI 0x01
  480. #define HAL_HANDSFREE_CALL_ADDRTYPE_UNKNOWN 0x81
  481. #define HAL_HANDSFREE_CALL_ADDRTYPE_INTERNATIONAL 0x91
  482. #define HAL_OP_HANDSFREE_CLCC_RESPONSE 0x0D
  483. struct hal_cmd_handsfree_clcc_response {
  484. uint8_t index;
  485. uint8_t dir;
  486. uint8_t state;
  487. uint8_t mode;
  488. uint8_t mpty;
  489. uint8_t type;
  490. uint8_t bdaddr[6];
  491. uint16_t number_len;
  492. uint8_t number[0];
  493. } __attribute__((packed));
  494. #define HAL_OP_HANDSFREE_PHONE_STATE_CHANGE 0x0E
  495. struct hal_cmd_handsfree_phone_state_change {
  496. uint8_t num_active;
  497. uint8_t num_held;
  498. uint8_t state;
  499. uint8_t type;
  500. uint16_t number_len;
  501. uint8_t number[0];
  502. } __attribute__((packed));
  503. #define HAL_HANDSFREE_WBS_NONE 0x00
  504. #define HAL_HANDSFREE_WBS_NO 0x01
  505. #define HAL_HANDSFREE_WBS_YES 0x02
  506. #define HAL_OP_HANDSFREE_CONFIGURE_WBS 0x0F
  507. struct hal_cmd_handsfree_configure_wbs {
  508. uint8_t bdaddr[6];
  509. uint8_t config;
  510. } __attribute__((packed));
  511. /* AVRCP TARGET HAL API */
  512. #define HAL_AVRCP_PLAY_STATUS_STOPPED 0x00
  513. #define HAL_AVRCP_PLAY_STATUS_PLAYING 0x01
  514. #define HAL_AVRCP_PLAY_STATUS_PAUSED 0x02
  515. #define HAL_AVRCP_PLAY_STATUS_FWD_SEEK 0x03
  516. #define HAL_AVRCP_PLAY_STATUS_REV_SEEK 0x04
  517. #define HAL_AVRCP_PLAY_STATUS_ERROR 0xff
  518. #define HAL_OP_AVRCP_GET_PLAY_STATUS 0x01
  519. struct hal_cmd_avrcp_get_play_status {
  520. uint8_t status;
  521. uint32_t duration;
  522. uint32_t position;
  523. } __attribute__((packed));
  524. #define HAL_AVRCP_PLAYER_ATTR_EQUALIZER 0x01
  525. #define HAL_AVRCP_PLAYER_ATTR_REPEAT 0x02
  526. #define HAL_AVRCP_PLAYER_ATTR_SHUFFLE 0x03
  527. #define HAL_AVRCP_PLAYER_ATTR_SCAN 0x04
  528. #define HAL_OP_AVRCP_LIST_PLAYER_ATTRS 0x02
  529. struct hal_cmd_avrcp_list_player_attrs {
  530. uint8_t number;
  531. uint8_t attrs[0];
  532. } __attribute__((packed));
  533. #define HAL_OP_AVRCP_LIST_PLAYER_VALUES 0x03
  534. struct hal_cmd_avrcp_list_player_values {
  535. uint8_t number;
  536. uint8_t values[0];
  537. } __attribute__((packed));
  538. struct hal_avrcp_player_attr_value {
  539. uint8_t attr;
  540. uint8_t value;
  541. } __attribute__((packed));
  542. #define HAL_OP_AVRCP_GET_PLAYER_ATTRS 0x04
  543. struct hal_cmd_avrcp_get_player_attrs {
  544. uint8_t number;
  545. struct hal_avrcp_player_attr_value attrs[0];
  546. } __attribute__((packed));
  547. struct hal_avrcp_player_setting_text {
  548. uint8_t id;
  549. uint8_t len;
  550. uint8_t text[0];
  551. } __attribute__((packed));
  552. #define HAL_OP_AVRCP_GET_PLAYER_ATTRS_TEXT 0x05
  553. struct hal_cmd_avrcp_get_player_attrs_text {
  554. uint8_t number;
  555. struct hal_avrcp_player_setting_text attrs[0];
  556. } __attribute__((packed));
  557. #define HAL_OP_AVRCP_GET_PLAYER_VALUES_TEXT 0x06
  558. struct hal_cmd_avrcp_get_player_values_text {
  559. uint8_t number;
  560. struct hal_avrcp_player_setting_text values[0];
  561. } __attribute__((packed));
  562. #define HAL_AVRCP_MEDIA_ATTR_TITLE 0x01
  563. #define HAL_AVRCP_MEDIA_ATTR_ARTIST 0x02
  564. #define HAL_AVRCP_MEDIA_ATTR_ALBUM 0x03
  565. #define HAL_AVRCP_MEDIA_ATTR_TRACK_NUM 0x04
  566. #define HAL_AVRCP_MEDIA_ATTR_NUM_TRACKS 0x05
  567. #define HAL_AVRCP_MEDIA_ATTR_GENRE 0x06
  568. #define HAL_AVRCP_MEDIA_ATTR_DURATION 0x07
  569. #define HAL_OP_AVRCP_GET_ELEMENT_ATTRS_TEXT 0x07
  570. struct hal_cmd_avrcp_get_element_attrs_text {
  571. uint8_t number;
  572. struct hal_avrcp_player_setting_text values[0];
  573. } __attribute__((packed));
  574. #define HAL_OP_AVRCP_SET_PLAYER_ATTRS_VALUE 0x08
  575. struct hal_cmd_avrcp_set_player_attrs_value {
  576. uint8_t status;
  577. } __attribute__((packed));
  578. #define HAL_AVRCP_EVENT_STATUS_CHANGED 0x01
  579. #define HAL_AVRCP_EVENT_TRACK_CHANGED 0x02
  580. #define HAL_AVRCP_EVENT_TRACK_REACHED_END 0x03
  581. #define HAL_AVRCP_EVENT_TRACK_REACHED_START 0x04
  582. #define HAL_AVRCP_EVENT_POSITION_CHANGED 0x05
  583. #define HAL_AVRCP_EVENT_SETTING_CHANGED 0x08
  584. #define HAL_AVRCP_EVENT_TYPE_INTERIM 0x00
  585. #define HAL_AVRCP_EVENT_TYPE_CHANGED 0x01
  586. #define HAL_OP_AVRCP_REGISTER_NOTIFICATION 0x09
  587. struct hal_cmd_avrcp_register_notification {
  588. uint8_t event;
  589. uint8_t type;
  590. uint8_t len;
  591. uint8_t data[0];
  592. } __attribute__((packed));
  593. #define HAL_OP_AVRCP_SET_VOLUME 0x0a
  594. struct hal_cmd_avrcp_set_volume {
  595. uint8_t value;
  596. } __attribute__((packed));
  597. /* AVRCP CTRL HAL API */
  598. #define HAL_OP_AVRCP_CTRL_SEND_PASSTHROUGH 0x01
  599. struct hal_cmd_avrcp_ctrl_send_passthrough {
  600. uint8_t bdaddr[6];
  601. uint8_t key_code;
  602. uint8_t key_state;
  603. } __attribute__((packed));
  604. /* GATT HAL API */
  605. #define HAL_OP_GATT_CLIENT_REGISTER 0x01
  606. struct hal_cmd_gatt_client_register {
  607. uint8_t uuid[16];
  608. } __attribute__((packed));
  609. #define HAL_OP_GATT_CLIENT_UNREGISTER 0x02
  610. struct hal_cmd_gatt_client_unregister {
  611. int32_t client_if;
  612. } __attribute__((packed));
  613. #define HAL_OP_GATT_CLIENT_SCAN 0x03
  614. struct hal_cmd_gatt_client_scan {
  615. int32_t client_if;
  616. uint8_t start;
  617. } __attribute__((packed));
  618. #define HAL_OP_GATT_CLIENT_CONNECT 0x04
  619. struct hal_cmd_gatt_client_connect {
  620. int32_t client_if;
  621. uint8_t bdaddr[6];
  622. uint8_t is_direct;
  623. int32_t transport;
  624. } __attribute__((packed));
  625. #define HAL_OP_GATT_CLIENT_DISCONNECT 0x05
  626. struct hal_cmd_gatt_client_disconnect {
  627. int32_t client_if;
  628. uint8_t bdaddr[6];
  629. int32_t conn_id;
  630. } __attribute__((packed));
  631. #define HAL_OP_GATT_CLIENT_LISTEN 0x06
  632. struct hal_cmd_gatt_client_listen {
  633. int32_t client_if;
  634. uint8_t start;
  635. } __attribute__((packed));
  636. #define HAL_OP_GATT_CLIENT_REFRESH 0x07
  637. struct hal_cmd_gatt_client_refresh {
  638. int32_t client_if;
  639. uint8_t bdaddr[6];
  640. } __attribute__((packed));
  641. #define HAL_OP_GATT_CLIENT_SEARCH_SERVICE 0x08
  642. struct hal_cmd_gatt_client_search_service {
  643. int32_t conn_id;
  644. uint8_t filtered;
  645. uint8_t filter_uuid[0];
  646. } __attribute__((packed));
  647. #define HAL_OP_GATT_CLIENT_GET_INCLUDED_SERVICE 0x09
  648. struct hal_gatt_srvc_id {
  649. uint8_t uuid[16];
  650. uint8_t inst_id;
  651. uint8_t is_primary;
  652. } __attribute__((packed));
  653. struct hal_cmd_gatt_client_get_included_service {
  654. int32_t conn_id;
  655. struct hal_gatt_srvc_id srvc_id;
  656. uint8_t continuation;
  657. struct hal_gatt_srvc_id incl_srvc_id[0];
  658. } __attribute__((packed));
  659. #define HAL_OP_GATT_CLIENT_GET_CHARACTERISTIC 0x0a
  660. struct hal_gatt_gatt_id {
  661. uint8_t uuid[16];
  662. uint8_t inst_id;
  663. } __attribute__((packed));
  664. struct hal_cmd_gatt_client_get_characteristic {
  665. int32_t conn_id;
  666. struct hal_gatt_srvc_id srvc_id;
  667. uint8_t continuation;
  668. struct hal_gatt_gatt_id char_id[0];
  669. } __attribute__((packed));
  670. #define HAL_OP_GATT_CLIENT_GET_DESCRIPTOR 0x0b
  671. struct hal_cmd_gatt_client_get_descriptor {
  672. int32_t conn_id;
  673. struct hal_gatt_srvc_id srvc_id;
  674. struct hal_gatt_gatt_id char_id;
  675. uint8_t continuation;
  676. struct hal_gatt_gatt_id descr_id[0];
  677. } __attribute__((packed));
  678. #define HAL_OP_GATT_CLIENT_READ_CHARACTERISTIC 0x0c
  679. struct hal_cmd_gatt_client_read_characteristic {
  680. int32_t conn_id;
  681. struct hal_gatt_srvc_id srvc_id;
  682. struct hal_gatt_gatt_id char_id;
  683. int32_t auth_req;
  684. } __attribute__((packed));
  685. #define GATT_WRITE_TYPE_NO_RESPONSE 0x01
  686. #define GATT_WRITE_TYPE_DEFAULT 0x02
  687. #define GATT_WRITE_TYPE_PREPARE 0x03
  688. #define GATT_WRITE_TYPE_SIGNED 0x04
  689. #define HAL_OP_GATT_CLIENT_WRITE_CHARACTERISTIC 0x0d
  690. struct hal_cmd_gatt_client_write_characteristic {
  691. int32_t conn_id;
  692. struct hal_gatt_srvc_id srvc_id;
  693. struct hal_gatt_gatt_id char_id;
  694. int32_t write_type;
  695. int32_t len;
  696. int32_t auth_req;
  697. uint8_t value[0];
  698. } __attribute__((packed));
  699. #define HAL_OP_GATT_CLIENT_READ_DESCRIPTOR 0x0e
  700. struct hal_cmd_gatt_client_read_descriptor {
  701. int32_t conn_id;
  702. struct hal_gatt_srvc_id srvc_id;
  703. struct hal_gatt_gatt_id char_id;
  704. struct hal_gatt_gatt_id descr_id;
  705. int32_t auth_req;
  706. } __attribute__((packed));
  707. #define HAL_OP_GATT_CLIENT_WRITE_DESCRIPTOR 0x0f
  708. struct hal_cmd_gatt_client_write_descriptor {
  709. int32_t conn_id;
  710. struct hal_gatt_srvc_id srvc_id;
  711. struct hal_gatt_gatt_id char_id;
  712. struct hal_gatt_gatt_id descr_id;
  713. int32_t write_type;
  714. int32_t len;
  715. int32_t auth_req;
  716. uint8_t value[0];
  717. } __attribute__((packed));
  718. #define HAL_OP_GATT_CLIENT_EXECUTE_WRITE 0x10
  719. struct hal_cmd_gatt_client_execute_write {
  720. int32_t conn_id;
  721. int32_t execute;
  722. } __attribute__((packed));
  723. #define HAL_OP_GATT_CLIENT_REGISTER_FOR_NOTIFICATION 0x11
  724. struct hal_cmd_gatt_client_register_for_notification {
  725. int32_t client_if;
  726. uint8_t bdaddr[6];
  727. struct hal_gatt_srvc_id srvc_id;
  728. struct hal_gatt_gatt_id char_id;
  729. } __attribute__((packed));
  730. #define HAL_OP_GATT_CLIENT_DEREGISTER_FOR_NOTIFICATION 0x12
  731. struct hal_cmd_gatt_client_deregister_for_notification {
  732. int32_t client_if;
  733. uint8_t bdaddr[6];
  734. struct hal_gatt_srvc_id srvc_id;
  735. struct hal_gatt_gatt_id char_id;
  736. } __attribute__((packed));
  737. #define HAL_OP_GATT_CLIENT_READ_REMOTE_RSSI 0x13
  738. struct hal_cmd_gatt_client_read_remote_rssi {
  739. int32_t client_if;
  740. uint8_t bdaddr[6];
  741. } __attribute__((packed));
  742. #define HAL_OP_GATT_CLIENT_GET_DEVICE_TYPE 0x14
  743. struct hal_cmd_gatt_client_get_device_type {
  744. uint8_t bdaddr[6];
  745. } __attribute__((packed));
  746. struct hal_rsp_gatt_client_get_device_type {
  747. uint8_t type;
  748. } __attribute__((packed));
  749. #define HAL_OP_GATT_CLIENT_SET_ADV_DATA 0x015
  750. struct hal_cmd_gatt_client_set_adv_data {
  751. int32_t server_if;
  752. uint8_t set_scan_rsp;
  753. uint8_t include_name;
  754. uint8_t include_txpower;
  755. int32_t min_interval;
  756. int32_t max_interval;
  757. int32_t appearance;
  758. uint16_t manufacturer_len;
  759. uint16_t service_data_len;
  760. uint16_t service_uuid_len;
  761. uint8_t data[0];
  762. } __attribute__((packed));
  763. #define GATT_CLIENT_TEST_CMD_ENABLE 0x01
  764. #define GATT_CLIENT_TEST_CMD_CONNECT 0x02
  765. #define GATT_CLIENT_TEST_CMD_DISCONNECT 0x03
  766. #define GATT_CLIENT_TEST_CMD_DISCOVER 0x04
  767. #define GATT_CLIENT_TEST_CMD_READ 0xe0
  768. #define GATT_CLIENT_TEST_CMD_WRITE 0xe1
  769. #define GATT_CLIENT_TEST_CMD_INCREASE_SECURITY 0xe2
  770. #define GATT_CLIENT_TEST_CMD_PAIRING_CONFIG 0xf0
  771. #define HAL_OP_GATT_CLIENT_TEST_COMMAND 0x16
  772. struct hal_cmd_gatt_client_test_command {
  773. int32_t command;
  774. uint8_t bda1[6];
  775. uint8_t uuid1[16];
  776. uint16_t u1;
  777. uint16_t u2;
  778. uint16_t u3;
  779. uint16_t u4;
  780. uint16_t u5;
  781. } __attribute__((packed));
  782. #define HAL_OP_GATT_SERVER_REGISTER 0x17
  783. struct hal_cmd_gatt_server_register {
  784. uint8_t uuid[16];
  785. } __attribute__((packed));
  786. #define HAL_OP_GATT_SERVER_UNREGISTER 0x18
  787. struct hal_cmd_gatt_server_unregister {
  788. int32_t server_if;
  789. } __attribute__((packed));
  790. #define HAL_OP_GATT_SERVER_CONNECT 0x19
  791. struct hal_cmd_gatt_server_connect {
  792. int32_t server_if;
  793. uint8_t bdaddr[6];
  794. uint8_t is_direct;
  795. int32_t transport;
  796. } __attribute__((packed));
  797. #define HAL_OP_GATT_SERVER_DISCONNECT 0x1a
  798. struct hal_cmd_gatt_server_disconnect {
  799. int32_t server_if;
  800. uint8_t bdaddr[6];
  801. int32_t conn_id;
  802. } __attribute__((packed));
  803. #define HAL_OP_GATT_SERVER_ADD_SERVICE 0x1b
  804. struct hal_cmd_gatt_server_add_service {
  805. int32_t server_if;
  806. struct hal_gatt_srvc_id srvc_id;
  807. int32_t num_handles;
  808. } __attribute__((packed));
  809. #define HAL_OP_GATT_SERVER_ADD_INC_SERVICE 0x1c
  810. struct hal_cmd_gatt_server_add_inc_service {
  811. int32_t server_if;
  812. int32_t service_handle;
  813. int32_t included_handle;
  814. } __attribute__((packed));
  815. #define HAL_OP_GATT_SERVER_ADD_CHARACTERISTIC 0x1d
  816. struct hal_cmd_gatt_server_add_characteristic {
  817. int32_t server_if;
  818. int32_t service_handle;
  819. uint8_t uuid[16];
  820. int32_t properties;
  821. int32_t permissions;
  822. } __attribute__((packed));
  823. #define HAL_OP_GATT_SERVER_ADD_DESCRIPTOR 0x1e
  824. struct hal_cmd_gatt_server_add_descriptor {
  825. int32_t server_if;
  826. int32_t service_handle;
  827. uint8_t uuid[16];
  828. int32_t permissions;
  829. } __attribute__((packed));
  830. #define GATT_SERVER_TRANSPORT_LE_BIT 0x01
  831. #define GATT_SERVER_TRANSPORT_BREDR_BIT 0x02
  832. #define HAL_OP_GATT_SERVER_START_SERVICE 0x1f
  833. struct hal_cmd_gatt_server_start_service {
  834. int32_t server_if;
  835. int32_t service_handle;
  836. int32_t transport;
  837. } __attribute__((packed));
  838. #define HAL_OP_GATT_SERVER_STOP_SERVICE 0x20
  839. struct hal_cmd_gatt_server_stop_service {
  840. int32_t server_if;
  841. int32_t service_handle;
  842. } __attribute__((packed));
  843. #define HAL_OP_GATT_SERVER_DELETE_SERVICE 0x21
  844. struct hal_cmd_gatt_server_delete_service {
  845. int32_t server_if;
  846. int32_t service_handle;
  847. } __attribute__((packed));
  848. #define HAL_OP_GATT_SERVER_SEND_INDICATION 0x22
  849. struct hal_cmd_gatt_server_send_indication {
  850. int32_t server_if;
  851. int32_t attribute_handle;
  852. int32_t conn_id;
  853. int32_t len;
  854. int32_t confirm;
  855. uint8_t value[0];
  856. } __attribute__((packed));
  857. #define HAL_OP_GATT_SERVER_SEND_RESPONSE 0x23
  858. struct hal_cmd_gatt_server_send_response {
  859. int32_t conn_id;
  860. int32_t trans_id;
  861. uint16_t handle;
  862. uint16_t offset;
  863. uint8_t auth_req;
  864. int32_t status;
  865. uint16_t len;
  866. uint8_t data[0];
  867. } __attribute__((packed));
  868. #define HAL_OP_GATT_CLIENT_SCAN_FILTER_SETUP 0x024
  869. struct hal_cmd_gatt_client_scan_filter_setup {
  870. int32_t client_if;
  871. int32_t action;
  872. int32_t filter_index;
  873. int32_t features;
  874. int32_t list_type;
  875. int32_t filter_type;
  876. int32_t rssi_hi;
  877. int32_t rssi_lo;
  878. int32_t delivery_mode;
  879. int32_t found_timeout;
  880. int32_t lost_timeout;
  881. int32_t found_timeout_cnt;
  882. } __attribute__((packed));
  883. #define HAL_OP_GATT_CLIENT_SCAN_FILTER_ADD_REMOVE 0x025
  884. struct hal_cmd_gatt_client_scan_filter_add_remove {
  885. int32_t client_if;
  886. int32_t action;
  887. int32_t filter_type;
  888. int32_t filter_index;
  889. int32_t company_id;
  890. int32_t company_id_mask;
  891. uint8_t uuid[16];
  892. uint8_t uuid_mask[16];
  893. uint8_t address[6];
  894. uint8_t address_type;
  895. int32_t data_len;
  896. int32_t mask_len;
  897. uint8_t data_mask[0]; /* common buffer for data and mask */
  898. } __attribute__((packed));
  899. #define HAL_OP_GATT_CLIENT_SCAN_FILTER_CLEAR 0x26
  900. struct hal_cmd_gatt_client_scan_filter_clear {
  901. int32_t client_if;
  902. int32_t index;
  903. } __attribute__((packed));
  904. #define HAL_OP_GATT_CLIENT_SCAN_FILTER_ENABLE 0x27
  905. struct hal_cmd_gatt_client_scan_filter_enable {
  906. int32_t client_if;
  907. uint8_t enable;
  908. } __attribute__((packed));
  909. #define HAL_OP_GATT_CLIENT_CONFIGURE_MTU 0x28
  910. struct hal_cmd_gatt_client_configure_mtu {
  911. int32_t conn_id;
  912. int32_t mtu;
  913. } __attribute__((packed));
  914. #define HAL_OP_GATT_CLIENT_CONN_PARAM_UPDATE 0x29
  915. struct hal_cmd_gatt_client_conn_param_update {
  916. uint8_t address[6];
  917. int32_t min_interval;
  918. int32_t max_interval;
  919. int32_t latency;
  920. int32_t timeout;
  921. } __attribute__((packed));
  922. #define HAL_OP_GATT_CLIENT_SET_SCAN_PARAM 0x2a
  923. struct hal_cmd_gatt_client_set_scan_param {
  924. int32_t interval;
  925. int32_t window;
  926. } __attribute__((packed));
  927. #define HAL_OP_GATT_CLIENT_SETUP_MULTI_ADV 0x2b
  928. struct hal_cmd_gatt_client_setup_multi_adv {
  929. int32_t client_if;
  930. int32_t min_interval;
  931. int32_t max_interval;
  932. int32_t type;
  933. int32_t channel_map;
  934. int32_t tx_power;
  935. int32_t timeout;
  936. } __attribute__((packed));
  937. #define HAL_OP_GATT_CLIENT_UPDATE_MULTI_ADV 0x2c
  938. struct hal_cmd_gatt_client_update_multi_adv {
  939. int32_t client_if;
  940. int32_t min_interval;
  941. int32_t max_interval;
  942. int32_t type;
  943. int32_t channel_map;
  944. int32_t tx_power;
  945. int32_t timeout;
  946. } __attribute__((packed));
  947. #define HAL_OP_GATT_CLIENT_SETUP_MULTI_ADV_INST 0x2d
  948. struct hal_cmd_gatt_client_setup_multi_adv_inst {
  949. int32_t client_if;
  950. uint8_t set_scan_rsp;
  951. uint8_t include_name;
  952. uint8_t include_tx_power;
  953. int32_t appearance;
  954. int32_t manufacturer_data_len;
  955. int32_t service_data_len;
  956. int32_t service_uuid_len;
  957. uint8_t data_service_uuid[0];
  958. } __attribute__((packed));
  959. #define HAL_OP_GATT_CLIENT_DISABLE_MULTI_ADV_INST 0x2e
  960. struct hal_cmd_gatt_client_disable_multi_adv_inst {
  961. int32_t client_if;
  962. } __attribute__((packed));
  963. #define HAL_OP_GATT_CLIENT_CONFIGURE_BATCHSCAN 0x2f
  964. struct hal_cmd_gatt_client_configure_batchscan {
  965. int32_t client_if;
  966. int32_t full_max;
  967. int32_t trunc_max;
  968. int32_t notify_threshold;
  969. } __attribute__((packed));
  970. #define HAL_OP_GATT_CLIENT_ENABLE_BATCHSCAN 0x30
  971. struct hal_cmd_gatt_client_enable_batchscan {
  972. int32_t client_if;
  973. int32_t mode;
  974. int32_t interval;
  975. int32_t window;
  976. int32_t address_type;
  977. int32_t discard_rule;
  978. } __attribute__((packed));
  979. #define HAL_OP_GATT_CLIENT_DISABLE_BATCHSCAN 0x31
  980. struct hal_cmd_gatt_client_disable_batchscan {
  981. int32_t client_if;
  982. } __attribute__((packed));
  983. #define HAL_OP_GATT_CLIENT_READ_BATCHSCAN_REPORTS 0x32
  984. struct hal_cmd_gatt_client_read_batchscan_reports {
  985. int32_t client_if;
  986. int32_t scan_mode;
  987. } __attribute__((packed));
  988. /* Handsfree client HAL API */
  989. #define HAL_OP_HF_CLIENT_CONNECT 0x01
  990. struct hal_cmd_hf_client_connect {
  991. uint8_t bdaddr[6];
  992. } __attribute__((packed));
  993. #define HAL_OP_HF_CLIENT_DISCONNECT 0x02
  994. struct hal_cmd_hf_client_disconnect {
  995. uint8_t bdaddr[6];
  996. } __attribute__((packed));
  997. #define HAL_OP_HF_CLIENT_CONNECT_AUDIO 0x03
  998. struct hal_cmd_hf_client_connect_audio {
  999. uint8_t bdaddr[6];
  1000. } __attribute__((packed));
  1001. #define HAL_OP_HF_CLIENT_DISCONNECT_AUDIO 0x04
  1002. struct hal_cmd_hf_client_disconnect_audio {
  1003. uint8_t bdaddr[6];
  1004. } __attribute__((packed));
  1005. #define HAL_OP_HF_CLIENT_START_VR 0x05
  1006. #define HAL_OP_HF_CLIENT_STOP_VR 0x06
  1007. #define HF_CLIENT_VOLUME_TYPE_SPEAKER 0x00
  1008. #define HF_CLIENT_VOLUME_TYPE_MIC 0x01
  1009. #define HAL_OP_HF_CLIENT_VOLUME_CONTROL 0x07
  1010. struct hal_cmd_hf_client_volume_control {
  1011. uint8_t type;
  1012. uint8_t volume;
  1013. } __attribute__((packed));
  1014. #define HAL_OP_HF_CLIENT_DIAL 0x08
  1015. struct hal_cmd_hf_client_dial {
  1016. uint16_t number_len;
  1017. uint8_t number[0];
  1018. } __attribute__((packed));
  1019. #define HAL_OP_HF_CLIENT_DIAL_MEMORY 0x09
  1020. struct hal_cmd_hf_client_dial_memory {
  1021. int32_t location;
  1022. } __attribute__((packed));
  1023. #define HAL_HF_CLIENT_ACTION_CHLD_0 0x00
  1024. #define HAL_HF_CLIENT_ACTION_CHLD_1 0x01
  1025. #define HAL_HF_CLIENT_ACTION_CHLD_2 0x02
  1026. #define HAL_HF_CLIENT_ACTION_CHLD_3 0x03
  1027. #define HAL_HF_CLIENT_ACTION_CHLD_4 0x04
  1028. #define HAL_HF_CLIENT_ACTION_CHLD_1x 0x05
  1029. #define HAL_HF_CLIENT_ACTION_CHLD_2x 0x06
  1030. #define HAL_HF_CLIENT_ACTION_ATA 0x07
  1031. #define HAL_HF_CLIENT_ACTION_CHUP 0x08
  1032. #define HAL_HF_CLIENT_ACTION_BRTH_0 0x09
  1033. #define HAL_HF_CLIENT_ACTION_BRTH_1 0x0a
  1034. #define HAL_HF_CLIENT_ACTION_BRTH_2 0x0b
  1035. #define HAL_OP_HF_CLIENT_CALL_ACTION 0x0a
  1036. struct hal_cmd_hf_client_call_action {
  1037. uint8_t action;
  1038. int32_t index;
  1039. } __attribute__((packed));
  1040. #define HAL_OP_HF_CLIENT_QUERY_CURRENT_CALLS 0x0b
  1041. #define HAL_OP_HF_CLIENT_QUERY_OPERATOR_NAME 0x0c
  1042. #define HAL_OP_HF_CLIENT_RETRIEVE_SUBSCR_INFO 0x0d
  1043. #define HAL_OP_HF_CLIENT_SEND_DTMF 0x0e
  1044. struct hal_cmd_hf_client_send_dtmf {
  1045. uint8_t tone;
  1046. } __attribute__((packed));
  1047. #define HAL_OP_HF_CLIENT_GET_LAST_VOICE_TAG_NUM 0x0f
  1048. /* MAP CLIENT HAL API */
  1049. #define HAL_OP_MAP_CLIENT_GET_INSTANCES 0x01
  1050. struct hal_cmd_map_client_get_instances {
  1051. uint8_t bdaddr[6];
  1052. } __attribute__((packed));
  1053. /* Notifications and confirmations */
  1054. #define HAL_POWER_OFF 0x00
  1055. #define HAL_POWER_ON 0x01
  1056. #define HAL_EV_ADAPTER_STATE_CHANGED 0x81
  1057. struct hal_ev_adapter_state_changed {
  1058. uint8_t state;
  1059. } __attribute__((packed));
  1060. #define HAL_EV_ADAPTER_PROPS_CHANGED 0x82
  1061. struct hal_property {
  1062. uint8_t type;
  1063. uint16_t len;
  1064. uint8_t val[0];
  1065. } __attribute__((packed));
  1066. struct hal_ev_adapter_props_changed {
  1067. uint8_t status;
  1068. uint8_t num_props;
  1069. struct hal_property props[0];
  1070. } __attribute__((packed));
  1071. #define HAL_EV_REMOTE_DEVICE_PROPS 0x83
  1072. struct hal_ev_remote_device_props {
  1073. uint8_t status;
  1074. uint8_t bdaddr[6];
  1075. uint8_t num_props;
  1076. struct hal_property props[0];
  1077. } __attribute__((packed));
  1078. #define HAL_EV_DEVICE_FOUND 0x84
  1079. struct hal_ev_device_found {
  1080. uint8_t num_props;
  1081. struct hal_property props[0];
  1082. } __attribute__((packed));
  1083. #define HAL_DISCOVERY_STATE_STOPPED 0x00
  1084. #define HAL_DISCOVERY_STATE_STARTED 0x01
  1085. #define HAL_EV_DISCOVERY_STATE_CHANGED 0x85
  1086. struct hal_ev_discovery_state_changed {
  1087. uint8_t state;
  1088. } __attribute__((packed));
  1089. #define HAL_EV_PIN_REQUEST 0x86
  1090. struct hal_ev_pin_request {
  1091. uint8_t bdaddr[6];
  1092. uint8_t name[249];
  1093. uint32_t class_of_dev;
  1094. } __attribute__((packed));
  1095. #define HAL_EV_SSP_REQUEST 0x87
  1096. struct hal_ev_ssp_request {
  1097. uint8_t bdaddr[6];
  1098. uint8_t name[249];
  1099. uint32_t class_of_dev;
  1100. uint8_t pairing_variant;
  1101. uint32_t passkey;
  1102. } __attribute__((packed));
  1103. #define HAL_BOND_STATE_NONE 0
  1104. #define HAL_BOND_STATE_BONDING 1
  1105. #define HAL_BOND_STATE_BONDED 2
  1106. #define HAL_EV_BOND_STATE_CHANGED 0x88
  1107. struct hal_ev_bond_state_changed {
  1108. uint8_t status;
  1109. uint8_t bdaddr[6];
  1110. uint8_t state;
  1111. } __attribute__((packed));
  1112. #define HAL_ACL_STATE_CONNECTED 0x00
  1113. #define HAL_ACL_STATE_DISCONNECTED 0x01
  1114. #define HAL_EV_ACL_STATE_CHANGED 0x89
  1115. struct hal_ev_acl_state_changed {
  1116. uint8_t status;
  1117. uint8_t bdaddr[6];
  1118. uint8_t state;
  1119. } __attribute__((packed));
  1120. #define HAL_EV_DUT_MODE_RECEIVE 0x8a
  1121. struct hal_ev_dut_mode_receive {
  1122. uint16_t opcode;
  1123. uint8_t len;
  1124. uint8_t data[0];
  1125. } __attribute__((packed));
  1126. #define HAL_EV_LE_TEST_MODE 0x8b
  1127. struct hal_ev_le_test_mode {
  1128. uint8_t status;
  1129. uint16_t num_packets;
  1130. } __attribute__((packed));
  1131. #define HAL_EV_ENERGY_INFO 0x8c
  1132. struct hal_ev_energy_info {
  1133. uint8_t status;
  1134. uint8_t ctrl_state;
  1135. uint64_t tx_time;
  1136. uint64_t rx_time;
  1137. uint64_t idle_time;
  1138. uint64_t energy_used;
  1139. } __attribute__((packed));
  1140. #define HAL_HIDHOST_STATE_CONNECTED 0x00
  1141. #define HAL_HIDHOST_STATE_CONNECTING 0x01
  1142. #define HAL_HIDHOST_STATE_DISCONNECTED 0x02
  1143. #define HAL_HIDHOST_STATE_DISCONNECTING 0x03
  1144. #define HAL_HIDHOST_STATE_NO_HID 0x07
  1145. #define HAL_HIDHOST_STATE_FAILED 0x08
  1146. #define HAL_HIDHOST_STATE_UNKNOWN 0x09
  1147. #define HAL_EV_HIDHOST_CONN_STATE 0x81
  1148. struct hal_ev_hidhost_conn_state {
  1149. uint8_t bdaddr[6];
  1150. uint8_t state;
  1151. } __attribute__((packed));
  1152. #define HAL_HIDHOST_STATUS_OK 0x00
  1153. #define HAL_HIDHOST_HS_NOT_READY 0x01
  1154. #define HAL_HIDHOST_HS_INVALID_RAPORT_ID 0x02
  1155. #define HAL_HIDHOST_HS_TRANS_NOT_SUPPORTED 0x03
  1156. #define HAL_HIDHOST_HS_INVALID_PARAM 0x04
  1157. #define HAL_HIDHOST_HS_ERROR 0x05
  1158. #define HAL_HIDHOST_GENERAL_ERROR 0x06
  1159. #define HAL_HIDHOST_SDP_ERROR 0x07
  1160. #define HAL_HIDHOST_PROTOCOL_ERROR 0x08
  1161. #define HAL_HIDHOST_DB_ERROR 0x09
  1162. #define HAL_HIDHOST_TOD_UNSUPPORTED_ERROR 0x0a
  1163. #define HAL_HIDHOST_NO_RESOURCES_ERROR 0x0b
  1164. #define HAL_HIDHOST_AUTH_FAILED_ERROR 0x0c
  1165. #define HAL_HIDHOST_HDL_ERROR 0x0d
  1166. #define HAL_EV_HIDHOST_INFO 0x82
  1167. struct hal_ev_hidhost_info {
  1168. uint8_t bdaddr[6];
  1169. uint8_t attr;
  1170. uint8_t subclass;
  1171. uint8_t app_id;
  1172. uint16_t vendor;
  1173. uint16_t product;
  1174. uint16_t version;
  1175. uint8_t country;
  1176. uint16_t descr_len;
  1177. uint8_t descr[884];
  1178. } __attribute__((packed));
  1179. #define HAL_EV_HIDHOST_PROTO_MODE 0x83
  1180. struct hal_ev_hidhost_proto_mode {
  1181. uint8_t bdaddr[6];
  1182. uint8_t status;
  1183. uint8_t mode;
  1184. } __attribute__((packed));
  1185. #define HAL_EV_HIDHOST_IDLE_TIME 0x84
  1186. struct hal_ev_hidhost_idle_time {
  1187. uint8_t bdaddr[6];
  1188. uint8_t status;
  1189. uint32_t idle_rate;
  1190. } __attribute__((packed));
  1191. #define HAL_EV_HIDHOST_GET_REPORT 0x85
  1192. struct hal_ev_hidhost_get_report {
  1193. uint8_t bdaddr[6];
  1194. uint8_t status;
  1195. uint16_t len;
  1196. uint8_t data[0];
  1197. } __attribute__((packed));
  1198. #define HAL_EV_HIDHOST_VIRTUAL_UNPLUG 0x86
  1199. struct hal_ev_hidhost_virtual_unplug {
  1200. uint8_t bdaddr[6];
  1201. uint8_t status;
  1202. } __attribute__((packed));
  1203. #define HAL_EV_HIDHOST_HANDSHAKE 0x87
  1204. struct hal_ev_hidhost_handshake {
  1205. uint8_t bdaddr[6];
  1206. uint8_t status;
  1207. } __attribute__((packed));
  1208. #define HAL_EV_PAN_CTRL_STATE 0x81
  1209. struct hal_ev_pan_ctrl_state {
  1210. uint8_t state;
  1211. uint8_t status;
  1212. uint8_t local_role;
  1213. uint8_t name[17];
  1214. } __attribute__((packed));
  1215. #define HAL_EV_PAN_CONN_STATE 0x82
  1216. struct hal_ev_pan_conn_state {
  1217. uint8_t state;
  1218. uint8_t status;
  1219. uint8_t bdaddr[6];
  1220. uint8_t local_role;
  1221. uint8_t remote_role;
  1222. } __attribute__((packed));
  1223. #define HAL_HEALTH_APP_REG_SUCCESS 0x00
  1224. #define HAL_HEALTH_APP_REG_FAILED 0x01
  1225. #define HAL_HEALTH_APP_DEREG_SUCCESS 0x02
  1226. #define HAL_HEALTH_APP_DEREG_FAILED 0x03
  1227. #define HAL_HEALTH_CHANNEL_CONNECTING 0x00
  1228. #define HAL_HEALTH_CHANNEL_CONNECTED 0x01
  1229. #define HAL_HEALTH_CHANNEL_DISCONNECTING 0x02
  1230. #define HAL_HEALTH_CHANNEL_DISCONNECTED 0x03
  1231. #define HAL_HEALTH_CHANNEL_DESTROYED 0x04
  1232. #define HAL_EV_HEALTH_APP_REG_STATE 0x81
  1233. struct hal_ev_health_app_reg_state {
  1234. uint16_t id;
  1235. uint8_t state;
  1236. } __attribute__((packed));
  1237. #define HAL_EV_HEALTH_CHANNEL_STATE 0x82
  1238. struct hal_ev_health_channel_state {
  1239. uint16_t app_id;
  1240. uint8_t bdaddr[6];
  1241. uint8_t mdep_index;
  1242. uint16_t channel_id;
  1243. uint8_t channel_state;
  1244. } __attribute__((packed));
  1245. #define HAL_A2DP_STATE_DISCONNECTED 0x00
  1246. #define HAL_A2DP_STATE_CONNECTING 0x01
  1247. #define HAL_A2DP_STATE_CONNECTED 0x02
  1248. #define HAL_A2DP_STATE_DISCONNECTING 0x03
  1249. #define HAL_EV_A2DP_CONN_STATE 0x81
  1250. struct hal_ev_a2dp_conn_state {
  1251. uint8_t state;
  1252. uint8_t bdaddr[6];
  1253. } __attribute__((packed));
  1254. #define HAL_AUDIO_SUSPEND 0x00
  1255. #define HAL_AUDIO_STOPPED 0x01
  1256. #define HAL_AUDIO_STARTED 0x02
  1257. #define HAL_EV_A2DP_AUDIO_STATE 0x82
  1258. struct hal_ev_a2dp_audio_state {
  1259. uint8_t state;
  1260. uint8_t bdaddr[6];
  1261. } __attribute__((packed));
  1262. #define HAL_EV_A2DP_AUDIO_CONFIG 0x83
  1263. struct hal_ev_a2dp_audio_config {
  1264. uint8_t bdaddr[6];
  1265. uint32_t sample_rate;
  1266. uint8_t channel_count;
  1267. } __attribute__((packed));
  1268. #define HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTED 0x00
  1269. #define HAL_EV_HANDSFREE_CONN_STATE_CONNECTING 0x01
  1270. #define HAL_EV_HANDSFREE_CONN_STATE_CONNECTED 0x02
  1271. #define HAL_EV_HANDSFREE_CONN_STATE_SLC_CONNECTED 0x03
  1272. #define HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTING 0x04
  1273. #define HAL_EV_HANDSFREE_CONN_STATE 0x81
  1274. struct hal_ev_handsfree_conn_state {
  1275. uint8_t state;
  1276. uint8_t bdaddr[6];
  1277. } __attribute__((packed));
  1278. #define HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTED 0x00
  1279. #define HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTING 0x01
  1280. #define HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTED 0x02
  1281. #define HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTING 0x03
  1282. #define HAL_EV_HANDSFREE_AUDIO_STATE 0x82
  1283. struct hal_ev_handsfree_audio_state {
  1284. uint8_t state;
  1285. uint8_t bdaddr[6];
  1286. } __attribute__((packed));
  1287. #define HAL_HANDSFREE_VR_STOPPED 0x00
  1288. #define HAL_HANDSFREE_VR_STARTED 0x01
  1289. #define HAL_EV_HANDSFREE_VR 0x83
  1290. struct hal_ev_handsfree_vr_state {
  1291. uint8_t state;
  1292. uint8_t bdaddr[6];
  1293. } __attribute__((packed));
  1294. #define HAL_EV_HANDSFREE_ANSWER 0x84
  1295. struct hal_ev_handsfree_answer {
  1296. uint8_t bdaddr[6];
  1297. } __attribute__((packed));
  1298. #define HAL_EV_HANDSFREE_HANGUP 0x85
  1299. struct hal_ev_handsfree_hangup {
  1300. uint8_t bdaddr[6];
  1301. } __attribute__((packed));
  1302. #define HAL_EV_HANDSFREE_VOLUME 0x86
  1303. struct hal_ev_handsfree_volume {
  1304. uint8_t type;
  1305. uint8_t volume;
  1306. uint8_t bdaddr[6];
  1307. } __attribute__((packed));
  1308. #define HAL_EV_HANDSFREE_DIAL 0x87
  1309. struct hal_ev_handsfree_dial {
  1310. uint8_t bdaddr[6];
  1311. uint16_t number_len;
  1312. uint8_t number[0];
  1313. } __attribute__((packed));
  1314. #define HAL_EV_HANDSFREE_DTMF 0x88
  1315. struct hal_ev_handsfree_dtmf {
  1316. uint8_t tone;
  1317. uint8_t bdaddr[6];
  1318. } __attribute__((packed));
  1319. #define HAL_HANDSFREE_NREC_STOP 0x00
  1320. #define HAL_HANDSFREE_NREC_START 0x01
  1321. #define HAL_EV_HANDSFREE_NREC 0x89
  1322. struct hal_ev_handsfree_nrec {
  1323. uint8_t nrec;
  1324. uint8_t bdaddr[6];
  1325. } __attribute__((packed));
  1326. #define HAL_HANDSFREE_CHLD_TYPE_RELEASEHELD 0x00
  1327. #define HAL_HANDSFREE_CHLD_TYPE_RELEASEACTIVE_ACCEPTHELD 0x01
  1328. #define HAL_HANDSFREE_CHLD_TYPE_HOLDACTIVE_ACCEPTHELD 0x02
  1329. #define HAL_HANDSFREE_CHLD_TYPE_ADDHELDTOCONF 0x03
  1330. #define HAL_EV_HANDSFREE_CHLD 0x8A
  1331. struct hal_ev_handsfree_chld {
  1332. uint8_t chld;
  1333. uint8_t bdaddr[6];
  1334. } __attribute__((packed));
  1335. #define HAL_EV_HANDSFREE_CNUM 0x8B
  1336. struct hal_ev_handsfree_cnum {
  1337. uint8_t bdaddr[6];
  1338. } __attribute__((packed));
  1339. #define HAL_EV_HANDSFREE_CIND 0x8C
  1340. struct hal_ev_handsfree_cind {
  1341. uint8_t bdaddr[6];
  1342. } __attribute__((packed));
  1343. #define HAL_EV_HANDSFREE_COPS 0x8D
  1344. struct hal_ev_handsfree_cops {
  1345. uint8_t bdaddr[6];
  1346. } __attribute__((packed));
  1347. #define HAL_EV_HANDSFREE_CLCC 0x8E
  1348. struct hal_ev_handsfree_clcc {
  1349. uint8_t bdaddr[6];
  1350. } __attribute__((packed));
  1351. #define HAL_EV_HANDSFREE_UNKNOWN_AT 0x8F
  1352. struct hal_ev_handsfree_unknown_at {
  1353. uint8_t bdaddr[6];
  1354. uint16_t len;
  1355. uint8_t buf[0];
  1356. } __attribute__((packed));
  1357. #define HAL_EV_HANDSFREE_HSP_KEY_PRESS 0x90
  1358. struct hal_ev_handsfree_hsp_key_press {
  1359. uint8_t bdaddr[6];
  1360. } __attribute__((packed));
  1361. #define HAL_EV_HANDSFREE_WBS 0x91
  1362. struct hal_ev_handsfree_wbs {
  1363. uint8_t wbs;
  1364. uint8_t bdaddr[6];
  1365. } __attribute__((packed));
  1366. #define HAL_AVRCP_FEATURE_NONE 0x00
  1367. #define HAL_AVRCP_FEATURE_METADATA 0x01
  1368. #define HAL_AVRCP_FEATURE_ABSOLUTE_VOLUME 0x02
  1369. #define HAL_AVRCP_FEATURE_BROWSE 0x04
  1370. #define HAL_EV_AVRCP_REMOTE_FEATURES 0x81
  1371. struct hal_ev_avrcp_remote_features {
  1372. uint8_t bdaddr[6];
  1373. uint8_t features;
  1374. } __attribute__((packed));
  1375. #define HAL_EV_AVRCP_GET_PLAY_STATUS 0x82
  1376. #define HAL_EV_AVRCP_LIST_PLAYER_ATTRS 0x83
  1377. #define HAL_EV_AVRCP_LIST_PLAYER_VALUES 0x84
  1378. struct hal_ev_avrcp_list_player_values {
  1379. uint8_t attr;
  1380. } __attribute__((packed));
  1381. #define HAL_EV_AVRCP_GET_PLAYER_VALUES 0x85
  1382. struct hal_ev_avrcp_get_player_values {
  1383. uint8_t number;
  1384. uint8_t attrs[0];
  1385. } __attribute__((packed));
  1386. #define HAL_EV_AVRCP_GET_PLAYER_ATTRS_TEXT 0x86
  1387. struct hal_ev_avrcp_get_player_attrs_text {
  1388. uint8_t number;
  1389. uint8_t attrs[0];
  1390. } __attribute__((packed));
  1391. #define HAL_EV_AVRCP_GET_PLAYER_VALUES_TEXT 0x87
  1392. struct hal_ev_avrcp_get_player_values_text {
  1393. uint8_t attr;
  1394. uint8_t number;
  1395. uint8_t values[0];
  1396. } __attribute__((packed));
  1397. #define HAL_EV_AVRCP_SET_PLAYER_VALUES 0x88
  1398. struct hal_ev_avrcp_set_player_values {
  1399. uint8_t number;
  1400. struct hal_avrcp_player_attr_value attrs[0];
  1401. } __attribute__((packed));
  1402. #define HAL_EV_AVRCP_GET_ELEMENT_ATTRS 0x89
  1403. struct hal_ev_avrcp_get_element_attrs {
  1404. uint8_t number;
  1405. uint8_t attrs[0];
  1406. } __attribute__((packed));
  1407. #define HAL_EV_AVRCP_REGISTER_NOTIFICATION 0x8a
  1408. struct hal_ev_avrcp_register_notification {
  1409. uint8_t event;
  1410. uint32_t param;
  1411. } __attribute__((packed));
  1412. #define HAL_EV_AVRCP_VOLUME_CHANGED 0x8b
  1413. struct hal_ev_avrcp_volume_changed {
  1414. uint8_t volume;
  1415. uint8_t type;
  1416. } __attribute__((packed));
  1417. #define HAL_EV_AVRCP_PASSTHROUGH_CMD 0x8c
  1418. struct hal_ev_avrcp_passthrough_cmd {
  1419. uint8_t id;
  1420. uint8_t state;
  1421. } __attribute__((packed));
  1422. #define HAL_EV_AVRCP_CTRL_CONN_STATE 0x81
  1423. struct hal_ev_avrcp_ctrl_conn_state {
  1424. uint8_t state;
  1425. uint8_t bdaddr[6];
  1426. } __attribute__((packed));
  1427. #define HAL_EV_AVRCP_CTRL_PASSTHROUGH_RSP 0x82
  1428. struct hal_ev_avrcp_ctrl_passthrough_rsp {
  1429. uint8_t id;
  1430. uint8_t key_state;
  1431. } __attribute__((packed));
  1432. #define HAL_EV_GATT_CLIENT_REGISTER_CLIENT 0x81
  1433. struct hal_ev_gatt_client_register_client {
  1434. int32_t status;
  1435. int32_t client_if;
  1436. uint8_t app_uuid[16];
  1437. } __attribute__((packed));
  1438. #define HAL_EV_GATT_CLIENT_SCAN_RESULT 0x82
  1439. struct hal_ev_gatt_client_scan_result {
  1440. uint8_t bda[6];
  1441. int32_t rssi;
  1442. uint16_t len;
  1443. uint8_t adv_data[0];
  1444. } __attribute__((packed));
  1445. #define HAL_EV_GATT_CLIENT_CONNECT 0x83
  1446. struct hal_ev_gatt_client_connect {
  1447. int32_t conn_id;
  1448. int32_t status;
  1449. int32_t client_if;
  1450. uint8_t bda[6];
  1451. } __attribute__((packed));
  1452. #define HAL_EV_GATT_CLIENT_DISCONNECT 0x84
  1453. struct hal_ev_gatt_client_disconnect {
  1454. int32_t conn_id;
  1455. int32_t status;
  1456. int32_t client_if;
  1457. uint8_t bda[6];
  1458. } __attribute__((packed));
  1459. #define HAL_EV_GATT_CLIENT_SEARCH_COMPLETE 0x85
  1460. struct hal_ev_gatt_client_search_complete {
  1461. int32_t conn_id;
  1462. int32_t status;
  1463. } __attribute__((packed));
  1464. #define HAL_EV_GATT_CLIENT_SEARCH_RESULT 0x86
  1465. struct hal_ev_gatt_client_search_result {
  1466. int32_t conn_id;
  1467. struct hal_gatt_srvc_id srvc_id;
  1468. } __attribute__((packed));
  1469. #define HAL_EV_GATT_CLIENT_GET_CHARACTERISTIC 0x87
  1470. struct hal_ev_gatt_client_get_characteristic {
  1471. int32_t conn_id;
  1472. int32_t status;
  1473. struct hal_gatt_srvc_id srvc_id;
  1474. struct hal_gatt_gatt_id char_id;
  1475. int32_t char_prop;
  1476. } __attribute__((packed));
  1477. #define HAL_EV_GATT_CLIENT_GET_DESCRIPTOR 0x88
  1478. struct hal_ev_gatt_client_get_descriptor {
  1479. int32_t conn_id;
  1480. int32_t status;
  1481. struct hal_gatt_srvc_id srvc_id;
  1482. struct hal_gatt_gatt_id char_id;
  1483. struct hal_gatt_gatt_id descr_id;
  1484. } __attribute__((packed));
  1485. #define HAL_EV_GATT_CLIENT_GET_INC_SERVICE 0X89
  1486. struct hal_ev_gatt_client_get_inc_service {
  1487. int32_t conn_id;
  1488. int32_t status;
  1489. struct hal_gatt_srvc_id srvc_id;
  1490. struct hal_gatt_srvc_id incl_srvc_id;
  1491. } __attribute__((packed));
  1492. #define HAL_EV_GATT_CLIENT_REGISTER_FOR_NOTIF 0x8a
  1493. struct hal_ev_gatt_client_reg_for_notif {
  1494. int32_t conn_id;
  1495. int32_t registered;
  1496. int32_t status;
  1497. struct hal_gatt_srvc_id srvc_id;
  1498. struct hal_gatt_gatt_id char_id;
  1499. } __attribute__((packed));
  1500. #define HAL_EV_GATT_CLIENT_NOTIFY 0x8b
  1501. struct hal_ev_gatt_client_notify {
  1502. int32_t conn_id;
  1503. uint8_t bda[6];
  1504. struct hal_gatt_srvc_id srvc_id;
  1505. struct hal_gatt_gatt_id char_id;
  1506. uint8_t is_notify;
  1507. uint16_t len;
  1508. uint8_t value[0];
  1509. } __attribute__((packed));
  1510. #define HAL_EV_GATT_CLIENT_READ_CHARACTERISTIC 0x8c
  1511. struct hal_gatt_read_params {
  1512. struct hal_gatt_srvc_id srvc_id;
  1513. struct hal_gatt_gatt_id char_id;
  1514. struct hal_gatt_gatt_id descr_id;
  1515. uint8_t status;
  1516. uint16_t value_type;
  1517. uint16_t len;
  1518. uint8_t value[0];
  1519. } __attribute__((packed));
  1520. struct hal_ev_gatt_client_read_characteristic {
  1521. int32_t conn_id;
  1522. int32_t status;
  1523. struct hal_gatt_read_params data;
  1524. } __attribute__((packed));
  1525. #define HAL_EV_GATT_CLIENT_WRITE_CHARACTERISTIC 0x8d
  1526. struct hal_gatt_write_params {
  1527. struct hal_gatt_srvc_id srvc_id;
  1528. struct hal_gatt_gatt_id char_id;
  1529. struct hal_gatt_gatt_id descr_id;
  1530. uint8_t status;
  1531. } __attribute__((packed));
  1532. struct hal_ev_gatt_client_write_characteristic {
  1533. int32_t conn_id;
  1534. int32_t status;
  1535. struct hal_gatt_write_params data;
  1536. } __attribute__((packed));
  1537. #define HAL_EV_GATT_CLIENT_READ_DESCRIPTOR 0x8e
  1538. struct hal_ev_gatt_client_read_descriptor {
  1539. int32_t conn_id;
  1540. int32_t status;
  1541. struct hal_gatt_read_params data;
  1542. } __attribute__((packed));
  1543. #define HAL_EV_GATT_CLIENT_WRITE_DESCRIPTOR 0x8f
  1544. struct hal_ev_gatt_client_write_descriptor {
  1545. int32_t conn_id;
  1546. int32_t status;
  1547. struct hal_gatt_write_params data;
  1548. } __attribute__((packed));
  1549. #define HAL_EV_GATT_CLIENT_EXEC_WRITE 0x90
  1550. struct hal_ev_gatt_client_exec_write {
  1551. int32_t conn_id;
  1552. int32_t status;
  1553. } __attribute__((packed));
  1554. #define HAL_EV_GATT_CLIENT_READ_REMOTE_RSSI 0x91
  1555. struct hal_ev_gatt_client_read_remote_rssi {
  1556. int32_t client_if;
  1557. uint8_t address[6];
  1558. int32_t rssi;
  1559. int32_t status;
  1560. } __attribute__((packed));
  1561. #define HAL_EV_GATT_CLIENT_LISTEN 0x92
  1562. struct hal_ev_gatt_client_listen {
  1563. int32_t status;
  1564. int32_t server_if;
  1565. } __attribute__((packed));
  1566. #define HAL_EV_GATT_SERVER_REGISTER 0x93
  1567. struct hal_ev_gatt_server_register {
  1568. int32_t status;
  1569. int32_t server_if;
  1570. uint8_t uuid[16];
  1571. } __attribute__((packed));
  1572. #define HAL_EV_GATT_SERVER_CONNECTION 0x94
  1573. struct hal_ev_gatt_server_connection {
  1574. int32_t conn_id;
  1575. int32_t server_if;
  1576. int32_t connected;
  1577. uint8_t bdaddr[6];
  1578. } __attribute__((packed));
  1579. #define HAL_EV_GATT_SERVER_SERVICE_ADDED 0x95
  1580. struct hal_ev_gatt_server_service_added {
  1581. int32_t status;
  1582. int32_t server_if;
  1583. struct hal_gatt_srvc_id srvc_id;
  1584. int32_t srvc_handle;
  1585. } __attribute__((packed));
  1586. #define HAL_EV_GATT_SERVER_INC_SRVC_ADDED 0x96
  1587. struct hal_ev_gatt_server_inc_srvc_added {
  1588. int32_t status;
  1589. int32_t server_if;
  1590. int32_t srvc_handle;
  1591. int32_t incl_srvc_handle;
  1592. } __attribute__((packed));
  1593. #define HAL_EV_GATT_SERVER_CHAR_ADDED 0x97
  1594. struct hal_ev_gatt_server_characteristic_added {
  1595. int32_t status;
  1596. int32_t server_if;
  1597. uint8_t uuid[16];
  1598. int32_t srvc_handle;
  1599. int32_t char_handle;
  1600. } __attribute__((packed));
  1601. #define HAL_EV_GATT_SERVER_DESCRIPTOR_ADDED 0x98
  1602. struct hal_ev_gatt_server_descriptor_added {
  1603. int32_t status;
  1604. int32_t server_if;
  1605. uint8_t uuid[16];
  1606. int32_t srvc_handle;
  1607. int32_t descr_handle;
  1608. } __attribute__((packed));
  1609. #define HAL_EV_GATT_SERVER_SERVICE_STARTED 0x99
  1610. struct hal_ev_gatt_server_service_started {
  1611. int32_t status;
  1612. int32_t server_if;
  1613. int32_t srvc_handle;
  1614. } __attribute__((packed));
  1615. #define HAL_EV_GATT_SERVER_SERVICE_STOPPED 0x9a
  1616. struct hal_ev_gatt_server_service_stopped {
  1617. int32_t status;
  1618. int32_t server_if;
  1619. int32_t srvc_handle;
  1620. } __attribute__((packed));
  1621. #define HAL_EV_GATT_SERVER_SERVICE_DELETED 0x9b
  1622. struct hal_ev_gatt_server_service_deleted {
  1623. int32_t status;
  1624. int32_t server_if;
  1625. int32_t srvc_handle;
  1626. } __attribute__((packed));
  1627. #define HAL_EV_GATT_SERVER_REQUEST_READ 0x9c
  1628. struct hal_ev_gatt_server_request_read {
  1629. int32_t conn_id;
  1630. int32_t trans_id;
  1631. uint8_t bdaddr[6];
  1632. int32_t attr_handle;
  1633. int32_t offset;
  1634. uint8_t is_long;
  1635. } __attribute__((packed));
  1636. #define HAL_EV_GATT_SERVER_REQUEST_WRITE 0x9d
  1637. struct hal_ev_gatt_server_request_write {
  1638. int32_t conn_id;
  1639. int32_t trans_id;
  1640. uint8_t bdaddr[6];
  1641. int32_t attr_handle;
  1642. int32_t offset;
  1643. int32_t length;
  1644. uint8_t need_rsp;
  1645. uint8_t is_prep;
  1646. uint8_t value[0];
  1647. } __attribute__((packed));
  1648. #define HAL_EV_GATT_SERVER_REQUEST_EXEC_WRITE 0x9e
  1649. struct hal_ev_gatt_server_request_exec_write {
  1650. int32_t conn_id;
  1651. int32_t trans_id;
  1652. uint8_t bdaddr[6];
  1653. int32_t exec_write;
  1654. } __attribute__((packed));
  1655. #define HAL_EV_GATT_SERVER_RSP_CONFIRMATION 0x9f
  1656. struct hal_ev_gatt_server_rsp_confirmation {
  1657. int32_t status;
  1658. int32_t handle;
  1659. } __attribute__((packed));
  1660. #define HAL_EV_GATT_CLIENT_CONFIGURE_MTU 0xa0
  1661. struct hal_ev_gatt_client_configure_mtu {
  1662. int32_t conn_id;
  1663. int32_t status;
  1664. int32_t mtu;
  1665. } __attribute__((packed));
  1666. #define HAL_EV_GATT_CLIENT_FILTER_CONFIG 0xa1
  1667. struct hal_ev_gatt_client_filter_config {
  1668. int32_t action;
  1669. int32_t client_if;
  1670. int32_t status;
  1671. int32_t type;
  1672. int32_t space;
  1673. } __attribute__((packed));
  1674. #define HAL_EV_GATT_CLIENT_FILTER_PARAMS 0xa2
  1675. struct hal_ev_gatt_client_filter_params {
  1676. int32_t action;
  1677. int32_t client_if;
  1678. int32_t status;
  1679. int32_t space;
  1680. } __attribute__((packed));
  1681. #define HAL_EV_GATT_CLIENT_FILTER_STATUS 0xa3
  1682. struct hal_ev_gatt_client_filter_status {
  1683. int32_t enable;
  1684. int32_t client_if;
  1685. int32_t status;
  1686. } __attribute__((packed));
  1687. #define HAL_EV_GATT_CLIENT_MULTI_ADV_ENABLE 0xa4
  1688. struct hal_ev_gatt_client_multi_adv_enable {
  1689. int32_t client_if;
  1690. int32_t status;
  1691. } __attribute__((packed));
  1692. #define HAL_EV_GATT_CLIENT_MULTI_ADV_UPDATE 0xa5
  1693. struct hal_ev_gatt_client_multi_adv_update {
  1694. int32_t client_if;
  1695. int32_t status;
  1696. } __attribute__((packed));
  1697. #define HAL_EV_GATT_CLIENT_MULTI_ADV_DATA 0xa6
  1698. struct hal_ev_gatt_client_multi_adv_data {
  1699. int32_t client_if;
  1700. int32_t status;
  1701. } __attribute__((packed));
  1702. #define HAL_EV_GATT_CLIENT_MULTI_ADV_DISABLE 0xa7
  1703. struct hal_ev_gatt_client_multi_adv_disable {
  1704. int32_t client_if;
  1705. int32_t status;
  1706. } __attribute__((packed));
  1707. #define HAL_EV_GATT_CLIENT_CONGESTION 0xa8
  1708. struct hal_ev_gatt_client_congestion {
  1709. int32_t conn_id;
  1710. uint8_t congested;
  1711. } __attribute__((packed));
  1712. #define HAL_EV_GATT_CLIENT_CONFIG_BATCHSCAN 0xa9
  1713. struct hal_ev_gatt_client_config_batchscan {
  1714. int32_t client_if;
  1715. int32_t status;
  1716. } __attribute__((packed));
  1717. #define HAL_EV_GATT_CLIENT_ENABLE_BATCHSCAN 0xaa
  1718. struct hal_ev_gatt_client_enable_batchscan {
  1719. int32_t action;
  1720. int32_t client_if;
  1721. int32_t status;
  1722. } __attribute__((packed));
  1723. #define HAL_EV_GATT_CLIENT_BATCHSCAN_REPORTS 0xab
  1724. struct hal_ev_gatt_client_batchscan_reports {
  1725. int32_t client_if;
  1726. int32_t status;
  1727. int32_t format;
  1728. int32_t num;
  1729. int32_t data_len;
  1730. uint8_t data[0];
  1731. } __attribute__((packed));
  1732. #define HAL_EV_GATT_CLIENT_BATCHSCAN_THRESHOLD 0xac
  1733. struct hal_ev_gatt_client_batchscan_threshold {
  1734. int32_t client_if;
  1735. } __attribute__((packed));
  1736. #define HAL_EV_GATT_CLIENT_TRACK_ADV 0xad
  1737. struct hal_ev_gatt_client_track_adv {
  1738. int32_t client_if;
  1739. int32_t filetr_index;
  1740. int32_t address_type;
  1741. uint8_t address[6];
  1742. int32_t state;
  1743. } __attribute__((packed));
  1744. #define HAL_EV_GATT_SERVER_INDICATION_SENT 0xae
  1745. struct hal_ev_gatt_server_indication_sent {
  1746. int32_t conn_id;
  1747. int32_t status;
  1748. } __attribute__((packed));
  1749. #define HAL_EV_GATT_SERVER_CONGESTION 0xaf
  1750. struct hal_ev_gatt_server_congestion {
  1751. int32_t conn_id;
  1752. uint8_t congested;
  1753. } __attribute__((packed));
  1754. #define HAL_EV_GATT_SERVER_MTU_CHANGED 0xb0
  1755. struct hal_ev_gatt_server_mtu_changed {
  1756. int32_t conn_id;
  1757. int32_t mtu;
  1758. } __attribute__((packed));
  1759. #define HAL_GATT_PERMISSION_READ 0x0001
  1760. #define HAL_GATT_PERMISSION_READ_ENCRYPTED 0x0002
  1761. #define HAL_GATT_PERMISSION_READ_ENCRYPTED_MITM 0x0004
  1762. #define HAL_GATT_PERMISSION_WRITE 0x0010
  1763. #define HAL_GATT_PERMISSION_WRITE_ENCRYPTED 0x0020
  1764. #define HAL_GATT_PERMISSION_WRITE_ENCRYPTED_MITM 0x0040
  1765. #define HAL_GATT_PERMISSION_WRITE_SIGNED 0x0080
  1766. #define HAL_GATT_PERMISSION_WRITE_SIGNED_MITM 0x0100
  1767. #define HAL_GATT_AUTHENTICATION_NONE 0
  1768. #define HAL_GATT_AUTHENTICATION_NO_MITM 1
  1769. #define HAL_GATT_AUTHENTICATION_MITM 2
  1770. #define HAL_HF_CLIENT_CONN_STATE_DISCONNECTED 0x00
  1771. #define HAL_HF_CLIENT_CONN_STATE_CONNECTING 0x01
  1772. #define HAL_HF_CLIENT_CONN_STATE_CONNECTED 0x02
  1773. #define HAL_HF_CLIENT_CONN_STATE_SLC_CONNECTED 0x03
  1774. #define HAL_HF_CLIENT_CONN_STATE_DISCONNECTING 0x04
  1775. #define HAL_HF_CLIENT_PEER_FEAT_3WAY 0x00000001
  1776. #define HAL_HF_CLIENT_PEER_FEAT_ECNR 0x00000002
  1777. #define HAL_HF_CLIENT_PEER_FEAT_VREC 0x00000004
  1778. #define HAL_HF_CLIENT_PEER_FEAT_INBAND 0x00000008
  1779. #define HAL_HF_CLIENT_PEER_FEAT_VTAG 0x00000010
  1780. #define HAL_HF_CLIENT_PEER_FEAT_REJECT 0x00000020
  1781. #define HAL_HF_CLIENT_PEER_FEAT_ECS 0x00000040
  1782. #define HAL_HF_CLIENT_PEER_FEAT_ECC 0x00000080
  1783. #define HAL_HF_CLIENT_PEER_FEAT_EXTERR 0x00000100
  1784. #define HAL_HF_CLIENT_PEER_FEAT_CODEC 0x00000200
  1785. #define HAL_HF_CLIENT_CHLD_FEAT_REL 0x00000001
  1786. #define HAL_HF_CLIENT_CHLD_FEAT_REL_ACC 0x00000002
  1787. #define HAL_HF_CLIENT_CHLD_FEAT_REL_X 0x00000004
  1788. #define HAL_HF_CLIENT_CHLD_FEAT_HOLD_ACC 0x00000008
  1789. #define HAL_HF_CLIENT_CHLD_FEAT_PRIV_X 0x00000010
  1790. #define HAL_HF_CLIENT_CHLD_FEAT_MERGE 0x00000020
  1791. #define HAL_HF_CLIENT_CHLD_FEAT_MERGE_DETACH 0x00000040
  1792. #define HAL_EV_HF_CLIENT_CONN_STATE 0x81
  1793. struct hal_ev_hf_client_conn_state {
  1794. uint8_t state;
  1795. uint32_t peer_feat;
  1796. uint32_t chld_feat;
  1797. uint8_t bdaddr[6];
  1798. } __attribute__((packed));
  1799. #define HAL_HF_CLIENT_AUDIO_STATE_DISCONNECTED 0x00
  1800. #define HAL_HF_CLIENT_AUDIO_STATE_CONNECTING 0x01
  1801. #define HAL_HF_CLIENT_AUDIO_STATE_CONNECTED 0x02
  1802. #define HAL_HF_CLIENT_AUDIO_STATE_CONNECTED_MSBC 0x03
  1803. #define HAL_EV_HF_CLIENT_AUDIO_STATE 0x82
  1804. struct hal_ev_hf_client_audio_state {
  1805. uint8_t state;
  1806. uint8_t bdaddr[6];
  1807. } __attribute__((packed));
  1808. #define HAL_HF_CLIENT_VR_STOPPED 0x00
  1809. #define HAL_HF_CLIENT_VR_STARTED 0x01
  1810. #define HAL_EV_HF_CLIENT_VR_STATE 0x83
  1811. struct hal_ev_hf_client_vr_state {
  1812. uint8_t state;
  1813. } __attribute__((packed));
  1814. #define HAL_HF_CLIENT_NET_NOT_AVAILABLE 0x00
  1815. #define HAL_HF_CLIENT_NET_AVAILABLE 0x01
  1816. #define HAL_EV_HF_CLIENT_NET_STATE 0x84
  1817. struct hal_ev_hf_client_net_state {
  1818. uint8_t state;
  1819. } __attribute__((packed));
  1820. #define HAL_HF_CLIENT_NET_ROAMING_TYPE_HOME 0x00
  1821. #define HAL_HF_CLIENT_NET_ROAMING_TYPE_ROAMING 0x01
  1822. #define HAL_EV_HF_CLIENT_NET_ROAMING_TYPE 0x85
  1823. struct hal_ev_hf_client_net_roaming_type {
  1824. uint8_t state;
  1825. } __attribute__((packed));
  1826. #define HAL_EV_HF_CLIENT_NET_SIGNAL_STRENGTH 0x86
  1827. struct hal_ev_hf_client_net_signal_strength {
  1828. uint8_t signal_strength;
  1829. } __attribute__((packed));
  1830. #define HAL_EV_HF_CLIENT_BATTERY_LEVEL 0x87
  1831. struct hal_ev_hf_client_battery_level {
  1832. uint8_t battery_level;
  1833. } __attribute__((packed));
  1834. #define HAL_EV_HF_CLIENT_OPERATOR_NAME 0x88
  1835. struct hal_ev_hf_client_operator_name {
  1836. uint16_t name_len;
  1837. uint8_t name[0];
  1838. } __attribute__((packed));
  1839. #define HAL_HF_CLIENT_CALL_IND_NO_CALL_IN_PROGERSS 0x00
  1840. #define HAL_HF_CLIENT_CALL_IND_CALL_IN_PROGERSS 0x01
  1841. #define HAL_EV_HF_CLIENT_CALL_INDICATOR 0x89
  1842. struct hal_ev_hf_client_call_indicator {
  1843. uint8_t call;
  1844. } __attribute__((packed));
  1845. #define HAL_HF_CLIENT_CALL_SETUP_NONE 0x00
  1846. #define HAL_HF_CLIENT_CALL_SETUP_INCOMING 0x01
  1847. #define HAL_HF_CLIENT_CALL_SETUP_OUTGOING 0x02
  1848. #define HAL_HF_CLIENT_CALL_SETUP_ALERTING 0x03
  1849. #define HAL_EV_HF_CLIENT_CALL_SETUP_INDICATOR 0x8a
  1850. struct hal_ev_hf_client_call_setup_indicator {
  1851. uint8_t call_setup;
  1852. } __attribute__((packed));
  1853. #define HAL_HF_CLIENT_CALL_HELD_IND_NONE 0x00
  1854. #define HAL_HF_CLIENT_CALL_HELD_IND_HOLD_AND_ACTIVE 0x01
  1855. #define HAL_HF_CLIENT_CALL_SETUP_IND_HOLD 0x02
  1856. #define HAL_EV_HF_CLIENT_CALL_HELD_INDICATOR 0x8b
  1857. struct hal_ev_hf_client_call_held_indicator {
  1858. uint8_t call_held;
  1859. } __attribute__((packed));
  1860. #define HAL_HF_CLIENT_RESP_AND_HOLD_STATUS_HELD 0x00
  1861. #define HAL_HF_CLIENT_RESP_AND_HOLD_STATUS_ACCEPT 0x01
  1862. #define HAL_HF_CLIENT_RESP_AND_HOLD_STATUS_REJECT 0x02
  1863. #define HAL_EV_HF_CLIENT_RESPONSE_AND_HOLD_STATUS 0x8c
  1864. struct hal_ev_hf_client_response_and_hold_status {
  1865. uint8_t status;
  1866. } __attribute__((packed));
  1867. #define HAL_EV_HF_CLIENT_CALLING_LINE_IDENT 0x8d
  1868. struct hal_ev_hf_client_calling_line_ident {
  1869. uint16_t number_len;
  1870. uint8_t number[0];
  1871. } __attribute__((packed));
  1872. #define HAL_EV_HF_CLIENT_CALL_WAITING 0x8e
  1873. struct hal_ev_hf_client_call_waiting {
  1874. uint16_t number_len;
  1875. uint8_t number[0];
  1876. } __attribute__((packed));
  1877. #define HAL_HF_CLIENT_DIRECTION_OUTGOING 0x00
  1878. #define HAL_HF_CLIENT_DIRECTION_INCOMING 0x01
  1879. #define HAL_HF_CLIENT_CALL_STATE_ACTIVE 0x00
  1880. #define HAL_HF_CLIENT_CALL_STATE_HELD 0x01
  1881. #define HAL_HF_CLIENT_CALL_STATE_DIALING 0x02
  1882. #define HAL_HF_CLIENT_CALL_STATE_ALERTING 0x03
  1883. #define HAL_HF_CLIENT_CALL_STATE_INCOMING 0x04
  1884. #define HAL_HF_CLIENT_CALL_STATE_WAITING 0x05
  1885. #define HAL_HF_CLIENT_CALL_STATE_HELD_BY_RESP_AND_HOLD 0x06
  1886. #define HAL_EV_HF_CLIENT_CURRENT_CALL 0x8f
  1887. struct hal_ev_hf_client_current_call {
  1888. uint8_t index;
  1889. uint8_t direction;
  1890. uint8_t call_state;
  1891. uint8_t multiparty;
  1892. uint16_t number_len;
  1893. uint8_t number[0];
  1894. } __attribute__((packed));
  1895. #define HAL_EV_CLIENT_VOLUME_CHANGED 0x90
  1896. struct hal_ev_hf_client_volume_changed {
  1897. uint8_t type;
  1898. uint8_t volume;
  1899. } __attribute__((packed));
  1900. #define HAL_HF_CLIENT_CMD_COMP_OK 0x00
  1901. #define HAL_HF_CLIENT_CMD_COMP_ERR 0x01
  1902. #define HAL_HF_CLIENT_CMD_COMP_ERR_NO_CARRIER 0x02
  1903. #define HAL_HF_CLIENT_CMD_COMP_ERR_BUSY 0x03
  1904. #define HAL_HF_CLIENT_CMD_COMP_ERR_NO_ANSWER 0x04
  1905. #define HAL_HF_CLIENT_CMD_COMP_ERR_DELAYED 0x05
  1906. #define HAL_HF_CLIENT_CMD_COMP_ERR_BACKLISTED 0x06
  1907. #define HAL_HF_CLIENT_CMD_COMP_ERR_CME 0x07
  1908. #define HAL_EV_CLIENT_COMMAND_COMPLETE 0x91
  1909. struct hal_ev_hf_client_command_complete {
  1910. uint8_t type;
  1911. uint8_t cme;
  1912. } __attribute__((packed));
  1913. #define HAL_HF_CLIENT_SUBSCR_TYPE_UNKNOWN 0x00
  1914. #define HAL_HF_CLIENT_SUBSCR_TYPE_VOICE 0x01
  1915. #define HAL_HF_CLIENT_SUBSCR_TYPE_FAX 0x02
  1916. #define HAL_EV_CLIENT_SUBSCRIBER_SERVICE_INFO 0x92
  1917. struct hal_ev_hf_client_subscriber_service_info {
  1918. uint8_t type;
  1919. uint16_t name_len;
  1920. uint8_t name[0];
  1921. } __attribute__((packed));
  1922. #define HAL_HF_CLIENT_INBAND_RINGTONE_NOT_PROVIDED 0x00
  1923. #define HAL_HF_CLIENT_INBAND_RINGTONE_PROVIDED 0x01
  1924. #define HAL_EV_CLIENT_INBAND_SETTINGS 0x93
  1925. struct hal_ev_hf_client_inband_settings {
  1926. uint8_t state;
  1927. } __attribute__((packed));
  1928. #define HAL_EV_CLIENT_LAST_VOICE_CALL_TAG_NUM 0x94
  1929. struct hal_ev_hf_client_last_void_call_tag_num {
  1930. uint16_t number_len;
  1931. uint8_t number[0];
  1932. } __attribute__((packed));
  1933. #define HAL_EV_CLIENT_RING_INDICATION 0x95
  1934. #define HAL_EV_MAP_CLIENT_REMOTE_MAS_INSTANCES 0x81
  1935. struct hal_map_client_mas_instance {
  1936. int32_t id;
  1937. int32_t scn;
  1938. int32_t msg_types;
  1939. int32_t name_len;
  1940. uint8_t name[0];
  1941. } __attribute__((packed));
  1942. struct hal_ev_map_client_remote_mas_instances {
  1943. int8_t status;
  1944. uint8_t bdaddr[6];
  1945. int32_t num_instances;
  1946. struct hal_map_client_mas_instance instances[0];
  1947. } __attribute__((packed));