avdtp.c (9e974b9036aa993ac8396c09ec00c55e3278b00e) avdtp.c (8366bc41ba8e93cae5ea0d70c7b9c32577d6261a)
1/*
2 * Copyright (C) 2016 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

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

683 connection->initiator_connection_state = AVDTP_SIGNALING_CONNECTION_INITIATOR_W2_GET_CAPABILITIES;
684 } else {
685 connection->initiator_connection_state = AVDTP_SIGNALING_CONNECTION_INITIATOR_W2_GET_ALL_CAPABILITIES;
686 }
687 avdtp_request_can_send_now_initiator(connection);
688 break;
689 default:
690 connection->state = AVDTP_SIGNALING_CONNECTION_W4_L2CAP_CONNECTED;
1/*
2 * Copyright (C) 2016 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

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

683 connection->initiator_connection_state = AVDTP_SIGNALING_CONNECTION_INITIATOR_W2_GET_CAPABILITIES;
684 } else {
685 connection->initiator_connection_state = AVDTP_SIGNALING_CONNECTION_INITIATOR_W2_GET_ALL_CAPABILITIES;
686 }
687 avdtp_request_can_send_now_initiator(connection);
688 break;
689 default:
690 connection->state = AVDTP_SIGNALING_CONNECTION_W4_L2CAP_CONNECTED;
691 l2cap_create_channel(avdtp_packet_handler, connection->remote_addr, connection->avdtp_l2cap_psm, l2cap_max_mtu(), NULL);
691 l2cap_create_channel(avdtp_packet_handler, connection->remote_addr, connection->avdtp_l2cap_psm, AVDTP_L2CAP_MTU, NULL);
692 break;
693 }
694}
695
696static void avdtp_handle_sdp_client_query_result(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
697 UNUSED(packet_type);
698 UNUSED(channel);
699 UNUSED(size);

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

1616 if (stream_endpoint->remote_sep.seid == 0) return 0;
1617 if (stream_endpoint->remote_sep.seid > 0x3E) return 0;
1618 return 1;
1619}
1620
1621void avdtp_init(void){
1622 if (!avdtp_l2cap_registered){
1623 avdtp_l2cap_registered = true;
692 break;
693 }
694}
695
696static void avdtp_handle_sdp_client_query_result(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
697 UNUSED(packet_type);
698 UNUSED(channel);
699 UNUSED(size);

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

1616 if (stream_endpoint->remote_sep.seid == 0) return 0;
1617 if (stream_endpoint->remote_sep.seid > 0x3E) return 0;
1618 return 1;
1619}
1620
1621void avdtp_init(void){
1622 if (!avdtp_l2cap_registered){
1623 avdtp_l2cap_registered = true;
1624 l2cap_register_service(&avdtp_packet_handler, BLUETOOTH_PSM_AVDTP, 0xffff, gap_get_security_level());
1624 l2cap_register_service(&avdtp_packet_handler, BLUETOOTH_PSM_AVDTP, AVDTP_L2CAP_MTU, gap_get_security_level());
1625 }
1626}
1627
1628void avdtp_deinit(void){
1629 avdtp_sink_handle_media_data = NULL;
1630 avdtp_sink_media_config_validator = NULL;
1631 avdtp_source_media_config_validator = NULL;
1632 avdtp_source_callback = NULL;

--- 15 unchanged lines hidden ---
1625 }
1626}
1627
1628void avdtp_deinit(void){
1629 avdtp_sink_handle_media_data = NULL;
1630 avdtp_sink_media_config_validator = NULL;
1631 avdtp_source_media_config_validator = NULL;
1632 avdtp_source_callback = NULL;

--- 15 unchanged lines hidden ---