| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322 |
- /* SPDX-License-Identifier: LGPL-2.1-or-later */
- /*
- *
- * BlueZ - Bluetooth protocol stack for Linux
- *
- * Copyright (C) 2013 Intel Corporation. All rights reserved.
- *
- *
- */
- static const char BLUEZ_HAL_SK_PATH[] = "\0bluez_hal_socket";
- #define HAL_MINIMUM_EVENT 0x81
- #define HAL_SERVICE_ID_CORE 0
- #define HAL_SERVICE_ID_BLUETOOTH 1
- #define HAL_SERVICE_ID_SOCKET 2
- #define HAL_SERVICE_ID_HIDHOST 3
- #define HAL_SERVICE_ID_PAN 4
- #define HAL_SERVICE_ID_HANDSFREE 5
- #define HAL_SERVICE_ID_A2DP 6
- #define HAL_SERVICE_ID_HEALTH 7
- #define HAL_SERVICE_ID_AVRCP 8
- #define HAL_SERVICE_ID_GATT 9
- #define HAL_SERVICE_ID_HANDSFREE_CLIENT 10
- #define HAL_SERVICE_ID_MAP_CLIENT 11
- #define HAL_SERVICE_ID_AVRCP_CTRL 12
- #define HAL_SERVICE_ID_A2DP_SINK 13
- #define HAL_SERVICE_ID_MAX HAL_SERVICE_ID_A2DP_SINK
- /* Core Service */
- #define HAL_STATUS_SUCCESS IPC_STATUS_SUCCESS
- #define HAL_STATUS_FAILED 0x01
- #define HAL_STATUS_NOT_READY 0x02
- #define HAL_STATUS_NOMEM 0x03
- #define HAL_STATUS_BUSY 0x04
- #define HAL_STATUS_DONE 0x05
- #define HAL_STATUS_UNSUPPORTED 0x06
- #define HAL_STATUS_INVALID 0x07
- #define HAL_STATUS_UNHANDLED 0x08
- #define HAL_STATUS_AUTH_FAILURE 0x09
- #define HAL_STATUS_REMOTE_DEVICE_DOWN 0x0a
- #define HAL_OP_STATUS IPC_OP_STATUS
- #define HAL_MODE_DEFAULT 0x00
- #define HAL_MODE_BREDR 0x01
- #define HAL_MODE_LE 0x02
- #define HAL_OP_REGISTER_MODULE 0x01
- struct hal_cmd_register_module {
- uint8_t service_id;
- uint8_t mode;
- int32_t max_clients;
- } __attribute__((packed));
- #define HAL_OP_UNREGISTER_MODULE 0x02
- struct hal_cmd_unregister_module {
- uint8_t service_id;
- } __attribute__((packed));
- #define HAL_CONFIG_VENDOR 0x00
- #define HAL_CONFIG_MODEL 0x01
- #define HAL_CONFIG_NAME 0x02
- #define HAL_CONFIG_SERIAL_NUMBER 0x03
- #define HAL_CONFIG_SYSTEM_ID 0x04
- #define HAL_CONFIG_PNP_ID 0x05
- #define HAL_CONFIG_FW_REV 0x06
- #define HAL_CONFIG_HW_REV 0x07
- struct hal_config_prop {
- uint8_t type;
- uint16_t len;
- uint8_t val[0];
- } __attribute__((packed));
- #define HAL_OP_CONFIGURATION 0x03
- struct hal_cmd_configuration {
- uint8_t num;
- struct hal_config_prop props[0];
- } __attribute__((packed));
- /* Bluetooth Core HAL API */
- #define HAL_OP_ENABLE 0x01
- #define HAL_OP_DISABLE 0x02
- #define HAL_OP_GET_ADAPTER_PROPS 0x03
- #define HAL_OP_GET_ADAPTER_PROP 0x04
- struct hal_cmd_get_adapter_prop {
- uint8_t type;
- } __attribute__((packed));
- #define HAL_MAX_NAME_LENGTH 249
- #define HAL_PROP_ADAPTER_NAME 0x01
- #define HAL_PROP_ADAPTER_ADDR 0x02
- #define HAL_PROP_ADAPTER_UUIDS 0x03
- #define HAL_PROP_ADAPTER_CLASS 0x04
- #define HAL_PROP_ADAPTER_TYPE 0x05
- #define HAL_PROP_ADAPTER_SERVICE_REC 0x06
- #define HAL_PROP_ADAPTER_SCAN_MODE 0x07
- #define HAL_PROP_ADAPTER_BONDED_DEVICES 0x08
- #define HAL_PROP_ADAPTER_DISC_TIMEOUT 0x09
- #define HAL_PROP_DEVICE_NAME 0x01
- #define HAL_PROP_DEVICE_ADDR 0x02
- #define HAL_PROP_DEVICE_UUIDS 0x03
- #define HAL_PROP_DEVICE_CLASS 0x04
- #define HAL_PROP_DEVICE_TYPE 0x05
- #define HAL_PROP_DEVICE_SERVICE_REC 0x06
- struct hal_prop_device_service_rec {
- uint8_t uuid[16];
- uint16_t channel;
- uint8_t name_len;
- uint8_t name[];
- } __attribute__((packed));
- #define HAL_PROP_DEVICE_FRIENDLY_NAME 0x0a
- #define HAL_PROP_DEVICE_RSSI 0x0b
- #define HAL_PROP_DEVICE_VERSION_INFO 0x0c
- struct hal_prop_device_info {
- uint8_t version;
- uint16_t sub_version;
- uint16_t manufacturer;
- } __attribute__((packed));
- #define HAL_PROP_ADAPTER_LOCAL_LE_FEAT 0x0d
- #define HAL_PROP_DEVICE_TIMESTAMP 0xFF
- #define HAL_ADAPTER_SCAN_MODE_NONE 0x00
- #define HAL_ADAPTER_SCAN_MODE_CONN 0x01
- #define HAL_ADAPTER_SCAN_MODE_CONN_DISC 0x02
- #define HAL_TYPE_BREDR 0x01
- #define HAL_TYPE_LE 0x02
- #define HAL_TYPE_DUAL 0x03
- #define HAL_OP_SET_ADAPTER_PROP 0x05
- struct hal_cmd_set_adapter_prop {
- uint8_t type;
- uint16_t len;
- uint8_t val[0];
- } __attribute__((packed));
- #define HAL_OP_GET_REMOTE_DEVICE_PROPS 0x06
- struct hal_cmd_get_remote_device_props {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_GET_REMOTE_DEVICE_PROP 0x07
- struct hal_cmd_get_remote_device_prop {
- uint8_t bdaddr[6];
- uint8_t type;
- } __attribute__((packed));
- #define HAL_OP_SET_REMOTE_DEVICE_PROP 0x08
- struct hal_cmd_set_remote_device_prop {
- uint8_t bdaddr[6];
- uint8_t type;
- uint16_t len;
- uint8_t val[0];
- } __attribute__((packed));
- #define HAL_OP_GET_REMOTE_SERVICE_REC 0x09
- struct hal_cmd_get_remote_service_rec {
- uint8_t bdaddr[6];
- uint8_t uuid[16];
- } __attribute__((packed));
- #define HAL_OP_GET_REMOTE_SERVICES 0x0a
- struct hal_cmd_get_remote_services {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_START_DISCOVERY 0x0b
- #define HAL_OP_CANCEL_DISCOVERY 0x0c
- #define BT_TRANSPORT_UNKNOWN 0x00
- #define BT_TRANSPORT_BR_EDR 0x01
- #define BT_TRANSPORT_LE 0x02
- #define HAL_OP_CREATE_BOND 0x0d
- struct hal_cmd_create_bond {
- uint8_t bdaddr[6];
- uint8_t transport;
- } __attribute__((packed));
- #define HAL_OP_REMOVE_BOND 0x0e
- struct hal_cmd_remove_bond {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_CANCEL_BOND 0x0f
- struct hal_cmd_cancel_bond {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_PIN_REPLY 0x10
- struct hal_cmd_pin_reply {
- uint8_t bdaddr[6];
- uint8_t accept;
- uint8_t pin_len;
- uint8_t pin_code[16];
- } __attribute__((packed));
- #define HAL_SSP_VARIANT_CONFIRM 0x00
- #define HAL_SSP_VARIANT_ENTRY 0x01
- #define HAL_SSP_VARIANT_CONSENT 0x02
- #define HAL_SSP_VARIANT_NOTIF 0x03
- #define HAL_OP_SSP_REPLY 0x11
- struct hal_cmd_ssp_reply {
- uint8_t bdaddr[6];
- uint8_t ssp_variant;
- uint8_t accept;
- uint32_t passkey;
- } __attribute__((packed));
- #define HAL_OP_DUT_MODE_CONF 0x12
- struct hal_cmd_dut_mode_conf {
- uint8_t enable;
- } __attribute__((packed));
- #define HAL_OP_DUT_MODE_SEND 0x13
- struct hal_cmd_dut_mode_send {
- uint16_t opcode;
- uint8_t len;
- uint8_t data[0];
- } __attribute__((packed));
- #define HAL_OP_LE_TEST_MODE 0x14
- struct hal_cmd_le_test_mode {
- uint16_t opcode;
- uint8_t len;
- uint8_t data[0];
- } __attribute__((packed));
- #define HAL_OP_GET_CONNECTION_STATE 0x15
- struct hal_cmd_get_connection_state {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- struct hal_rsp_get_connection_state {
- int32_t connection_state;
- } __attribute__((packed));
- #define HAL_OP_READ_ENERGY_INFO 0x16
- /* Bluetooth Socket HAL api */
- #define HAL_MODE_SOCKET_DEFAULT HAL_MODE_DEFAULT
- #define HAL_MODE_SOCKET_DYNAMIC_MAP 0x01
- #define HAL_SOCK_RFCOMM 0x01
- #define HAL_SOCK_SCO 0x02
- #define HAL_SOCK_L2CAP 0x03
- #define HAL_SOCK_FLAG_ENCRYPT 0x01
- #define HAL_SOCK_FLAG_AUTH 0x02
- #define HAL_OP_SOCKET_LISTEN 0x01
- struct hal_cmd_socket_listen {
- uint8_t type;
- uint8_t name[256];
- uint8_t uuid[16];
- int32_t channel;
- uint8_t flags;
- } __attribute__((packed));
- #define HAL_OP_SOCKET_CONNECT 0x02
- struct hal_cmd_socket_connect {
- uint8_t bdaddr[6];
- uint8_t type;
- uint8_t uuid[16];
- int32_t channel;
- uint8_t flags;
- } __attribute__((packed));
- /* Bluetooth HID Host HAL API */
- #define HAL_OP_HIDHOST_CONNECT 0x01
- struct hal_cmd_hidhost_connect {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HIDHOST_DISCONNECT 0x02
- struct hal_cmd_hidhost_disconnect {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HIDHOST_VIRTUAL_UNPLUG 0x03
- struct hal_cmd_hidhost_virtual_unplug {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HIDHOST_SET_INFO 0x04
- struct hal_cmd_hidhost_set_info {
- uint8_t bdaddr[6];
- uint8_t attr;
- uint8_t subclass;
- uint8_t app_id;
- uint16_t vendor;
- uint16_t product;
- uint16_t country;
- uint16_t descr_len;
- uint8_t descr[0];
- } __attribute__((packed));
- #define HAL_HIDHOST_REPORT_PROTOCOL 0x00
- #define HAL_HIDHOST_BOOT_PROTOCOL 0x01
- #define HAL_HIDHOST_UNSUPPORTED_PROTOCOL 0xff
- #define HAL_OP_HIDHOST_GET_PROTOCOL 0x05
- struct hal_cmd_hidhost_get_protocol {
- uint8_t bdaddr[6];
- uint8_t mode;
- } __attribute__((packed));
- #define HAL_OP_HIDHOST_SET_PROTOCOL 0x06
- struct hal_cmd_hidhost_set_protocol {
- uint8_t bdaddr[6];
- uint8_t mode;
- } __attribute__((packed));
- #define HAL_HIDHOST_INPUT_REPORT 0x01
- #define HAL_HIDHOST_OUTPUT_REPORT 0x02
- #define HAL_HIDHOST_FEATURE_REPORT 0x03
- #define HAL_OP_HIDHOST_GET_REPORT 0x07
- struct hal_cmd_hidhost_get_report {
- uint8_t bdaddr[6];
- uint8_t type;
- uint8_t id;
- uint16_t buf_size;
- } __attribute__((packed));
- #define HAL_OP_HIDHOST_SET_REPORT 0x08
- struct hal_cmd_hidhost_set_report {
- uint8_t bdaddr[6];
- uint8_t type;
- uint16_t len;
- uint8_t data[0];
- } __attribute__((packed));
- #define HAL_OP_HIDHOST_SEND_DATA 0x09
- struct hal_cmd_hidhost_send_data {
- uint8_t bdaddr[6];
- uint16_t len;
- uint8_t data[0];
- } __attribute__((packed));
- /* a2dp source and sink HAL API */
- #define HAL_OP_A2DP_CONNECT 0x01
- struct hal_cmd_a2dp_connect {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_A2DP_DISCONNECT 0x02
- struct hal_cmd_a2dp_disconnect {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- /* PAN HAL API */
- /* PAN Roles */
- #define HAL_PAN_ROLE_NONE 0x00
- #define HAL_PAN_ROLE_NAP 0x01
- #define HAL_PAN_ROLE_PANU 0x02
- /* PAN Control states */
- #define HAL_PAN_CTRL_ENABLED 0x00
- #define HAL_PAN_CTRL_DISABLED 0x01
- /* PAN Connection states */
- #define HAL_PAN_STATE_CONNECTED 0x00
- #define HAL_PAN_STATE_CONNECTING 0x01
- #define HAL_PAN_STATE_DISCONNECTED 0x02
- #define HAL_PAN_STATE_DISCONNECTING 0x03
- /* PAN status values */
- #define HAL_PAN_STATUS_FAIL 0x01
- #define HAL_PAN_STATUS_NOT_READY 0x02
- #define HAL_PAN_STATUS_NO_MEMORY 0x03
- #define HAL_PAN_STATUS_BUSY 0x04
- #define HAL_PAN_STATUS_DONE 0x05
- #define HAL_PAN_STATUS_UNSUPORTED 0x06
- #define HAL_PAN_STATUS_INVAL 0x07
- #define HAL_PAN_STATUS_UNHANDLED 0x08
- #define HAL_PAN_STATUS_AUTH_FAILED 0x09
- #define HAL_PAN_STATUS_DEVICE_DOWN 0x0A
- #define HAL_OP_PAN_ENABLE 0x01
- struct hal_cmd_pan_enable {
- uint8_t local_role;
- } __attribute__((packed));
- #define HAL_OP_PAN_GET_ROLE 0x02
- struct hal_rsp_pan_get_role {
- uint8_t local_role;
- } __attribute__((packed));
- #define HAL_OP_PAN_CONNECT 0x03
- struct hal_cmd_pan_connect {
- uint8_t bdaddr[6];
- uint8_t local_role;
- uint8_t remote_role;
- } __attribute__((packed));
- #define HAL_OP_PAN_DISCONNECT 0x04
- struct hal_cmd_pan_disconnect {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_HEALTH_MDEP_ROLE_SOURCE 0x00
- #define HAL_HEALTH_MDEP_ROLE_SINK 0x01
- #define HAL_HEALTH_CHANNEL_TYPE_RELIABLE 0x00
- #define HAL_HEALTH_CHANNEL_TYPE_STREAMING 0x01
- #define HAL_HEALTH_CHANNEL_TYPE_ANY 0x02
- #define HAL_OP_HEALTH_REG_APP 0x01
- struct hal_cmd_health_reg_app {
- uint8_t num_of_mdep;
- uint16_t app_name_off;
- uint16_t provider_name_off;
- uint16_t service_name_off;
- uint16_t service_descr_off;
- uint16_t len;
- uint8_t data[0];
- } __attribute__((packed));
- struct hal_rsp_health_reg_app {
- uint16_t app_id;
- } __attribute__((packed));
- #define HAL_OP_HEALTH_MDEP 0x02
- struct hal_cmd_health_mdep {
- uint16_t app_id;
- uint8_t role;
- uint16_t data_type;
- uint8_t channel_type;
- uint16_t descr_len;
- uint8_t descr[0];
- } __attribute__((packed));
- #define HAL_OP_HEALTH_UNREG_APP 0x03
- struct hal_cmd_health_unreg_app {
- uint16_t app_id;
- } __attribute__((packed));
- #define HAL_OP_HEALTH_CONNECT_CHANNEL 0x04
- struct hal_cmd_health_connect_channel {
- uint16_t app_id;
- uint8_t bdaddr[6];
- uint8_t mdep_index;
- } __attribute__((packed));
- struct hal_rsp_health_connect_channel {
- uint16_t channel_id;
- } __attribute__((packed));
- #define HAL_OP_HEALTH_DESTROY_CHANNEL 0x05
- struct hal_cmd_health_destroy_channel {
- uint16_t channel_id;
- } __attribute__((packed));
- /* Handsfree HAL API */
- #define HAL_MODE_HANDSFREE_HSP_ONLY HAL_MODE_DEFAULT
- #define HAL_MODE_HANDSFREE_HFP 0x01
- #define HAL_MODE_HANDSFREE_HFP_WBS 0x02
- #define HAL_OP_HANDSFREE_CONNECT 0x01
- struct hal_cmd_handsfree_connect {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HANDSFREE_DISCONNECT 0x02
- struct hal_cmd_handsfree_disconnect {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HANDSFREE_CONNECT_AUDIO 0x03
- struct hal_cmd_handsfree_connect_audio {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HANDSFREE_DISCONNECT_AUDIO 0x04
- struct hal_cmd_handsfree_disconnect_audio {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HANDSFREE_START_VR 0x05
- struct hal_cmd_handsfree_start_vr {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HANDSFREE_STOP_VR 0x06
- struct hal_cmd_handsfree_stop_vr {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_HANDSFREE_VOLUME_TYPE_SPEAKER 0x00
- #define HAL_HANDSFREE_VOLUME_TYPE_MIC 0x01
- #define HAL_OP_HANDSFREE_VOLUME_CONTROL 0x07
- struct hal_cmd_handsfree_volume_control {
- uint8_t type;
- uint8_t volume;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_HANDSFREE_NETWORK_STATE_NOT_AVAILABLE 0x00
- #define HAL_HANDSFREE_NETWORK_STATE_AVAILABLE 0x01
- #define HAL_HANDSFREE_SERVICE_TYPE_HOME 0x00
- #define HAL_HANDSFREE_SERVICE_TYPE_ROAMING 0x01
- #define HAL_OP_HANDSFREE_DEVICE_STATUS_NOTIF 0x08
- struct hal_cmd_handsfree_device_status_notif {
- uint8_t state;
- uint8_t type;
- uint8_t signal;
- uint8_t battery;
- } __attribute__((packed));
- #define HAL_OP_HANDSFREE_COPS_RESPONSE 0x09
- struct hal_cmd_handsfree_cops_response {
- uint16_t len;
- uint8_t bdaddr[6];
- uint8_t buf[0];
- } __attribute__((packed));
- #define HAL_HANDSFREE_CALL_STATE_ACTIVE 0x00
- #define HAL_HANDSFREE_CALL_STATE_HELD 0x01
- #define HAL_HANDSFREE_CALL_STATE_DIALING 0x02
- #define HAL_HANDSFREE_CALL_STATE_ALERTING 0x03
- #define HAL_HANDSFREE_CALL_STATE_INCOMING 0x04
- #define HAL_HANDSFREE_CALL_STATE_WAITING 0x05
- #define HAL_HANDSFREE_CALL_STATE_IDLE 0x06
- #define HAL_OP_HANDSFREE_CIND_RESPONSE 0x0A
- struct hal_cmd_handsfree_cind_response {
- uint8_t svc;
- uint8_t num_active;
- uint8_t num_held;
- uint8_t state;
- uint8_t signal;
- uint8_t roam;
- uint8_t batt_chg;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HANDSFREE_FORMATTED_AT_RESPONSE 0x0B
- struct hal_cmd_handsfree_formatted_at_response {
- uint16_t len;
- uint8_t bdaddr[6];
- uint8_t buf[0];
- } __attribute__((packed));
- #define HAL_HANDSFREE_AT_RESPONSE_ERROR 0x00
- #define HAL_HANDSFREE_AT_RESPONSE_OK 0x01
- #define HAL_OP_HANDSFREE_AT_RESPONSE 0x0C
- struct hal_cmd_handsfree_at_response {
- uint8_t response;
- uint8_t error;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_HANDSFREE_CALL_DIRECTION_OUTGOING 0x00
- #define HAL_HANDSFREE_CALL_DIRECTION_INCOMING 0x01
- #define HAL_HANDSFREE_CALL_TYPE_VOICE 0x00
- #define HAL_HANDSFREE_CALL_TYPE_DATA 0x01
- #define HAL_HANDSFREE_CALL_TYPE_FAX 0x02
- #define HAL_HANDSFREE_CALL_MPTY_TYPE_SINGLE 0x00
- #define HAL_HANDSFREE_CALL_MPTY_TYPE_MULTI 0x01
- #define HAL_HANDSFREE_CALL_ADDRTYPE_UNKNOWN 0x81
- #define HAL_HANDSFREE_CALL_ADDRTYPE_INTERNATIONAL 0x91
- #define HAL_OP_HANDSFREE_CLCC_RESPONSE 0x0D
- struct hal_cmd_handsfree_clcc_response {
- uint8_t index;
- uint8_t dir;
- uint8_t state;
- uint8_t mode;
- uint8_t mpty;
- uint8_t type;
- uint8_t bdaddr[6];
- uint16_t number_len;
- uint8_t number[0];
- } __attribute__((packed));
- #define HAL_OP_HANDSFREE_PHONE_STATE_CHANGE 0x0E
- struct hal_cmd_handsfree_phone_state_change {
- uint8_t num_active;
- uint8_t num_held;
- uint8_t state;
- uint8_t type;
- uint16_t number_len;
- uint8_t number[0];
- } __attribute__((packed));
- #define HAL_HANDSFREE_WBS_NONE 0x00
- #define HAL_HANDSFREE_WBS_NO 0x01
- #define HAL_HANDSFREE_WBS_YES 0x02
- #define HAL_OP_HANDSFREE_CONFIGURE_WBS 0x0F
- struct hal_cmd_handsfree_configure_wbs {
- uint8_t bdaddr[6];
- uint8_t config;
- } __attribute__((packed));
- /* AVRCP TARGET HAL API */
- #define HAL_AVRCP_PLAY_STATUS_STOPPED 0x00
- #define HAL_AVRCP_PLAY_STATUS_PLAYING 0x01
- #define HAL_AVRCP_PLAY_STATUS_PAUSED 0x02
- #define HAL_AVRCP_PLAY_STATUS_FWD_SEEK 0x03
- #define HAL_AVRCP_PLAY_STATUS_REV_SEEK 0x04
- #define HAL_AVRCP_PLAY_STATUS_ERROR 0xff
- #define HAL_OP_AVRCP_GET_PLAY_STATUS 0x01
- struct hal_cmd_avrcp_get_play_status {
- uint8_t status;
- uint32_t duration;
- uint32_t position;
- } __attribute__((packed));
- #define HAL_AVRCP_PLAYER_ATTR_EQUALIZER 0x01
- #define HAL_AVRCP_PLAYER_ATTR_REPEAT 0x02
- #define HAL_AVRCP_PLAYER_ATTR_SHUFFLE 0x03
- #define HAL_AVRCP_PLAYER_ATTR_SCAN 0x04
- #define HAL_OP_AVRCP_LIST_PLAYER_ATTRS 0x02
- struct hal_cmd_avrcp_list_player_attrs {
- uint8_t number;
- uint8_t attrs[0];
- } __attribute__((packed));
- #define HAL_OP_AVRCP_LIST_PLAYER_VALUES 0x03
- struct hal_cmd_avrcp_list_player_values {
- uint8_t number;
- uint8_t values[0];
- } __attribute__((packed));
- struct hal_avrcp_player_attr_value {
- uint8_t attr;
- uint8_t value;
- } __attribute__((packed));
- #define HAL_OP_AVRCP_GET_PLAYER_ATTRS 0x04
- struct hal_cmd_avrcp_get_player_attrs {
- uint8_t number;
- struct hal_avrcp_player_attr_value attrs[0];
- } __attribute__((packed));
- struct hal_avrcp_player_setting_text {
- uint8_t id;
- uint8_t len;
- uint8_t text[0];
- } __attribute__((packed));
- #define HAL_OP_AVRCP_GET_PLAYER_ATTRS_TEXT 0x05
- struct hal_cmd_avrcp_get_player_attrs_text {
- uint8_t number;
- struct hal_avrcp_player_setting_text attrs[0];
- } __attribute__((packed));
- #define HAL_OP_AVRCP_GET_PLAYER_VALUES_TEXT 0x06
- struct hal_cmd_avrcp_get_player_values_text {
- uint8_t number;
- struct hal_avrcp_player_setting_text values[0];
- } __attribute__((packed));
- #define HAL_AVRCP_MEDIA_ATTR_TITLE 0x01
- #define HAL_AVRCP_MEDIA_ATTR_ARTIST 0x02
- #define HAL_AVRCP_MEDIA_ATTR_ALBUM 0x03
- #define HAL_AVRCP_MEDIA_ATTR_TRACK_NUM 0x04
- #define HAL_AVRCP_MEDIA_ATTR_NUM_TRACKS 0x05
- #define HAL_AVRCP_MEDIA_ATTR_GENRE 0x06
- #define HAL_AVRCP_MEDIA_ATTR_DURATION 0x07
- #define HAL_OP_AVRCP_GET_ELEMENT_ATTRS_TEXT 0x07
- struct hal_cmd_avrcp_get_element_attrs_text {
- uint8_t number;
- struct hal_avrcp_player_setting_text values[0];
- } __attribute__((packed));
- #define HAL_OP_AVRCP_SET_PLAYER_ATTRS_VALUE 0x08
- struct hal_cmd_avrcp_set_player_attrs_value {
- uint8_t status;
- } __attribute__((packed));
- #define HAL_AVRCP_EVENT_STATUS_CHANGED 0x01
- #define HAL_AVRCP_EVENT_TRACK_CHANGED 0x02
- #define HAL_AVRCP_EVENT_TRACK_REACHED_END 0x03
- #define HAL_AVRCP_EVENT_TRACK_REACHED_START 0x04
- #define HAL_AVRCP_EVENT_POSITION_CHANGED 0x05
- #define HAL_AVRCP_EVENT_SETTING_CHANGED 0x08
- #define HAL_AVRCP_EVENT_TYPE_INTERIM 0x00
- #define HAL_AVRCP_EVENT_TYPE_CHANGED 0x01
- #define HAL_OP_AVRCP_REGISTER_NOTIFICATION 0x09
- struct hal_cmd_avrcp_register_notification {
- uint8_t event;
- uint8_t type;
- uint8_t len;
- uint8_t data[0];
- } __attribute__((packed));
- #define HAL_OP_AVRCP_SET_VOLUME 0x0a
- struct hal_cmd_avrcp_set_volume {
- uint8_t value;
- } __attribute__((packed));
- /* AVRCP CTRL HAL API */
- #define HAL_OP_AVRCP_CTRL_SEND_PASSTHROUGH 0x01
- struct hal_cmd_avrcp_ctrl_send_passthrough {
- uint8_t bdaddr[6];
- uint8_t key_code;
- uint8_t key_state;
- } __attribute__((packed));
- /* GATT HAL API */
- #define HAL_OP_GATT_CLIENT_REGISTER 0x01
- struct hal_cmd_gatt_client_register {
- uint8_t uuid[16];
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_UNREGISTER 0x02
- struct hal_cmd_gatt_client_unregister {
- int32_t client_if;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_SCAN 0x03
- struct hal_cmd_gatt_client_scan {
- int32_t client_if;
- uint8_t start;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_CONNECT 0x04
- struct hal_cmd_gatt_client_connect {
- int32_t client_if;
- uint8_t bdaddr[6];
- uint8_t is_direct;
- int32_t transport;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_DISCONNECT 0x05
- struct hal_cmd_gatt_client_disconnect {
- int32_t client_if;
- uint8_t bdaddr[6];
- int32_t conn_id;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_LISTEN 0x06
- struct hal_cmd_gatt_client_listen {
- int32_t client_if;
- uint8_t start;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_REFRESH 0x07
- struct hal_cmd_gatt_client_refresh {
- int32_t client_if;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_SEARCH_SERVICE 0x08
- struct hal_cmd_gatt_client_search_service {
- int32_t conn_id;
- uint8_t filtered;
- uint8_t filter_uuid[0];
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_GET_INCLUDED_SERVICE 0x09
- struct hal_gatt_srvc_id {
- uint8_t uuid[16];
- uint8_t inst_id;
- uint8_t is_primary;
- } __attribute__((packed));
- struct hal_cmd_gatt_client_get_included_service {
- int32_t conn_id;
- struct hal_gatt_srvc_id srvc_id;
- uint8_t continuation;
- struct hal_gatt_srvc_id incl_srvc_id[0];
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_GET_CHARACTERISTIC 0x0a
- struct hal_gatt_gatt_id {
- uint8_t uuid[16];
- uint8_t inst_id;
- } __attribute__((packed));
- struct hal_cmd_gatt_client_get_characteristic {
- int32_t conn_id;
- struct hal_gatt_srvc_id srvc_id;
- uint8_t continuation;
- struct hal_gatt_gatt_id char_id[0];
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_GET_DESCRIPTOR 0x0b
- struct hal_cmd_gatt_client_get_descriptor {
- int32_t conn_id;
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- uint8_t continuation;
- struct hal_gatt_gatt_id descr_id[0];
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_READ_CHARACTERISTIC 0x0c
- struct hal_cmd_gatt_client_read_characteristic {
- int32_t conn_id;
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- int32_t auth_req;
- } __attribute__((packed));
- #define GATT_WRITE_TYPE_NO_RESPONSE 0x01
- #define GATT_WRITE_TYPE_DEFAULT 0x02
- #define GATT_WRITE_TYPE_PREPARE 0x03
- #define GATT_WRITE_TYPE_SIGNED 0x04
- #define HAL_OP_GATT_CLIENT_WRITE_CHARACTERISTIC 0x0d
- struct hal_cmd_gatt_client_write_characteristic {
- int32_t conn_id;
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- int32_t write_type;
- int32_t len;
- int32_t auth_req;
- uint8_t value[0];
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_READ_DESCRIPTOR 0x0e
- struct hal_cmd_gatt_client_read_descriptor {
- int32_t conn_id;
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- struct hal_gatt_gatt_id descr_id;
- int32_t auth_req;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_WRITE_DESCRIPTOR 0x0f
- struct hal_cmd_gatt_client_write_descriptor {
- int32_t conn_id;
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- struct hal_gatt_gatt_id descr_id;
- int32_t write_type;
- int32_t len;
- int32_t auth_req;
- uint8_t value[0];
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_EXECUTE_WRITE 0x10
- struct hal_cmd_gatt_client_execute_write {
- int32_t conn_id;
- int32_t execute;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_REGISTER_FOR_NOTIFICATION 0x11
- struct hal_cmd_gatt_client_register_for_notification {
- int32_t client_if;
- uint8_t bdaddr[6];
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_DEREGISTER_FOR_NOTIFICATION 0x12
- struct hal_cmd_gatt_client_deregister_for_notification {
- int32_t client_if;
- uint8_t bdaddr[6];
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_READ_REMOTE_RSSI 0x13
- struct hal_cmd_gatt_client_read_remote_rssi {
- int32_t client_if;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_GET_DEVICE_TYPE 0x14
- struct hal_cmd_gatt_client_get_device_type {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- struct hal_rsp_gatt_client_get_device_type {
- uint8_t type;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_SET_ADV_DATA 0x015
- struct hal_cmd_gatt_client_set_adv_data {
- int32_t server_if;
- uint8_t set_scan_rsp;
- uint8_t include_name;
- uint8_t include_txpower;
- int32_t min_interval;
- int32_t max_interval;
- int32_t appearance;
- uint16_t manufacturer_len;
- uint16_t service_data_len;
- uint16_t service_uuid_len;
- uint8_t data[0];
- } __attribute__((packed));
- #define GATT_CLIENT_TEST_CMD_ENABLE 0x01
- #define GATT_CLIENT_TEST_CMD_CONNECT 0x02
- #define GATT_CLIENT_TEST_CMD_DISCONNECT 0x03
- #define GATT_CLIENT_TEST_CMD_DISCOVER 0x04
- #define GATT_CLIENT_TEST_CMD_READ 0xe0
- #define GATT_CLIENT_TEST_CMD_WRITE 0xe1
- #define GATT_CLIENT_TEST_CMD_INCREASE_SECURITY 0xe2
- #define GATT_CLIENT_TEST_CMD_PAIRING_CONFIG 0xf0
- #define HAL_OP_GATT_CLIENT_TEST_COMMAND 0x16
- struct hal_cmd_gatt_client_test_command {
- int32_t command;
- uint8_t bda1[6];
- uint8_t uuid1[16];
- uint16_t u1;
- uint16_t u2;
- uint16_t u3;
- uint16_t u4;
- uint16_t u5;
- } __attribute__((packed));
- #define HAL_OP_GATT_SERVER_REGISTER 0x17
- struct hal_cmd_gatt_server_register {
- uint8_t uuid[16];
- } __attribute__((packed));
- #define HAL_OP_GATT_SERVER_UNREGISTER 0x18
- struct hal_cmd_gatt_server_unregister {
- int32_t server_if;
- } __attribute__((packed));
- #define HAL_OP_GATT_SERVER_CONNECT 0x19
- struct hal_cmd_gatt_server_connect {
- int32_t server_if;
- uint8_t bdaddr[6];
- uint8_t is_direct;
- int32_t transport;
- } __attribute__((packed));
- #define HAL_OP_GATT_SERVER_DISCONNECT 0x1a
- struct hal_cmd_gatt_server_disconnect {
- int32_t server_if;
- uint8_t bdaddr[6];
- int32_t conn_id;
- } __attribute__((packed));
- #define HAL_OP_GATT_SERVER_ADD_SERVICE 0x1b
- struct hal_cmd_gatt_server_add_service {
- int32_t server_if;
- struct hal_gatt_srvc_id srvc_id;
- int32_t num_handles;
- } __attribute__((packed));
- #define HAL_OP_GATT_SERVER_ADD_INC_SERVICE 0x1c
- struct hal_cmd_gatt_server_add_inc_service {
- int32_t server_if;
- int32_t service_handle;
- int32_t included_handle;
- } __attribute__((packed));
- #define HAL_OP_GATT_SERVER_ADD_CHARACTERISTIC 0x1d
- struct hal_cmd_gatt_server_add_characteristic {
- int32_t server_if;
- int32_t service_handle;
- uint8_t uuid[16];
- int32_t properties;
- int32_t permissions;
- } __attribute__((packed));
- #define HAL_OP_GATT_SERVER_ADD_DESCRIPTOR 0x1e
- struct hal_cmd_gatt_server_add_descriptor {
- int32_t server_if;
- int32_t service_handle;
- uint8_t uuid[16];
- int32_t permissions;
- } __attribute__((packed));
- #define GATT_SERVER_TRANSPORT_LE_BIT 0x01
- #define GATT_SERVER_TRANSPORT_BREDR_BIT 0x02
- #define HAL_OP_GATT_SERVER_START_SERVICE 0x1f
- struct hal_cmd_gatt_server_start_service {
- int32_t server_if;
- int32_t service_handle;
- int32_t transport;
- } __attribute__((packed));
- #define HAL_OP_GATT_SERVER_STOP_SERVICE 0x20
- struct hal_cmd_gatt_server_stop_service {
- int32_t server_if;
- int32_t service_handle;
- } __attribute__((packed));
- #define HAL_OP_GATT_SERVER_DELETE_SERVICE 0x21
- struct hal_cmd_gatt_server_delete_service {
- int32_t server_if;
- int32_t service_handle;
- } __attribute__((packed));
- #define HAL_OP_GATT_SERVER_SEND_INDICATION 0x22
- struct hal_cmd_gatt_server_send_indication {
- int32_t server_if;
- int32_t attribute_handle;
- int32_t conn_id;
- int32_t len;
- int32_t confirm;
- uint8_t value[0];
- } __attribute__((packed));
- #define HAL_OP_GATT_SERVER_SEND_RESPONSE 0x23
- struct hal_cmd_gatt_server_send_response {
- int32_t conn_id;
- int32_t trans_id;
- uint16_t handle;
- uint16_t offset;
- uint8_t auth_req;
- int32_t status;
- uint16_t len;
- uint8_t data[0];
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_SCAN_FILTER_SETUP 0x024
- struct hal_cmd_gatt_client_scan_filter_setup {
- int32_t client_if;
- int32_t action;
- int32_t filter_index;
- int32_t features;
- int32_t list_type;
- int32_t filter_type;
- int32_t rssi_hi;
- int32_t rssi_lo;
- int32_t delivery_mode;
- int32_t found_timeout;
- int32_t lost_timeout;
- int32_t found_timeout_cnt;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_SCAN_FILTER_ADD_REMOVE 0x025
- struct hal_cmd_gatt_client_scan_filter_add_remove {
- int32_t client_if;
- int32_t action;
- int32_t filter_type;
- int32_t filter_index;
- int32_t company_id;
- int32_t company_id_mask;
- uint8_t uuid[16];
- uint8_t uuid_mask[16];
- uint8_t address[6];
- uint8_t address_type;
- int32_t data_len;
- int32_t mask_len;
- uint8_t data_mask[0]; /* common buffer for data and mask */
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_SCAN_FILTER_CLEAR 0x26
- struct hal_cmd_gatt_client_scan_filter_clear {
- int32_t client_if;
- int32_t index;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_SCAN_FILTER_ENABLE 0x27
- struct hal_cmd_gatt_client_scan_filter_enable {
- int32_t client_if;
- uint8_t enable;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_CONFIGURE_MTU 0x28
- struct hal_cmd_gatt_client_configure_mtu {
- int32_t conn_id;
- int32_t mtu;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_CONN_PARAM_UPDATE 0x29
- struct hal_cmd_gatt_client_conn_param_update {
- uint8_t address[6];
- int32_t min_interval;
- int32_t max_interval;
- int32_t latency;
- int32_t timeout;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_SET_SCAN_PARAM 0x2a
- struct hal_cmd_gatt_client_set_scan_param {
- int32_t interval;
- int32_t window;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_SETUP_MULTI_ADV 0x2b
- struct hal_cmd_gatt_client_setup_multi_adv {
- int32_t client_if;
- int32_t min_interval;
- int32_t max_interval;
- int32_t type;
- int32_t channel_map;
- int32_t tx_power;
- int32_t timeout;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_UPDATE_MULTI_ADV 0x2c
- struct hal_cmd_gatt_client_update_multi_adv {
- int32_t client_if;
- int32_t min_interval;
- int32_t max_interval;
- int32_t type;
- int32_t channel_map;
- int32_t tx_power;
- int32_t timeout;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_SETUP_MULTI_ADV_INST 0x2d
- struct hal_cmd_gatt_client_setup_multi_adv_inst {
- int32_t client_if;
- uint8_t set_scan_rsp;
- uint8_t include_name;
- uint8_t include_tx_power;
- int32_t appearance;
- int32_t manufacturer_data_len;
- int32_t service_data_len;
- int32_t service_uuid_len;
- uint8_t data_service_uuid[0];
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_DISABLE_MULTI_ADV_INST 0x2e
- struct hal_cmd_gatt_client_disable_multi_adv_inst {
- int32_t client_if;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_CONFIGURE_BATCHSCAN 0x2f
- struct hal_cmd_gatt_client_configure_batchscan {
- int32_t client_if;
- int32_t full_max;
- int32_t trunc_max;
- int32_t notify_threshold;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_ENABLE_BATCHSCAN 0x30
- struct hal_cmd_gatt_client_enable_batchscan {
- int32_t client_if;
- int32_t mode;
- int32_t interval;
- int32_t window;
- int32_t address_type;
- int32_t discard_rule;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_DISABLE_BATCHSCAN 0x31
- struct hal_cmd_gatt_client_disable_batchscan {
- int32_t client_if;
- } __attribute__((packed));
- #define HAL_OP_GATT_CLIENT_READ_BATCHSCAN_REPORTS 0x32
- struct hal_cmd_gatt_client_read_batchscan_reports {
- int32_t client_if;
- int32_t scan_mode;
- } __attribute__((packed));
- /* Handsfree client HAL API */
- #define HAL_OP_HF_CLIENT_CONNECT 0x01
- struct hal_cmd_hf_client_connect {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HF_CLIENT_DISCONNECT 0x02
- struct hal_cmd_hf_client_disconnect {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HF_CLIENT_CONNECT_AUDIO 0x03
- struct hal_cmd_hf_client_connect_audio {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HF_CLIENT_DISCONNECT_AUDIO 0x04
- struct hal_cmd_hf_client_disconnect_audio {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_OP_HF_CLIENT_START_VR 0x05
- #define HAL_OP_HF_CLIENT_STOP_VR 0x06
- #define HF_CLIENT_VOLUME_TYPE_SPEAKER 0x00
- #define HF_CLIENT_VOLUME_TYPE_MIC 0x01
- #define HAL_OP_HF_CLIENT_VOLUME_CONTROL 0x07
- struct hal_cmd_hf_client_volume_control {
- uint8_t type;
- uint8_t volume;
- } __attribute__((packed));
- #define HAL_OP_HF_CLIENT_DIAL 0x08
- struct hal_cmd_hf_client_dial {
- uint16_t number_len;
- uint8_t number[0];
- } __attribute__((packed));
- #define HAL_OP_HF_CLIENT_DIAL_MEMORY 0x09
- struct hal_cmd_hf_client_dial_memory {
- int32_t location;
- } __attribute__((packed));
- #define HAL_HF_CLIENT_ACTION_CHLD_0 0x00
- #define HAL_HF_CLIENT_ACTION_CHLD_1 0x01
- #define HAL_HF_CLIENT_ACTION_CHLD_2 0x02
- #define HAL_HF_CLIENT_ACTION_CHLD_3 0x03
- #define HAL_HF_CLIENT_ACTION_CHLD_4 0x04
- #define HAL_HF_CLIENT_ACTION_CHLD_1x 0x05
- #define HAL_HF_CLIENT_ACTION_CHLD_2x 0x06
- #define HAL_HF_CLIENT_ACTION_ATA 0x07
- #define HAL_HF_CLIENT_ACTION_CHUP 0x08
- #define HAL_HF_CLIENT_ACTION_BRTH_0 0x09
- #define HAL_HF_CLIENT_ACTION_BRTH_1 0x0a
- #define HAL_HF_CLIENT_ACTION_BRTH_2 0x0b
- #define HAL_OP_HF_CLIENT_CALL_ACTION 0x0a
- struct hal_cmd_hf_client_call_action {
- uint8_t action;
- int32_t index;
- } __attribute__((packed));
- #define HAL_OP_HF_CLIENT_QUERY_CURRENT_CALLS 0x0b
- #define HAL_OP_HF_CLIENT_QUERY_OPERATOR_NAME 0x0c
- #define HAL_OP_HF_CLIENT_RETRIEVE_SUBSCR_INFO 0x0d
- #define HAL_OP_HF_CLIENT_SEND_DTMF 0x0e
- struct hal_cmd_hf_client_send_dtmf {
- uint8_t tone;
- } __attribute__((packed));
- #define HAL_OP_HF_CLIENT_GET_LAST_VOICE_TAG_NUM 0x0f
- /* MAP CLIENT HAL API */
- #define HAL_OP_MAP_CLIENT_GET_INSTANCES 0x01
- struct hal_cmd_map_client_get_instances {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- /* Notifications and confirmations */
- #define HAL_POWER_OFF 0x00
- #define HAL_POWER_ON 0x01
- #define HAL_EV_ADAPTER_STATE_CHANGED 0x81
- struct hal_ev_adapter_state_changed {
- uint8_t state;
- } __attribute__((packed));
- #define HAL_EV_ADAPTER_PROPS_CHANGED 0x82
- struct hal_property {
- uint8_t type;
- uint16_t len;
- uint8_t val[0];
- } __attribute__((packed));
- struct hal_ev_adapter_props_changed {
- uint8_t status;
- uint8_t num_props;
- struct hal_property props[0];
- } __attribute__((packed));
- #define HAL_EV_REMOTE_DEVICE_PROPS 0x83
- struct hal_ev_remote_device_props {
- uint8_t status;
- uint8_t bdaddr[6];
- uint8_t num_props;
- struct hal_property props[0];
- } __attribute__((packed));
- #define HAL_EV_DEVICE_FOUND 0x84
- struct hal_ev_device_found {
- uint8_t num_props;
- struct hal_property props[0];
- } __attribute__((packed));
- #define HAL_DISCOVERY_STATE_STOPPED 0x00
- #define HAL_DISCOVERY_STATE_STARTED 0x01
- #define HAL_EV_DISCOVERY_STATE_CHANGED 0x85
- struct hal_ev_discovery_state_changed {
- uint8_t state;
- } __attribute__((packed));
- #define HAL_EV_PIN_REQUEST 0x86
- struct hal_ev_pin_request {
- uint8_t bdaddr[6];
- uint8_t name[249];
- uint32_t class_of_dev;
- } __attribute__((packed));
- #define HAL_EV_SSP_REQUEST 0x87
- struct hal_ev_ssp_request {
- uint8_t bdaddr[6];
- uint8_t name[249];
- uint32_t class_of_dev;
- uint8_t pairing_variant;
- uint32_t passkey;
- } __attribute__((packed));
- #define HAL_BOND_STATE_NONE 0
- #define HAL_BOND_STATE_BONDING 1
- #define HAL_BOND_STATE_BONDED 2
- #define HAL_EV_BOND_STATE_CHANGED 0x88
- struct hal_ev_bond_state_changed {
- uint8_t status;
- uint8_t bdaddr[6];
- uint8_t state;
- } __attribute__((packed));
- #define HAL_ACL_STATE_CONNECTED 0x00
- #define HAL_ACL_STATE_DISCONNECTED 0x01
- #define HAL_EV_ACL_STATE_CHANGED 0x89
- struct hal_ev_acl_state_changed {
- uint8_t status;
- uint8_t bdaddr[6];
- uint8_t state;
- } __attribute__((packed));
- #define HAL_EV_DUT_MODE_RECEIVE 0x8a
- struct hal_ev_dut_mode_receive {
- uint16_t opcode;
- uint8_t len;
- uint8_t data[0];
- } __attribute__((packed));
- #define HAL_EV_LE_TEST_MODE 0x8b
- struct hal_ev_le_test_mode {
- uint8_t status;
- uint16_t num_packets;
- } __attribute__((packed));
- #define HAL_EV_ENERGY_INFO 0x8c
- struct hal_ev_energy_info {
- uint8_t status;
- uint8_t ctrl_state;
- uint64_t tx_time;
- uint64_t rx_time;
- uint64_t idle_time;
- uint64_t energy_used;
- } __attribute__((packed));
- #define HAL_HIDHOST_STATE_CONNECTED 0x00
- #define HAL_HIDHOST_STATE_CONNECTING 0x01
- #define HAL_HIDHOST_STATE_DISCONNECTED 0x02
- #define HAL_HIDHOST_STATE_DISCONNECTING 0x03
- #define HAL_HIDHOST_STATE_NO_HID 0x07
- #define HAL_HIDHOST_STATE_FAILED 0x08
- #define HAL_HIDHOST_STATE_UNKNOWN 0x09
- #define HAL_EV_HIDHOST_CONN_STATE 0x81
- struct hal_ev_hidhost_conn_state {
- uint8_t bdaddr[6];
- uint8_t state;
- } __attribute__((packed));
- #define HAL_HIDHOST_STATUS_OK 0x00
- #define HAL_HIDHOST_HS_NOT_READY 0x01
- #define HAL_HIDHOST_HS_INVALID_RAPORT_ID 0x02
- #define HAL_HIDHOST_HS_TRANS_NOT_SUPPORTED 0x03
- #define HAL_HIDHOST_HS_INVALID_PARAM 0x04
- #define HAL_HIDHOST_HS_ERROR 0x05
- #define HAL_HIDHOST_GENERAL_ERROR 0x06
- #define HAL_HIDHOST_SDP_ERROR 0x07
- #define HAL_HIDHOST_PROTOCOL_ERROR 0x08
- #define HAL_HIDHOST_DB_ERROR 0x09
- #define HAL_HIDHOST_TOD_UNSUPPORTED_ERROR 0x0a
- #define HAL_HIDHOST_NO_RESOURCES_ERROR 0x0b
- #define HAL_HIDHOST_AUTH_FAILED_ERROR 0x0c
- #define HAL_HIDHOST_HDL_ERROR 0x0d
- #define HAL_EV_HIDHOST_INFO 0x82
- struct hal_ev_hidhost_info {
- uint8_t bdaddr[6];
- uint8_t attr;
- uint8_t subclass;
- uint8_t app_id;
- uint16_t vendor;
- uint16_t product;
- uint16_t version;
- uint8_t country;
- uint16_t descr_len;
- uint8_t descr[884];
- } __attribute__((packed));
- #define HAL_EV_HIDHOST_PROTO_MODE 0x83
- struct hal_ev_hidhost_proto_mode {
- uint8_t bdaddr[6];
- uint8_t status;
- uint8_t mode;
- } __attribute__((packed));
- #define HAL_EV_HIDHOST_IDLE_TIME 0x84
- struct hal_ev_hidhost_idle_time {
- uint8_t bdaddr[6];
- uint8_t status;
- uint32_t idle_rate;
- } __attribute__((packed));
- #define HAL_EV_HIDHOST_GET_REPORT 0x85
- struct hal_ev_hidhost_get_report {
- uint8_t bdaddr[6];
- uint8_t status;
- uint16_t len;
- uint8_t data[0];
- } __attribute__((packed));
- #define HAL_EV_HIDHOST_VIRTUAL_UNPLUG 0x86
- struct hal_ev_hidhost_virtual_unplug {
- uint8_t bdaddr[6];
- uint8_t status;
- } __attribute__((packed));
- #define HAL_EV_HIDHOST_HANDSHAKE 0x87
- struct hal_ev_hidhost_handshake {
- uint8_t bdaddr[6];
- uint8_t status;
- } __attribute__((packed));
- #define HAL_EV_PAN_CTRL_STATE 0x81
- struct hal_ev_pan_ctrl_state {
- uint8_t state;
- uint8_t status;
- uint8_t local_role;
- uint8_t name[17];
- } __attribute__((packed));
- #define HAL_EV_PAN_CONN_STATE 0x82
- struct hal_ev_pan_conn_state {
- uint8_t state;
- uint8_t status;
- uint8_t bdaddr[6];
- uint8_t local_role;
- uint8_t remote_role;
- } __attribute__((packed));
- #define HAL_HEALTH_APP_REG_SUCCESS 0x00
- #define HAL_HEALTH_APP_REG_FAILED 0x01
- #define HAL_HEALTH_APP_DEREG_SUCCESS 0x02
- #define HAL_HEALTH_APP_DEREG_FAILED 0x03
- #define HAL_HEALTH_CHANNEL_CONNECTING 0x00
- #define HAL_HEALTH_CHANNEL_CONNECTED 0x01
- #define HAL_HEALTH_CHANNEL_DISCONNECTING 0x02
- #define HAL_HEALTH_CHANNEL_DISCONNECTED 0x03
- #define HAL_HEALTH_CHANNEL_DESTROYED 0x04
- #define HAL_EV_HEALTH_APP_REG_STATE 0x81
- struct hal_ev_health_app_reg_state {
- uint16_t id;
- uint8_t state;
- } __attribute__((packed));
- #define HAL_EV_HEALTH_CHANNEL_STATE 0x82
- struct hal_ev_health_channel_state {
- uint16_t app_id;
- uint8_t bdaddr[6];
- uint8_t mdep_index;
- uint16_t channel_id;
- uint8_t channel_state;
- } __attribute__((packed));
- #define HAL_A2DP_STATE_DISCONNECTED 0x00
- #define HAL_A2DP_STATE_CONNECTING 0x01
- #define HAL_A2DP_STATE_CONNECTED 0x02
- #define HAL_A2DP_STATE_DISCONNECTING 0x03
- #define HAL_EV_A2DP_CONN_STATE 0x81
- struct hal_ev_a2dp_conn_state {
- uint8_t state;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_AUDIO_SUSPEND 0x00
- #define HAL_AUDIO_STOPPED 0x01
- #define HAL_AUDIO_STARTED 0x02
- #define HAL_EV_A2DP_AUDIO_STATE 0x82
- struct hal_ev_a2dp_audio_state {
- uint8_t state;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_A2DP_AUDIO_CONFIG 0x83
- struct hal_ev_a2dp_audio_config {
- uint8_t bdaddr[6];
- uint32_t sample_rate;
- uint8_t channel_count;
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTED 0x00
- #define HAL_EV_HANDSFREE_CONN_STATE_CONNECTING 0x01
- #define HAL_EV_HANDSFREE_CONN_STATE_CONNECTED 0x02
- #define HAL_EV_HANDSFREE_CONN_STATE_SLC_CONNECTED 0x03
- #define HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTING 0x04
- #define HAL_EV_HANDSFREE_CONN_STATE 0x81
- struct hal_ev_handsfree_conn_state {
- uint8_t state;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTED 0x00
- #define HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTING 0x01
- #define HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTED 0x02
- #define HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTING 0x03
- #define HAL_EV_HANDSFREE_AUDIO_STATE 0x82
- struct hal_ev_handsfree_audio_state {
- uint8_t state;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_HANDSFREE_VR_STOPPED 0x00
- #define HAL_HANDSFREE_VR_STARTED 0x01
- #define HAL_EV_HANDSFREE_VR 0x83
- struct hal_ev_handsfree_vr_state {
- uint8_t state;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_ANSWER 0x84
- struct hal_ev_handsfree_answer {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_HANGUP 0x85
- struct hal_ev_handsfree_hangup {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_VOLUME 0x86
- struct hal_ev_handsfree_volume {
- uint8_t type;
- uint8_t volume;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_DIAL 0x87
- struct hal_ev_handsfree_dial {
- uint8_t bdaddr[6];
- uint16_t number_len;
- uint8_t number[0];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_DTMF 0x88
- struct hal_ev_handsfree_dtmf {
- uint8_t tone;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_HANDSFREE_NREC_STOP 0x00
- #define HAL_HANDSFREE_NREC_START 0x01
- #define HAL_EV_HANDSFREE_NREC 0x89
- struct hal_ev_handsfree_nrec {
- uint8_t nrec;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_HANDSFREE_CHLD_TYPE_RELEASEHELD 0x00
- #define HAL_HANDSFREE_CHLD_TYPE_RELEASEACTIVE_ACCEPTHELD 0x01
- #define HAL_HANDSFREE_CHLD_TYPE_HOLDACTIVE_ACCEPTHELD 0x02
- #define HAL_HANDSFREE_CHLD_TYPE_ADDHELDTOCONF 0x03
- #define HAL_EV_HANDSFREE_CHLD 0x8A
- struct hal_ev_handsfree_chld {
- uint8_t chld;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_CNUM 0x8B
- struct hal_ev_handsfree_cnum {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_CIND 0x8C
- struct hal_ev_handsfree_cind {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_COPS 0x8D
- struct hal_ev_handsfree_cops {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_CLCC 0x8E
- struct hal_ev_handsfree_clcc {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_UNKNOWN_AT 0x8F
- struct hal_ev_handsfree_unknown_at {
- uint8_t bdaddr[6];
- uint16_t len;
- uint8_t buf[0];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_HSP_KEY_PRESS 0x90
- struct hal_ev_handsfree_hsp_key_press {
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_HANDSFREE_WBS 0x91
- struct hal_ev_handsfree_wbs {
- uint8_t wbs;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_AVRCP_FEATURE_NONE 0x00
- #define HAL_AVRCP_FEATURE_METADATA 0x01
- #define HAL_AVRCP_FEATURE_ABSOLUTE_VOLUME 0x02
- #define HAL_AVRCP_FEATURE_BROWSE 0x04
- #define HAL_EV_AVRCP_REMOTE_FEATURES 0x81
- struct hal_ev_avrcp_remote_features {
- uint8_t bdaddr[6];
- uint8_t features;
- } __attribute__((packed));
- #define HAL_EV_AVRCP_GET_PLAY_STATUS 0x82
- #define HAL_EV_AVRCP_LIST_PLAYER_ATTRS 0x83
- #define HAL_EV_AVRCP_LIST_PLAYER_VALUES 0x84
- struct hal_ev_avrcp_list_player_values {
- uint8_t attr;
- } __attribute__((packed));
- #define HAL_EV_AVRCP_GET_PLAYER_VALUES 0x85
- struct hal_ev_avrcp_get_player_values {
- uint8_t number;
- uint8_t attrs[0];
- } __attribute__((packed));
- #define HAL_EV_AVRCP_GET_PLAYER_ATTRS_TEXT 0x86
- struct hal_ev_avrcp_get_player_attrs_text {
- uint8_t number;
- uint8_t attrs[0];
- } __attribute__((packed));
- #define HAL_EV_AVRCP_GET_PLAYER_VALUES_TEXT 0x87
- struct hal_ev_avrcp_get_player_values_text {
- uint8_t attr;
- uint8_t number;
- uint8_t values[0];
- } __attribute__((packed));
- #define HAL_EV_AVRCP_SET_PLAYER_VALUES 0x88
- struct hal_ev_avrcp_set_player_values {
- uint8_t number;
- struct hal_avrcp_player_attr_value attrs[0];
- } __attribute__((packed));
- #define HAL_EV_AVRCP_GET_ELEMENT_ATTRS 0x89
- struct hal_ev_avrcp_get_element_attrs {
- uint8_t number;
- uint8_t attrs[0];
- } __attribute__((packed));
- #define HAL_EV_AVRCP_REGISTER_NOTIFICATION 0x8a
- struct hal_ev_avrcp_register_notification {
- uint8_t event;
- uint32_t param;
- } __attribute__((packed));
- #define HAL_EV_AVRCP_VOLUME_CHANGED 0x8b
- struct hal_ev_avrcp_volume_changed {
- uint8_t volume;
- uint8_t type;
- } __attribute__((packed));
- #define HAL_EV_AVRCP_PASSTHROUGH_CMD 0x8c
- struct hal_ev_avrcp_passthrough_cmd {
- uint8_t id;
- uint8_t state;
- } __attribute__((packed));
- #define HAL_EV_AVRCP_CTRL_CONN_STATE 0x81
- struct hal_ev_avrcp_ctrl_conn_state {
- uint8_t state;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_AVRCP_CTRL_PASSTHROUGH_RSP 0x82
- struct hal_ev_avrcp_ctrl_passthrough_rsp {
- uint8_t id;
- uint8_t key_state;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_REGISTER_CLIENT 0x81
- struct hal_ev_gatt_client_register_client {
- int32_t status;
- int32_t client_if;
- uint8_t app_uuid[16];
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_SCAN_RESULT 0x82
- struct hal_ev_gatt_client_scan_result {
- uint8_t bda[6];
- int32_t rssi;
- uint16_t len;
- uint8_t adv_data[0];
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_CONNECT 0x83
- struct hal_ev_gatt_client_connect {
- int32_t conn_id;
- int32_t status;
- int32_t client_if;
- uint8_t bda[6];
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_DISCONNECT 0x84
- struct hal_ev_gatt_client_disconnect {
- int32_t conn_id;
- int32_t status;
- int32_t client_if;
- uint8_t bda[6];
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_SEARCH_COMPLETE 0x85
- struct hal_ev_gatt_client_search_complete {
- int32_t conn_id;
- int32_t status;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_SEARCH_RESULT 0x86
- struct hal_ev_gatt_client_search_result {
- int32_t conn_id;
- struct hal_gatt_srvc_id srvc_id;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_GET_CHARACTERISTIC 0x87
- struct hal_ev_gatt_client_get_characteristic {
- int32_t conn_id;
- int32_t status;
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- int32_t char_prop;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_GET_DESCRIPTOR 0x88
- struct hal_ev_gatt_client_get_descriptor {
- int32_t conn_id;
- int32_t status;
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- struct hal_gatt_gatt_id descr_id;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_GET_INC_SERVICE 0X89
- struct hal_ev_gatt_client_get_inc_service {
- int32_t conn_id;
- int32_t status;
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_srvc_id incl_srvc_id;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_REGISTER_FOR_NOTIF 0x8a
- struct hal_ev_gatt_client_reg_for_notif {
- int32_t conn_id;
- int32_t registered;
- int32_t status;
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_NOTIFY 0x8b
- struct hal_ev_gatt_client_notify {
- int32_t conn_id;
- uint8_t bda[6];
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- uint8_t is_notify;
- uint16_t len;
- uint8_t value[0];
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_READ_CHARACTERISTIC 0x8c
- struct hal_gatt_read_params {
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- struct hal_gatt_gatt_id descr_id;
- uint8_t status;
- uint16_t value_type;
- uint16_t len;
- uint8_t value[0];
- } __attribute__((packed));
- struct hal_ev_gatt_client_read_characteristic {
- int32_t conn_id;
- int32_t status;
- struct hal_gatt_read_params data;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_WRITE_CHARACTERISTIC 0x8d
- struct hal_gatt_write_params {
- struct hal_gatt_srvc_id srvc_id;
- struct hal_gatt_gatt_id char_id;
- struct hal_gatt_gatt_id descr_id;
- uint8_t status;
- } __attribute__((packed));
- struct hal_ev_gatt_client_write_characteristic {
- int32_t conn_id;
- int32_t status;
- struct hal_gatt_write_params data;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_READ_DESCRIPTOR 0x8e
- struct hal_ev_gatt_client_read_descriptor {
- int32_t conn_id;
- int32_t status;
- struct hal_gatt_read_params data;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_WRITE_DESCRIPTOR 0x8f
- struct hal_ev_gatt_client_write_descriptor {
- int32_t conn_id;
- int32_t status;
- struct hal_gatt_write_params data;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_EXEC_WRITE 0x90
- struct hal_ev_gatt_client_exec_write {
- int32_t conn_id;
- int32_t status;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_READ_REMOTE_RSSI 0x91
- struct hal_ev_gatt_client_read_remote_rssi {
- int32_t client_if;
- uint8_t address[6];
- int32_t rssi;
- int32_t status;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_LISTEN 0x92
- struct hal_ev_gatt_client_listen {
- int32_t status;
- int32_t server_if;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_REGISTER 0x93
- struct hal_ev_gatt_server_register {
- int32_t status;
- int32_t server_if;
- uint8_t uuid[16];
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_CONNECTION 0x94
- struct hal_ev_gatt_server_connection {
- int32_t conn_id;
- int32_t server_if;
- int32_t connected;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_SERVICE_ADDED 0x95
- struct hal_ev_gatt_server_service_added {
- int32_t status;
- int32_t server_if;
- struct hal_gatt_srvc_id srvc_id;
- int32_t srvc_handle;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_INC_SRVC_ADDED 0x96
- struct hal_ev_gatt_server_inc_srvc_added {
- int32_t status;
- int32_t server_if;
- int32_t srvc_handle;
- int32_t incl_srvc_handle;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_CHAR_ADDED 0x97
- struct hal_ev_gatt_server_characteristic_added {
- int32_t status;
- int32_t server_if;
- uint8_t uuid[16];
- int32_t srvc_handle;
- int32_t char_handle;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_DESCRIPTOR_ADDED 0x98
- struct hal_ev_gatt_server_descriptor_added {
- int32_t status;
- int32_t server_if;
- uint8_t uuid[16];
- int32_t srvc_handle;
- int32_t descr_handle;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_SERVICE_STARTED 0x99
- struct hal_ev_gatt_server_service_started {
- int32_t status;
- int32_t server_if;
- int32_t srvc_handle;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_SERVICE_STOPPED 0x9a
- struct hal_ev_gatt_server_service_stopped {
- int32_t status;
- int32_t server_if;
- int32_t srvc_handle;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_SERVICE_DELETED 0x9b
- struct hal_ev_gatt_server_service_deleted {
- int32_t status;
- int32_t server_if;
- int32_t srvc_handle;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_REQUEST_READ 0x9c
- struct hal_ev_gatt_server_request_read {
- int32_t conn_id;
- int32_t trans_id;
- uint8_t bdaddr[6];
- int32_t attr_handle;
- int32_t offset;
- uint8_t is_long;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_REQUEST_WRITE 0x9d
- struct hal_ev_gatt_server_request_write {
- int32_t conn_id;
- int32_t trans_id;
- uint8_t bdaddr[6];
- int32_t attr_handle;
- int32_t offset;
- int32_t length;
- uint8_t need_rsp;
- uint8_t is_prep;
- uint8_t value[0];
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_REQUEST_EXEC_WRITE 0x9e
- struct hal_ev_gatt_server_request_exec_write {
- int32_t conn_id;
- int32_t trans_id;
- uint8_t bdaddr[6];
- int32_t exec_write;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_RSP_CONFIRMATION 0x9f
- struct hal_ev_gatt_server_rsp_confirmation {
- int32_t status;
- int32_t handle;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_CONFIGURE_MTU 0xa0
- struct hal_ev_gatt_client_configure_mtu {
- int32_t conn_id;
- int32_t status;
- int32_t mtu;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_FILTER_CONFIG 0xa1
- struct hal_ev_gatt_client_filter_config {
- int32_t action;
- int32_t client_if;
- int32_t status;
- int32_t type;
- int32_t space;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_FILTER_PARAMS 0xa2
- struct hal_ev_gatt_client_filter_params {
- int32_t action;
- int32_t client_if;
- int32_t status;
- int32_t space;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_FILTER_STATUS 0xa3
- struct hal_ev_gatt_client_filter_status {
- int32_t enable;
- int32_t client_if;
- int32_t status;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_MULTI_ADV_ENABLE 0xa4
- struct hal_ev_gatt_client_multi_adv_enable {
- int32_t client_if;
- int32_t status;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_MULTI_ADV_UPDATE 0xa5
- struct hal_ev_gatt_client_multi_adv_update {
- int32_t client_if;
- int32_t status;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_MULTI_ADV_DATA 0xa6
- struct hal_ev_gatt_client_multi_adv_data {
- int32_t client_if;
- int32_t status;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_MULTI_ADV_DISABLE 0xa7
- struct hal_ev_gatt_client_multi_adv_disable {
- int32_t client_if;
- int32_t status;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_CONGESTION 0xa8
- struct hal_ev_gatt_client_congestion {
- int32_t conn_id;
- uint8_t congested;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_CONFIG_BATCHSCAN 0xa9
- struct hal_ev_gatt_client_config_batchscan {
- int32_t client_if;
- int32_t status;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_ENABLE_BATCHSCAN 0xaa
- struct hal_ev_gatt_client_enable_batchscan {
- int32_t action;
- int32_t client_if;
- int32_t status;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_BATCHSCAN_REPORTS 0xab
- struct hal_ev_gatt_client_batchscan_reports {
- int32_t client_if;
- int32_t status;
- int32_t format;
- int32_t num;
- int32_t data_len;
- uint8_t data[0];
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_BATCHSCAN_THRESHOLD 0xac
- struct hal_ev_gatt_client_batchscan_threshold {
- int32_t client_if;
- } __attribute__((packed));
- #define HAL_EV_GATT_CLIENT_TRACK_ADV 0xad
- struct hal_ev_gatt_client_track_adv {
- int32_t client_if;
- int32_t filetr_index;
- int32_t address_type;
- uint8_t address[6];
- int32_t state;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_INDICATION_SENT 0xae
- struct hal_ev_gatt_server_indication_sent {
- int32_t conn_id;
- int32_t status;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_CONGESTION 0xaf
- struct hal_ev_gatt_server_congestion {
- int32_t conn_id;
- uint8_t congested;
- } __attribute__((packed));
- #define HAL_EV_GATT_SERVER_MTU_CHANGED 0xb0
- struct hal_ev_gatt_server_mtu_changed {
- int32_t conn_id;
- int32_t mtu;
- } __attribute__((packed));
- #define HAL_GATT_PERMISSION_READ 0x0001
- #define HAL_GATT_PERMISSION_READ_ENCRYPTED 0x0002
- #define HAL_GATT_PERMISSION_READ_ENCRYPTED_MITM 0x0004
- #define HAL_GATT_PERMISSION_WRITE 0x0010
- #define HAL_GATT_PERMISSION_WRITE_ENCRYPTED 0x0020
- #define HAL_GATT_PERMISSION_WRITE_ENCRYPTED_MITM 0x0040
- #define HAL_GATT_PERMISSION_WRITE_SIGNED 0x0080
- #define HAL_GATT_PERMISSION_WRITE_SIGNED_MITM 0x0100
- #define HAL_GATT_AUTHENTICATION_NONE 0
- #define HAL_GATT_AUTHENTICATION_NO_MITM 1
- #define HAL_GATT_AUTHENTICATION_MITM 2
- #define HAL_HF_CLIENT_CONN_STATE_DISCONNECTED 0x00
- #define HAL_HF_CLIENT_CONN_STATE_CONNECTING 0x01
- #define HAL_HF_CLIENT_CONN_STATE_CONNECTED 0x02
- #define HAL_HF_CLIENT_CONN_STATE_SLC_CONNECTED 0x03
- #define HAL_HF_CLIENT_CONN_STATE_DISCONNECTING 0x04
- #define HAL_HF_CLIENT_PEER_FEAT_3WAY 0x00000001
- #define HAL_HF_CLIENT_PEER_FEAT_ECNR 0x00000002
- #define HAL_HF_CLIENT_PEER_FEAT_VREC 0x00000004
- #define HAL_HF_CLIENT_PEER_FEAT_INBAND 0x00000008
- #define HAL_HF_CLIENT_PEER_FEAT_VTAG 0x00000010
- #define HAL_HF_CLIENT_PEER_FEAT_REJECT 0x00000020
- #define HAL_HF_CLIENT_PEER_FEAT_ECS 0x00000040
- #define HAL_HF_CLIENT_PEER_FEAT_ECC 0x00000080
- #define HAL_HF_CLIENT_PEER_FEAT_EXTERR 0x00000100
- #define HAL_HF_CLIENT_PEER_FEAT_CODEC 0x00000200
- #define HAL_HF_CLIENT_CHLD_FEAT_REL 0x00000001
- #define HAL_HF_CLIENT_CHLD_FEAT_REL_ACC 0x00000002
- #define HAL_HF_CLIENT_CHLD_FEAT_REL_X 0x00000004
- #define HAL_HF_CLIENT_CHLD_FEAT_HOLD_ACC 0x00000008
- #define HAL_HF_CLIENT_CHLD_FEAT_PRIV_X 0x00000010
- #define HAL_HF_CLIENT_CHLD_FEAT_MERGE 0x00000020
- #define HAL_HF_CLIENT_CHLD_FEAT_MERGE_DETACH 0x00000040
- #define HAL_EV_HF_CLIENT_CONN_STATE 0x81
- struct hal_ev_hf_client_conn_state {
- uint8_t state;
- uint32_t peer_feat;
- uint32_t chld_feat;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_HF_CLIENT_AUDIO_STATE_DISCONNECTED 0x00
- #define HAL_HF_CLIENT_AUDIO_STATE_CONNECTING 0x01
- #define HAL_HF_CLIENT_AUDIO_STATE_CONNECTED 0x02
- #define HAL_HF_CLIENT_AUDIO_STATE_CONNECTED_MSBC 0x03
- #define HAL_EV_HF_CLIENT_AUDIO_STATE 0x82
- struct hal_ev_hf_client_audio_state {
- uint8_t state;
- uint8_t bdaddr[6];
- } __attribute__((packed));
- #define HAL_HF_CLIENT_VR_STOPPED 0x00
- #define HAL_HF_CLIENT_VR_STARTED 0x01
- #define HAL_EV_HF_CLIENT_VR_STATE 0x83
- struct hal_ev_hf_client_vr_state {
- uint8_t state;
- } __attribute__((packed));
- #define HAL_HF_CLIENT_NET_NOT_AVAILABLE 0x00
- #define HAL_HF_CLIENT_NET_AVAILABLE 0x01
- #define HAL_EV_HF_CLIENT_NET_STATE 0x84
- struct hal_ev_hf_client_net_state {
- uint8_t state;
- } __attribute__((packed));
- #define HAL_HF_CLIENT_NET_ROAMING_TYPE_HOME 0x00
- #define HAL_HF_CLIENT_NET_ROAMING_TYPE_ROAMING 0x01
- #define HAL_EV_HF_CLIENT_NET_ROAMING_TYPE 0x85
- struct hal_ev_hf_client_net_roaming_type {
- uint8_t state;
- } __attribute__((packed));
- #define HAL_EV_HF_CLIENT_NET_SIGNAL_STRENGTH 0x86
- struct hal_ev_hf_client_net_signal_strength {
- uint8_t signal_strength;
- } __attribute__((packed));
- #define HAL_EV_HF_CLIENT_BATTERY_LEVEL 0x87
- struct hal_ev_hf_client_battery_level {
- uint8_t battery_level;
- } __attribute__((packed));
- #define HAL_EV_HF_CLIENT_OPERATOR_NAME 0x88
- struct hal_ev_hf_client_operator_name {
- uint16_t name_len;
- uint8_t name[0];
- } __attribute__((packed));
- #define HAL_HF_CLIENT_CALL_IND_NO_CALL_IN_PROGERSS 0x00
- #define HAL_HF_CLIENT_CALL_IND_CALL_IN_PROGERSS 0x01
- #define HAL_EV_HF_CLIENT_CALL_INDICATOR 0x89
- struct hal_ev_hf_client_call_indicator {
- uint8_t call;
- } __attribute__((packed));
- #define HAL_HF_CLIENT_CALL_SETUP_NONE 0x00
- #define HAL_HF_CLIENT_CALL_SETUP_INCOMING 0x01
- #define HAL_HF_CLIENT_CALL_SETUP_OUTGOING 0x02
- #define HAL_HF_CLIENT_CALL_SETUP_ALERTING 0x03
- #define HAL_EV_HF_CLIENT_CALL_SETUP_INDICATOR 0x8a
- struct hal_ev_hf_client_call_setup_indicator {
- uint8_t call_setup;
- } __attribute__((packed));
- #define HAL_HF_CLIENT_CALL_HELD_IND_NONE 0x00
- #define HAL_HF_CLIENT_CALL_HELD_IND_HOLD_AND_ACTIVE 0x01
- #define HAL_HF_CLIENT_CALL_SETUP_IND_HOLD 0x02
- #define HAL_EV_HF_CLIENT_CALL_HELD_INDICATOR 0x8b
- struct hal_ev_hf_client_call_held_indicator {
- uint8_t call_held;
- } __attribute__((packed));
- #define HAL_HF_CLIENT_RESP_AND_HOLD_STATUS_HELD 0x00
- #define HAL_HF_CLIENT_RESP_AND_HOLD_STATUS_ACCEPT 0x01
- #define HAL_HF_CLIENT_RESP_AND_HOLD_STATUS_REJECT 0x02
- #define HAL_EV_HF_CLIENT_RESPONSE_AND_HOLD_STATUS 0x8c
- struct hal_ev_hf_client_response_and_hold_status {
- uint8_t status;
- } __attribute__((packed));
- #define HAL_EV_HF_CLIENT_CALLING_LINE_IDENT 0x8d
- struct hal_ev_hf_client_calling_line_ident {
- uint16_t number_len;
- uint8_t number[0];
- } __attribute__((packed));
- #define HAL_EV_HF_CLIENT_CALL_WAITING 0x8e
- struct hal_ev_hf_client_call_waiting {
- uint16_t number_len;
- uint8_t number[0];
- } __attribute__((packed));
- #define HAL_HF_CLIENT_DIRECTION_OUTGOING 0x00
- #define HAL_HF_CLIENT_DIRECTION_INCOMING 0x01
- #define HAL_HF_CLIENT_CALL_STATE_ACTIVE 0x00
- #define HAL_HF_CLIENT_CALL_STATE_HELD 0x01
- #define HAL_HF_CLIENT_CALL_STATE_DIALING 0x02
- #define HAL_HF_CLIENT_CALL_STATE_ALERTING 0x03
- #define HAL_HF_CLIENT_CALL_STATE_INCOMING 0x04
- #define HAL_HF_CLIENT_CALL_STATE_WAITING 0x05
- #define HAL_HF_CLIENT_CALL_STATE_HELD_BY_RESP_AND_HOLD 0x06
- #define HAL_EV_HF_CLIENT_CURRENT_CALL 0x8f
- struct hal_ev_hf_client_current_call {
- uint8_t index;
- uint8_t direction;
- uint8_t call_state;
- uint8_t multiparty;
- uint16_t number_len;
- uint8_t number[0];
- } __attribute__((packed));
- #define HAL_EV_CLIENT_VOLUME_CHANGED 0x90
- struct hal_ev_hf_client_volume_changed {
- uint8_t type;
- uint8_t volume;
- } __attribute__((packed));
- #define HAL_HF_CLIENT_CMD_COMP_OK 0x00
- #define HAL_HF_CLIENT_CMD_COMP_ERR 0x01
- #define HAL_HF_CLIENT_CMD_COMP_ERR_NO_CARRIER 0x02
- #define HAL_HF_CLIENT_CMD_COMP_ERR_BUSY 0x03
- #define HAL_HF_CLIENT_CMD_COMP_ERR_NO_ANSWER 0x04
- #define HAL_HF_CLIENT_CMD_COMP_ERR_DELAYED 0x05
- #define HAL_HF_CLIENT_CMD_COMP_ERR_BACKLISTED 0x06
- #define HAL_HF_CLIENT_CMD_COMP_ERR_CME 0x07
- #define HAL_EV_CLIENT_COMMAND_COMPLETE 0x91
- struct hal_ev_hf_client_command_complete {
- uint8_t type;
- uint8_t cme;
- } __attribute__((packed));
- #define HAL_HF_CLIENT_SUBSCR_TYPE_UNKNOWN 0x00
- #define HAL_HF_CLIENT_SUBSCR_TYPE_VOICE 0x01
- #define HAL_HF_CLIENT_SUBSCR_TYPE_FAX 0x02
- #define HAL_EV_CLIENT_SUBSCRIBER_SERVICE_INFO 0x92
- struct hal_ev_hf_client_subscriber_service_info {
- uint8_t type;
- uint16_t name_len;
- uint8_t name[0];
- } __attribute__((packed));
- #define HAL_HF_CLIENT_INBAND_RINGTONE_NOT_PROVIDED 0x00
- #define HAL_HF_CLIENT_INBAND_RINGTONE_PROVIDED 0x01
- #define HAL_EV_CLIENT_INBAND_SETTINGS 0x93
- struct hal_ev_hf_client_inband_settings {
- uint8_t state;
- } __attribute__((packed));
- #define HAL_EV_CLIENT_LAST_VOICE_CALL_TAG_NUM 0x94
- struct hal_ev_hf_client_last_void_call_tag_num {
- uint16_t number_len;
- uint8_t number[0];
- } __attribute__((packed));
- #define HAL_EV_CLIENT_RING_INDICATION 0x95
- #define HAL_EV_MAP_CLIENT_REMOTE_MAS_INSTANCES 0x81
- struct hal_map_client_mas_instance {
- int32_t id;
- int32_t scn;
- int32_t msg_types;
- int32_t name_len;
- uint8_t name[0];
- } __attribute__((packed));
- struct hal_ev_map_client_remote_mas_instances {
- int8_t status;
- uint8_t bdaddr[6];
- int32_t num_instances;
- struct hal_map_client_mas_instance instances[0];
- } __attribute__((packed));
|