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

How to set the ANT shared address to receive on NRF51422 ?

what is the C function ?

Parents
  • hello petter this is my slave channel cfg : //Slave channel memset(&ch_slave_shared,0,sizeof(ch_slave_shared)); ch_slave_shared.ch_ID=_ANT_CHANNEL_SLAVE_ID; ch_slave_shared.ch_type=CHANNEL_TYPE_SHARED_SLAVE; ch_slave_shared.ch_ext_byte=EXT_PARAM_AUTO_SHARED_SLAVE; ch_slave_shared.ch_transmission_type=0x03; ch_slave_shared.ch_device_type=_ANT_HUB_LINK_ETABLISHING_INFO_TYPE; //On reçoit ce type de données ch_slave_shared.ch_device_number=ANT_COMMON_DEVICE_NUMBER; //master id info to receive ch_slave_shared.ch_period=ANT_COMMON_CHANNEL_PERIOD; ch_slave_shared.ch_freq=ANT_COMMON_FREQUENCY; ch_slave_shared.ch_hight_prio_timeout=7; //par pas de 2.5s ch_slave_shared.ch_low_prio_timeout=2; ch_slave_shared.CallBack_p=(type_CallBack_p)ant_rx_shared_channel_process;

    And after when the channel is opened, I set the shared channel address:

    void hub_set_shared_address(ant_channel_params_t ant_ch_p,U16 device_unic_id,U8 * payload_p) { memcpy(payload_p,(U8)&device_unic_id,sizeof(device_unic_id)); sd_ant_broadcast_message_tx(ant_ch_p->ch_ID, ANT_STANDARD_DATA_PAYLOAD_SIZE, payload_p);
    }

    hub_set_shared_address(&ch_slave_shared,u16MyUnicId,ch_slave_shared.payload);

Reply
  • hello petter this is my slave channel cfg : //Slave channel memset(&ch_slave_shared,0,sizeof(ch_slave_shared)); ch_slave_shared.ch_ID=_ANT_CHANNEL_SLAVE_ID; ch_slave_shared.ch_type=CHANNEL_TYPE_SHARED_SLAVE; ch_slave_shared.ch_ext_byte=EXT_PARAM_AUTO_SHARED_SLAVE; ch_slave_shared.ch_transmission_type=0x03; ch_slave_shared.ch_device_type=_ANT_HUB_LINK_ETABLISHING_INFO_TYPE; //On reçoit ce type de données ch_slave_shared.ch_device_number=ANT_COMMON_DEVICE_NUMBER; //master id info to receive ch_slave_shared.ch_period=ANT_COMMON_CHANNEL_PERIOD; ch_slave_shared.ch_freq=ANT_COMMON_FREQUENCY; ch_slave_shared.ch_hight_prio_timeout=7; //par pas de 2.5s ch_slave_shared.ch_low_prio_timeout=2; ch_slave_shared.CallBack_p=(type_CallBack_p)ant_rx_shared_channel_process;

    And after when the channel is opened, I set the shared channel address:

    void hub_set_shared_address(ant_channel_params_t ant_ch_p,U16 device_unic_id,U8 * payload_p) { memcpy(payload_p,(U8)&device_unic_id,sizeof(device_unic_id)); sd_ant_broadcast_message_tx(ant_ch_p->ch_ID, ANT_STANDARD_DATA_PAYLOAD_SIZE, payload_p);
    }

    hub_set_shared_address(&ch_slave_shared,u16MyUnicId,ch_slave_shared.payload);

Children
No Data
Related