hsp_ag.c (67bce263749ec83b41a4ba2b86f5ac7a11ec4f04) | hsp_ag.c (effbff2cb7ac90e392b874904e1b0789af3a940a) |
---|---|
1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 600 unchanged lines hidden (view full) --- 609 break; 610 } 611 612 case RFCOMM_EVENT_INCOMING_CONNECTION: 613 // data: event (8), len(8), address(48), channel (8), rfcomm_cid (16) 614 if (hsp_state != HSP_IDLE) return; 615 616 rfcomm_event_incoming_connection_get_bd_addr(packet, event_addr); | 1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 600 unchanged lines hidden (view full) --- 609 break; 610 } 611 612 case RFCOMM_EVENT_INCOMING_CONNECTION: 613 // data: event (8), len(8), address(48), channel (8), rfcomm_cid (16) 614 if (hsp_state != HSP_IDLE) return; 615 616 rfcomm_event_incoming_connection_get_bd_addr(packet, event_addr); |
617 rfcomm_cid = rfcomm_event_incoming_connection_get_server_channel(packet); 618 log_info("RFCOMM channel %u requested for %s", packet[8], bd_addr_to_str(event_addr)); | 617 rfcomm_cid = rfcomm_event_incoming_connection_get_rfcomm_cid(packet); 618 log_info("RFCOMM channel %u requested for %s with cid 0x%04x", rfcomm_event_incoming_connection_get_server_channel(packet), bd_addr_to_str(event_addr), rfcomm_cid); |
619 hsp_state = HSP_W4_RFCOMM_CONNECTED; 620 rfcomm_accept_connection(rfcomm_cid); 621 break; 622 623 case RFCOMM_EVENT_CHANNEL_OPENED: 624 log_info("RFCOMM_EVENT_CHANNEL_OPENED packet_handler type %u, packet[0] %x", packet_type, packet[0]); 625 // data: event(8), len(8), status (8), address (48), handle(16), server channel(8), rfcomm_cid(16), max frame size(16) 626 if (rfcomm_event_channel_opened_get_status(packet)) { --- 79 unchanged lines hidden --- | 619 hsp_state = HSP_W4_RFCOMM_CONNECTED; 620 rfcomm_accept_connection(rfcomm_cid); 621 break; 622 623 case RFCOMM_EVENT_CHANNEL_OPENED: 624 log_info("RFCOMM_EVENT_CHANNEL_OPENED packet_handler type %u, packet[0] %x", packet_type, packet[0]); 625 // data: event(8), len(8), status (8), address (48), handle(16), server channel(8), rfcomm_cid(16), max frame size(16) 626 if (rfcomm_event_channel_opened_get_status(packet)) { --- 79 unchanged lines hidden --- |