Hi , I want to set the channels used for exchanging DATA (after connection) when peripheral and master are connected. i searched and i find that it's like this :
//Set data channel to be used
ble_opt_t new_opt_config;
memset(&new_opt_config, 0, sizeof(new_opt_config));
new_opt_config.gap_opt.ch_map.ch_map[0] = 0xFF;
new_opt_config.gap_opt.ch_map.ch_map[1] = 0x0F;
new_opt_config.gap_opt.ch_map.ch_map[2] = 0x00;
new_opt_config.gap_opt.ch_map.ch_map[3] = 0x00;
new_opt_config.gap_opt.ch_map.ch_map[4] = 0x00;
error=sd_ble_opt_set(BLE_GAP_OPT_CH_MAP, &new_opt_config) ;
but when i put sd_ble_opt_get() (after some seconds after the connection, so i give the device the time to move to the new configuration) to read the channel map working i get the default one : FF FF FF 1F :/
My Questions :
- channel map is uint8_t ch_map[5]; that means 40 bits =number of channels including the ones of ADV. how can i choose to change one of the 37 channels of data , and not the 3 for ADV ?
- Should i use sd_ble_opt_set at the master side or peripheral side? because what i did is use it at peripheral side.