예제 #1
0
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();
}
예제 #2
0
파일: hfp_ag.c 프로젝트: seuscq/btstack
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);
}