Example of basic ANT Broadcast TX.
More...
When the application is booting, LED0 and LED1 are turned on. Once the SoftDevice is enabled, all LEDs are turned off to indicate the system is ready.
The device is set up to use Device Type: 2, Device Number: 2, Transmition Type: 1. The channel period is set to 4 Hz (8192). When a successful broadcast has occured it will turn on LED0 for 20 milliseconds.
LED1 is turned on whenever the processor enters sleep state and turned off when woken up by an interrupt.
#define CHANNEL_0_TX_CHANNEL_PERIOD 8192u |
#define CHANNEL_0_ANT_EXT_ASSIGN 0x00 |
#define CHANNEL_0_CHAN_ID_DEV_TYPE 0x02u |
#define CHANNEL_0_CHAN_ID_DEV_NUM 0x02u |
#define CHANNEL_0_CHAN_ID_TRANS_TYPE 0x01u |
#define ANT_CHANNEL_DEFAULT_NETWORK 0x00 |
#define ANT_EVENT_MSG_BUFFER_MIN_SIZE 32u |
Minimum size of ANT event message buffer.
#define BROADCAST_DATA_BUFFER_SIZE 8u |
Size of the broadcast data buffer.
void app_error_handler |
( |
uint32_t |
error_code, |
|
|
uint32_t |
line_num, |
|
|
const uint8_t * |
p_file_name |
|
) |
| |
Function for error handling, which is called when an error has occurred.
- Parameters
-
[in] | error_code | Error code supplied to the handler. |
[in] | line_num | Line number where the error occurred. |
[in] | p_file_name | Pointer to the file name. |
static void ant_channel_tx_broadcast_setup |
( |
void |
| ) |
|
|
static |
The following commands are issued in this order:
- assign channel
- set channel ID
- open channel
static void channel_event_handle |
( |
uint32_t |
event | ) |
|
|
static |
- Parameters
-
[in] | event | The received ANT event to handle. |
void PROTOCOL_EVENT_IRQHandler |
( |
void |
| ) |
|
Implemented to clear the pending flag when receiving an interrupt from the stack.
void softdevice_assert_callback |
( |
uint32_t |
pc, |
|
|
uint16_t |
line_num, |
|
|
const uint8_t * |
p_file_name |
|
) |
| |
- Parameters
-
[in] | pc | Value of the program counter. |
[in] | line_num | Line number where the assert occurred. |
[in] | p_file_name | Pointer to the file name. |
Primary data transmit buffer.
Counter to increment the ANT broadcast data payload.