i am using nrf52840 sdk 14.2 s140
i want to advertise in a single channel and which app is used to trace on which channel is advertising
i am using nrf52840 sdk 14.2 s140
i want to advertise in a single channel and which app is used to trace on which channel is advertising
i tried and how to check whether ble is transmitting on the particular channel
Hi.
Well as i said, BLE is always advertising on 3 channels, and skips between the 3 channels.
This means that BLE does not advertise on a particular channel.
If you want to advertise on a particular channel, you have to turn off two channels, like I showed in my previous reply.
- Andreas
ok is there any application which shows the ble is advertising on particular chaNNEL
Hi.
No, there is not any example applications where advertising happens on a particular channel.
But you can add the code in my previous reply to any example found in the \ble_peripheral folder.
Let me show you here:
Open the ble_app_blinky project in the folder \nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_blinky\pca10056\s140 in your prefered IDE.
Find the static void advertising_start(void) function in main.c
If you want to turn of channel 37, add the code:
adv_params.channel_mask.ch_37_off = 1;
adv_params.channel_mask.ch_38_off = 1;
adv_params.channel_mask.ch_39_off = 1;
static void advertising_start(void) { ret_code_t err_code; ble_gap_adv_params_t adv_params; // Start advertising memset(&adv_params, 0, sizeof(adv_params)); adv_params.type = BLE_GAP_ADV_TYPE_ADV_IND; adv_params.p_peer_addr = NULL; adv_params.fp = BLE_GAP_ADV_FP_ANY; adv_params.interval = APP_ADV_INTERVAL; adv_params.timeout = APP_ADV_TIMEOUT_IN_SECONDS; adv_params.channel_mask.ch_37_off = 1; adv_params.channel_mask.ch_38_off = 1; err_code = sd_ble_gap_adv_start(&adv_params, APP_BLE_CONN_CFG_TAG); APP_ERROR_CHECK(err_code); bsp_board_led_on(ADVERTISING_LED); }
- Andreas
Hi.
No, there is not any example applications where advertising happens on a particular channel.
But you can add the code in my previous reply to any example found in the \ble_peripheral folder.
Let me show you here:
Open the ble_app_blinky project in the folder \nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_blinky\pca10056\s140 in your prefered IDE.
Find the static void advertising_start(void) function in main.c
If you want to turn of channel 37, add the code:
adv_params.channel_mask.ch_37_off = 1;
adv_params.channel_mask.ch_38_off = 1;
adv_params.channel_mask.ch_39_off = 1;
static void advertising_start(void) { ret_code_t err_code; ble_gap_adv_params_t adv_params; // Start advertising memset(&adv_params, 0, sizeof(adv_params)); adv_params.type = BLE_GAP_ADV_TYPE_ADV_IND; adv_params.p_peer_addr = NULL; adv_params.fp = BLE_GAP_ADV_FP_ANY; adv_params.interval = APP_ADV_INTERVAL; adv_params.timeout = APP_ADV_TIMEOUT_IN_SECONDS; adv_params.channel_mask.ch_37_off = 1; adv_params.channel_mask.ch_38_off = 1; err_code = sd_ble_gap_adv_start(&adv_params, APP_BLE_CONN_CFG_TAG); APP_ERROR_CHECK(err_code); bsp_board_led_on(ADVERTISING_LED); }
- Andreas
ok thanku so much