Dear Members,
For scanning GSC10 sensor,
can this example be used ?
https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ant_examples_scanning.html
Thanks
Dear Members,
For scanning GSC10 sensor,
can this example be used ?
https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ant_examples_scanning.html
Thanks
GSC10 sensor
A what ?
Garmin GSC10 , can I retrieve the information from it with ANT background scanning ?
How can I use this function ?
void background_scanner_process(ant_evt_t * p_ant_evt, void * p_context)
{
uint32_t err_code;
UNUSED_PARAMETER(p_context);
if (p_ant_evt->channel != ANT_BS_CHANNEL_NUMBER)
{
return;
}
switch (p_ant_evt->event)
{
case EVENT_RX:
{
err_code = bsp_indication_set(BSP_INDICATE_RCV_OK);
APP_ERROR_CHECK(err_code);
if (p_ant_evt->message.ANT_MESSAGE_stExtMesgBF.bANTDeviceID)
{
m_last_device_id = uint16_decode(p_ant_evt->message.ANT_MESSAGE_aucExtData);
}
if (p_ant_evt->message.ANT_MESSAGE_stExtMesgBF.bANTRssi)
{
m_last_rssi = p_ant_evt->message.ANT_MESSAGE_aucExtData[5];
}
NRF_LOG_INFO("Message number %d", m_recieved);
NRF_LOG_INFO("Device ID: %d", m_last_device_id);
NRF_LOG_INFO("RSSI: %d", m_last_rssi);
m_recieved++;
break;
}
default:
{
break;
}
}
}
background_scanner_process(ant_evt_t * p_ant_evt, void * p_context)
What value should I enter in that (ant_evt_t * p_ant_evt, void * p_context) ?
Thanks
Do I need to include these ;
#ifndef ANT_PLUS_NETWORK_KEY
//#define ANT_PLUS_NETWORK_KEY {0, 0, 0, 0, 0, 0, 0, 0} /**< The ANT+ network key. */
#define ANT_PLUS_NETWORK_KEY {0xB9, 0xA5, 0x21, 0xFB, 0xBD, 0x72, 0xC3, 0x45}
#endif //ANT_PLUS_NETWORK_KEY
#ifndef ANT_FS_NETWORK_KEY
// #define ANT_FS_NETWORK_KEY {0, 0, 0, 0, 0, 0, 0, 0} /**< The ANT-FS network key. */
#define ANT_FS_NETWORK_KEY {0xA8, 0xA4, 0x23, 0xB9, 0xF5, 0x5E, 0x63, 0xC1} /**< The ANT-FS network key. */
#endif // ANT_FS_NETWORK_KEY
How can I display :
NRF_LOG_INFO("Message number %d", m_recieved);
NRF_LOG_INFO("Device ID: %d", m_last_device_id);
NRF_LOG_INFO("RSSI: %d", m_last_rssi);RixtronixLAB said:What value should I enter in that (ant_evt_t * p_ant_evt, void * p_context) ?
This is a callback event from the softdevice to handle ANT events, that is registered by:
NRF_SDH_ANT_OBSERVER(m_ant_bs_observer, ANT_BS_ANT_OBSERVER_PRIO, sf_background_scanner_process, NULL);
For instance depending on the ANT event (p_ant_evt->event) you may choose to handle the data attached to the event depending on your application.
RixtronixLAB said:What value should I enter in that (ant_evt_t * p_ant_evt, void * p_context) ?
This is a callback event from the softdevice to handle ANT events, that is registered by:
NRF_SDH_ANT_OBSERVER(m_ant_bs_observer, ANT_BS_ANT_OBSERVER_PRIO, sf_background_scanner_process, NULL);
For instance depending on the ANT event (p_ant_evt->event) you may choose to handle the data attached to the event depending on your application.