hfp.c (405014fb5c4d2c34f48816e0043769181d669e4f) hfp.c (4960f9e71e26f618c676c66e66285cc4074b23bb)
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

--- 698 unchanged lines hidden (view full) ---

707 rfcomm_event_incoming_connection_get_bd_addr(packet, event_addr);
708 hfp_connection = provide_hfp_connection_context_for_bd_addr(event_addr, local_role);
709 if (!hfp_connection){
710 log_info("hfp: no memory to accept incoming connection - decline");
711 rfcomm_decline_connection(rfcomm_event_incoming_connection_get_rfcomm_cid(packet));
712 return;
713 }
714 if (hfp_connection->state != HFP_IDLE) {
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

--- 698 unchanged lines hidden (view full) ---

707 rfcomm_event_incoming_connection_get_bd_addr(packet, event_addr);
708 hfp_connection = provide_hfp_connection_context_for_bd_addr(event_addr, local_role);
709 if (!hfp_connection){
710 log_info("hfp: no memory to accept incoming connection - decline");
711 rfcomm_decline_connection(rfcomm_event_incoming_connection_get_rfcomm_cid(packet));
712 return;
713 }
714 if (hfp_connection->state != HFP_IDLE) {
715 log_error("hfp: incoming connection but state != HFP_IDLE");
715 log_error("hfp: incoming connection but not idle, reject");
716 rfcomm_decline_connection(rfcomm_event_incoming_connection_get_rfcomm_cid(packet));
716 return;
717 }
718
719 hfp_connection->rfcomm_cid = rfcomm_event_incoming_connection_get_rfcomm_cid(packet);
720 hfp_connection->state = HFP_W4_RFCOMM_CONNECTED;
721 // printf("RFCOMM channel %u requested for %s\n", hfp_connection->rfcomm_cid, bd_addr_to_str(hfp_connection->remote_addr));
722 rfcomm_accept_connection(hfp_connection->rfcomm_cid);
723 break;

--- 829 unchanged lines hidden ---
717 return;
718 }
719
720 hfp_connection->rfcomm_cid = rfcomm_event_incoming_connection_get_rfcomm_cid(packet);
721 hfp_connection->state = HFP_W4_RFCOMM_CONNECTED;
722 // printf("RFCOMM channel %u requested for %s\n", hfp_connection->rfcomm_cid, bd_addr_to_str(hfp_connection->remote_addr));
723 rfcomm_accept_connection(hfp_connection->rfcomm_cid);
724 break;

--- 829 unchanged lines hidden ---