This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Advertising on a single channel in nrf51822

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!!

Parents Reply
  • 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

Children
No Data
Related