*/
static const struct hal_ipc_handler ev_handlers[] = {
/* Client Event Handlers */
- {handle_register_client, false,
- sizeof(struct hal_ev_gatt_client_register_client)},
- {handle_scan_result, true,
- sizeof(struct hal_ev_gatt_client_scan_result)},
- {handle_connect, false, sizeof(struct hal_ev_gatt_client_connect)},
- {handle_disconnect, false,
- sizeof(struct hal_ev_gatt_client_disconnect)},
- {handle_search_complete, false,
- sizeof(struct hal_ev_gatt_client_search_complete)},
- {handle_search_result, false,
- sizeof(struct hal_ev_gatt_client_search_result)},
- {handle_get_characteristic, false,
- sizeof(struct hal_ev_gatt_client_get_characteristic)},
- {handle_get_descriptor, false,
- sizeof(struct hal_ev_gatt_client_get_descriptor)},
- {handle_get_included_service, false,
- sizeof(struct hal_ev_gatt_client_get_inc_service)},
- {handle_register_for_notification, false,
- sizeof(struct hal_ev_gatt_client_reg_for_notif)},
- {handle_notify, true, sizeof(struct hal_ev_gatt_client_notify)},
- {handle_read_characteristic, true,
- sizeof(struct hal_ev_gatt_client_read_characteristic)},
- {handle_write_characteristic, false,
- sizeof(struct hal_ev_gatt_client_write_characteristic)},
- {handle_read_descriptor, true,
- sizeof(struct hal_ev_gatt_client_read_descriptor)},
- {handle_write_descriptor, false,
- sizeof(struct hal_ev_gatt_client_write_descriptor)},
- {handle_execute_write, false,
- sizeof(struct hal_ev_gatt_client_exec_write)},
- {handle_read_remote_rssi, false,
- sizeof(struct hal_ev_gatt_client_read_remote_rssi)},
- {handle_listen, false, sizeof(struct hal_ev_gatt_client_listen)},
+ { handle_register_client, false,
+ sizeof(struct hal_ev_gatt_client_register_client) },
+ { handle_scan_result, true,
+ sizeof(struct hal_ev_gatt_client_scan_result) },
+ { handle_connect, false, sizeof(struct hal_ev_gatt_client_connect) },
+ { handle_disconnect, false,
+ sizeof(struct hal_ev_gatt_client_disconnect) },
+ { handle_search_complete, false,
+ sizeof(struct hal_ev_gatt_client_search_complete) },
+ { handle_search_result, false,
+ sizeof(struct hal_ev_gatt_client_search_result) },
+ { handle_get_characteristic, false,
+ sizeof(struct hal_ev_gatt_client_get_characteristic) },
+ { handle_get_descriptor, false,
+ sizeof(struct hal_ev_gatt_client_get_descriptor) },
+ { handle_get_included_service, false,
+ sizeof(struct hal_ev_gatt_client_get_inc_service) },
+ { handle_register_for_notification, false,
+ sizeof(struct hal_ev_gatt_client_reg_for_notif) },
+ { handle_notify, true, sizeof(struct hal_ev_gatt_client_notify) },
+ { handle_read_characteristic, true,
+ sizeof(struct hal_ev_gatt_client_read_characteristic) },
+ { handle_write_characteristic, false,
+ sizeof(struct hal_ev_gatt_client_write_characteristic) },
+ { handle_read_descriptor, true,
+ sizeof(struct hal_ev_gatt_client_read_descriptor) },
+ { handle_write_descriptor, false,
+ sizeof(struct hal_ev_gatt_client_write_descriptor) },
+ { handle_execute_write, false,
+ sizeof(struct hal_ev_gatt_client_exec_write) },
+ { handle_read_remote_rssi, false,
+ sizeof(struct hal_ev_gatt_client_read_remote_rssi) },
+ { handle_listen, false, sizeof(struct hal_ev_gatt_client_listen) },
/* Server Event Handlers */
- {handle_register_server, false,
- sizeof(struct hal_ev_gatt_server_register)},
- {handle_connection, false,
- sizeof(struct hal_ev_gatt_server_connection)},
- {handle_service_added, false,
- sizeof(struct hal_ev_gatt_server_service_added)},
- {handle_included_service_added, false,
- sizeof(struct hal_ev_gatt_server_service_added)},
- {handle_characteristic_added, false,
- sizeof(struct hal_ev_gatt_server_characteristic_added)},
- {handle_descriptor_added, false,
- sizeof(struct hal_ev_gatt_server_descriptor_added)},
- {handle_service_started, false,
- sizeof(struct hal_ev_gatt_server_service_started)},
- {handle_service_stopped, false,
- sizeof(struct hal_ev_gatt_server_service_stopped)},
- {handle_service_deleted, false,
- sizeof(struct hal_ev_gatt_server_service_deleted)},
- {handle_request_read, false,
- sizeof(struct hal_ev_gatt_server_request_read)},
- {handle_request_write, true,
- sizeof(struct hal_ev_gatt_server_request_write)},
- {handle_request_exec_write, false,
- sizeof(struct hal_ev_gatt_server_request_exec_write)},
- {handle_response_confirmation, false,
- sizeof(struct hal_ev_gatt_server_rsp_confirmation)},
+ { handle_register_server, false,
+ sizeof(struct hal_ev_gatt_server_register) },
+ { handle_connection, false,
+ sizeof(struct hal_ev_gatt_server_connection) },
+ { handle_service_added, false,
+ sizeof(struct hal_ev_gatt_server_service_added) },
+ { handle_included_service_added, false,
+ sizeof(struct hal_ev_gatt_server_service_added) },
+ { handle_characteristic_added, false,
+ sizeof(struct hal_ev_gatt_server_characteristic_added) },
+ { handle_descriptor_added, false,
+ sizeof(struct hal_ev_gatt_server_descriptor_added) },
+ { handle_service_started, false,
+ sizeof(struct hal_ev_gatt_server_service_started) },
+ { handle_service_stopped, false,
+ sizeof(struct hal_ev_gatt_server_service_stopped) },
+ { handle_service_deleted, false,
+ sizeof(struct hal_ev_gatt_server_service_deleted) },
+ { handle_request_read, false,
+ sizeof(struct hal_ev_gatt_server_request_read) },
+ { handle_request_write, true,
+ sizeof(struct hal_ev_gatt_server_request_write) },
+ { handle_request_exec_write, false,
+ sizeof(struct hal_ev_gatt_server_request_exec_write) },
+ { handle_response_confirmation, false,
+ sizeof(struct hal_ev_gatt_server_rsp_confirmation) },
};
/* Client API */
* index in table equals to 'opcode - HAL_MINIMUM_EVENT' */
static const struct hal_ipc_handler ev_handlers[] = {
/* HAL_EV_HANDSFREE_CONN_STATE */
- {handle_conn_state, false, sizeof(struct hal_ev_handsfree_conn_state)},
+ { handle_conn_state, false,
+ sizeof(struct hal_ev_handsfree_conn_state) },
/* HAL_EV_HANDSFREE_AUDIO_STATE */
- {handle_audio_state, false,
- sizeof(struct hal_ev_handsfree_audio_state)},
+ { handle_audio_state, false,
+ sizeof(struct hal_ev_handsfree_audio_state) },
/* HAL_EV_HANDSFREE_VR */
- {handle_vr_state, false, sizeof(struct hal_ev_handsfree_vr_state)},
+ { handle_vr_state, false, sizeof(struct hal_ev_handsfree_vr_state) },
/*HAL_EV_HANDSFREE_ANSWER */
- {handle_answer, false, 0},
+ { handle_answer, false, 0 },
/*HAL_EV_HANDSFREE_HANGUP */
- {handle_hangup, false, 0},
+ { handle_hangup, false, 0 },
/* HAL_EV_HANDSFREE_VOLUME */
- {handle_volume, false, sizeof(struct hal_ev_handsfree_volume)},
+ { handle_volume, false, sizeof(struct hal_ev_handsfree_volume) },
/* HAL_EV_HANDSFREE_DIAL */
- {handle_dial, true, sizeof(struct hal_ev_handsfree_dial)},
+ { handle_dial, true, sizeof(struct hal_ev_handsfree_dial) },
/* HAL_EV_HANDSFREE_DTMF */
- {handle_dtmf, false, sizeof(struct hal_ev_handsfree_dtmf)},
+ { handle_dtmf, false, sizeof(struct hal_ev_handsfree_dtmf) },
/* HAL_EV_HANDSFREE_NREC */
- {handle_nrec, false, sizeof(struct hal_ev_handsfree_nrec)},
+ { handle_nrec, false, sizeof(struct hal_ev_handsfree_nrec) },
/* HAL_EV_HANDSFREE_CHLD */
- {handle_chld, false, sizeof(struct hal_ev_handsfree_chld)},
+ { handle_chld, false, sizeof(struct hal_ev_handsfree_chld) },
/* HAL_EV_HANDSFREE_CNUM */
- {handle_cnum, false, 0},
+ { handle_cnum, false, 0 },
/* HAL_EV_HANDSFREE_CIND */
- {handle_cind, false, 0},
+ { handle_cind, false, 0 },
/* HAL_EV_HANDSFREE_COPS */
- {handle_cops, false, 0},
+ { handle_cops, false, 0 },
/* HAL_EV_HANDSFREE_CLCC */
- {handle_clcc, false, 0},
+ { handle_clcc, false, 0 },
/* HAL_EV_HANDSFREE_UNKNOWN_AT */
- {handle_unknown_at, true, sizeof(struct hal_ev_handsfree_unknown_at)},
+ { handle_unknown_at, true, sizeof(struct hal_ev_handsfree_unknown_at) },
/* HAL_EV_HANDSFREE_HSP_KEY_PRESS */
- {handle_hsp_key_press, false, 0},
+ { handle_hsp_key_press, false, 0 },
};
static uint8_t get_mode(void)