static void packet_handler(void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ switch (packet_type){ case RFCOMM_DATA_PACKET: hfp_handle_rfcomm_event(packet_type, channel, packet, size); break; case HCI_EVENT_PACKET: hfp_handle_hci_event(packet_type, packet, size); break; default: break; } hfp_run(); }
static void packet_handler(void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ // printf("packet_handler type %u, packet[0] %x\n", packet_type, packet[0]); hfp_connection_t * context = NULL; switch (packet_type){ case RFCOMM_DATA_PACKET: context = hfp_handle_rfcomm_event(packet_type, channel, packet, size); break; case HCI_EVENT_PACKET: context = hfp_handle_hci_event(packet_type, packet, size); break; default: break; } hfp_run(context); }