예제 #1
0
파일: hfp_ag.c 프로젝트: yourskp/btstack
static void hfp_handle_rfcomm_data(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
    hfp_connection_t * context = get_hfp_connection_context_for_rfcomm_cid(channel);
    if (!context) return;
    int pos;
    for (pos = 0; pos < size ; pos++){
        hfp_parse(context, packet[pos], 0);
    }
}
예제 #2
0
static void hfp_handle_rfcomm_event(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
    hfp_connection_t * context = provide_hfp_connection_context_for_rfcomm_cid(channel);
    if (!context) return;

    packet[size] = 0;
    int pos;
    for (pos = 0; pos < size ; pos++){
        hfp_parse(context, packet[pos]);

        // trigger next action after CMD received
        if (context->command != HFP_CMD_OK) continue;
        handle_switch_on_ok(context);
    }
}
예제 #3
0
static void hfp_handle_rfcomm_event(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
    hfp_connection_t * context = get_hfp_connection_context_for_rfcomm_cid(channel);
    if (!context) return;
    
    if (context->state == HFP_EXCHANGE_SUPPORTED_FEATURES){
        context->state = HFP_W4_EXCHANGE_SUPPORTED_FEATURES;   
    }

    packet[size] = 0;
    int pos;
    for (pos = 0; pos < size ; pos++){
        hfp_parse(context, packet[pos]);

        // trigger next action after CMD received
        if (context->command == HFP_CMD_NONE) continue;
        //hfp_run_for_context(context);
    }
}