hi, i am using sdk 10, with s120.
i want to advertise data on a single channel with frequency say (2426). is there any sample code or something, with which i can play with.
thanks!!
hi, i am using sdk 10, with s120.
i want to advertise data on a single channel with frequency say (2426). is there any sample code or something, with which i can play with.
thanks!!
Hi,
If you meant BLE advertising you can look at Kristin's answer on this post: devzone.nordicsemi.com/.../
It's for S110 v8, but I have tested it in S110 and S130 v9 and it should be in SDK 10 too. You can look for ble_gap_adv_params_t --> ble_gap_adv_ch_mask_t in infocenter.nordicsemi.com/ for more information.
A tutorial on simple BLE advertising is also in devzone.nordicsemi.com/.../.
Hope it helps, FA
If you define:
static ble_gap_adv_params_t m_adv_params;
static ble_gap_adv_ch_mask_t ch_off;
Then in your advertising_init function you should have something like:
// Initialize advertising parameters (used when starting advertising).
memset(&m_adv_params, 0, sizeof(m_adv_params));
m_adv_params.type = BLE_GAP_ADV_TYPE_ADV_NONCONN_IND;
m_adv_params.interval = NON_CONNECTABLE_ADV_INTERVAL;
You can now just add:
ch_off.ch_37_off = 0;
ch_off.ch_38_off = 1;
ch_off.ch_39_off = 1;
m_adv_params.channel_mask = ch_off;
This will only advertise in channel 37
If you define:
static ble_gap_adv_params_t m_adv_params;
static ble_gap_adv_ch_mask_t ch_off;
Then in your advertising_init function you should have something like:
// Initialize advertising parameters (used when starting advertising).
memset(&m_adv_params, 0, sizeof(m_adv_params));
m_adv_params.type = BLE_GAP_ADV_TYPE_ADV_NONCONN_IND;
m_adv_params.interval = NON_CONNECTABLE_ADV_INTERVAL;
You can now just add:
ch_off.ch_37_off = 0;
ch_off.ch_38_off = 1;
ch_off.ch_39_off = 1;
m_adv_params.channel_mask = ch_off;
This will only advertise in channel 37