l2cap.c (da4c2b27ab35a78602679e27e3ac6e96862a4c64) l2cap.c (78315a58573f370dd679856042aa32fba14bc84a)
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

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

1920static void l2cap_handle_remote_supported_features_received(l2cap_channel_t * channel){
1921 if (channel->state != L2CAP_STATE_WAIT_REMOTE_SUPPORTED_FEATURES) return;
1922
1923 // we have been waiting for remote supported features
1924 log_info("l2cap received remote supported features, sec_level_0_allowed for psm %u = %u", channel->psm, l2cap_security_level_0_allowed_for_PSM(channel->psm));
1925 if (l2cap_security_level_0_allowed_for_PSM(channel->psm) == 0){
1926 // request security level 2
1927 channel->state = L2CAP_STATE_WAIT_OUTGOING_SECURITY_LEVEL_UPDATE;
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

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

1920static void l2cap_handle_remote_supported_features_received(l2cap_channel_t * channel){
1921 if (channel->state != L2CAP_STATE_WAIT_REMOTE_SUPPORTED_FEATURES) return;
1922
1923 // we have been waiting for remote supported features
1924 log_info("l2cap received remote supported features, sec_level_0_allowed for psm %u = %u", channel->psm, l2cap_security_level_0_allowed_for_PSM(channel->psm));
1925 if (l2cap_security_level_0_allowed_for_PSM(channel->psm) == 0){
1926 // request security level 2
1927 channel->state = L2CAP_STATE_WAIT_OUTGOING_SECURITY_LEVEL_UPDATE;
1928 channel->required_security_level = LEVEL_2;
1929 gap_request_security_level(channel->con_handle, LEVEL_2);
1928 channel->required_security_level = gap_get_security_level();
1929 gap_request_security_level(channel->con_handle, gap_get_security_level());
1930 return;
1931 }
1932
1933 l2cap_ready_to_connect(channel);
1934}
1935#endif
1936
1937#ifdef L2CAP_USES_CHANNELS

--- 2181 unchanged lines hidden ---
1930 return;
1931 }
1932
1933 l2cap_ready_to_connect(channel);
1934}
1935#endif
1936
1937#ifdef L2CAP_USES_CHANNELS

--- 2181 unchanged lines hidden ---