l2cap.c (92da54c428ac31e2ac9247cff24e98a1cefcb8b4) l2cap.c (7dfda25627e380b420b869b9e0fba836360e35b8)
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

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

715
716 // validate local config
717 uint8_t result = l2cap_ertm_validate_local_config(ertm_config);
718 if (result) return result;
719
720 // configure L2CAP ERTM
721 l2cap_ertm_configure_channel(channel, ertm_config, buffer, size);
722
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

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

715
716 // validate local config
717 uint8_t result = l2cap_ertm_validate_local_config(ertm_config);
718 if (result) return result;
719
720 // configure L2CAP ERTM
721 l2cap_ertm_configure_channel(channel, ertm_config, buffer, size);
722
723 // already available?
723 // we need to know if ERTM is supported before sending a config response
724 channel->state = L2CAP_STATE_WAIT_INCOMING_EXTENDED_FEATURES;
724 hci_connection_t * connection = hci_connection_for_handle(channel->con_handle);
725 btstack_assert(connection != NULL);
725 hci_connection_t * connection = hci_connection_for_handle(channel->con_handle);
726 btstack_assert(connection != NULL);
726
727 // we need to know if ERTM is supported before sending a config response
728 switch (connection->l2cap_state.information_state){
727 switch (connection->l2cap_state.information_state){
728 case L2CAP_INFORMATION_STATE_IDLE:
729 connection->l2cap_state.information_state = L2CAP_INFORMATION_STATE_W2_SEND_EXTENDED_FEATURE_REQUEST;
730 break;
729 case L2CAP_INFORMATION_STATE_DONE:
730 l2cap_handle_information_request_complete(connection);
731 break;
731 case L2CAP_INFORMATION_STATE_DONE:
732 l2cap_handle_information_request_complete(connection);
733 break;
732 case L2CAP_INFORMATION_STATE_IDLE:
733 connection->l2cap_state.information_state = L2CAP_INFORMATION_STATE_W2_SEND_EXTENDED_FEATURE_REQUEST;
734 /* fall through */
735 default:
734 default:
736 channel->state = L2CAP_STATE_WAIT_INCOMING_EXTENDED_FEATURES;
737 break;
738 }
739
740 l2cap_run();
741
742 return ERROR_CODE_SUCCESS;
743}
744

--- 4820 unchanged lines hidden ---
735 break;
736 }
737
738 l2cap_run();
739
740 return ERROR_CODE_SUCCESS;
741}
742

--- 4820 unchanged lines hidden ---