sm.c (ebd6ff348ca073debe02f51b448392e7f568a51c) sm.c (20964aa9e7ee2bc87a693445e13b45ac6c5b6b2c)
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

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

3314 sm_setup_key_distribution(key_distribution_flags, key_distribution_flags);
3315
3316 // set state and send pairing response
3317 sm_timeout_start(connection);
3318 connection->sm_engine_state = SM_BR_EDR_DISTRIBUTE_KEYS;
3319 sm_send_connectionless(connection, (uint8_t *) &setup->sm_s_pres, sizeof(sm_pairing_packet_t));
3320 break;
3321 case SM_BR_EDR_DISTRIBUTE_KEYS:
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

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

3314 sm_setup_key_distribution(key_distribution_flags, key_distribution_flags);
3315
3316 // set state and send pairing response
3317 sm_timeout_start(connection);
3318 connection->sm_engine_state = SM_BR_EDR_DISTRIBUTE_KEYS;
3319 sm_send_connectionless(connection, (uint8_t *) &setup->sm_s_pres, sizeof(sm_pairing_packet_t));
3320 break;
3321 case SM_BR_EDR_DISTRIBUTE_KEYS:
3322 // send next key
3322 if (setup->sm_key_distribution_send_set != 0) {
3323 sm_run_distribute_keys(connection);
3323 if (setup->sm_key_distribution_send_set != 0) {
3324 sm_run_distribute_keys(connection);
3325 }
3326
3327 // more to send?
3328 if (setup->sm_key_distribution_send_set != 0){
3324 return;
3325 }
3329 return;
3330 }
3331
3326 // keys are sent
3327 if (IS_RESPONDER(connection->sm_role)) {
3328 // responder -> receive master keys if there are any
3329 if (!sm_key_distribution_all_received()){
3330 connection->sm_engine_state = SM_BR_EDR_RECEIVE_KEYS;
3331 break;
3332 }
3333 }

--- 2281 unchanged lines hidden ---
3332 // keys are sent
3333 if (IS_RESPONDER(connection->sm_role)) {
3334 // responder -> receive master keys if there are any
3335 if (!sm_key_distribution_all_received()){
3336 connection->sm_engine_state = SM_BR_EDR_RECEIVE_KEYS;
3337 break;
3338 }
3339 }

--- 2281 unchanged lines hidden ---