| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Modules | Data Structures | Enumerations | Functions
ANT request controller
ANT utilities

Module for handling page requests related to page 70. More...

## Modules
| ANT+ request controller configuration

## Data Structures
struct | ant_request_controller_t
| ANT request controller structure. More...

## Enumerations
enum | ant_request_controller_evt_t { ANT_REQUEST_CONTROLLER_NONE, ANT_REQUEST_CONTROLLER_SUCCESS, ANT_REQUEST_CONTROLLER_FAILED }
| Request controller events types. More...
enum | ant_request_controller_state_t { ANT_REQUEST_CONTROLLER_IDLE, ANT_REQUEST_CONTROLLER_SENDED, ANT_REQUEST_CONTROLLER_BROADCAST_REQUESTED, ANT_REQUEST_CONTROLLER_ACK_REQUESTED, ANT_REQUEST_CONTROLLER_ACK_UNTIL_SUCCESS_REQUESTED }
| Request controller states. More...

## Functions
void | ant_request_controller_init (ant_request_controller_t *p_controller)
| Function for initializing the ANT request controller instance. More...
uint32_t | ant_request_controller_request (ant_request_controller_t *p_controller, uint8_t channel_number, ant_common_page70_data_t *p_page_70)
| Function for sending a request. More...
bool | ant_request_controller_pending_get (ant_request_controller_t *p_controller, uint8_t *p_page_number)
| Function for getting pending page number. More...
bool | ant_request_controller_ack_needed (ant_request_controller_t *p_controller)
| Function for checking whether the next page must be sent with acknowledgment. More...
ant_request_controller_evt_t | ant_request_controller_disp_evt_handler (ant_request_controller_t *p_controller, ant_evt_t *p_ant_event)
| Function for handling ANT events on display side. More...
void | ant_request_controller_sens_evt_handler (ant_request_controller_t *p_controller, ant_evt_t *p_ant_event)
| Function for handling ANT events on sensor side. More...

## Detailed Description

Module for handling page requests related to page 70.

## Enumeration Type Documentation

enum ant_request_controller_evt_t

Request controller events types.

Enumerator
ANT_REQUEST_CONTROLLER_NONE | No event.
ANT_REQUEST_CONTROLLER_SUCCESS | Page request successful.
ANT_REQUEST_CONTROLLER_FAILED | Page request failed.

enum ant_request_controller_state_t

Request controller states.

Enumerator
ANT_REQUEST_CONTROLLER_IDLE | Module is in idle state.
ANT_REQUEST_CONTROLLER_SENDED | Module waits for acknowledgment of its request.
ANT_REQUEST_CONTROLLER_BROADCAST_REQUESTED | Module is requested to send page n times using broadcast.
ANT_REQUEST_CONTROLLER_ACK_REQUESTED | Module is requested to send page n times using acknowledgment.
ANT_REQUEST_CONTROLLER_ACK_UNTIL_SUCCESS_REQUESTED | Module is requested to send page until success using acknowledgment.

## Function Documentation

bool ant_request_controller_ack_needed | ( | ant_request_controller_t * | p_controller | ) |

Function for checking whether the next page must be sent with acknowledgment.

Parameters

  [in] | p_controller | Pointer to the controller instance.

Return values

  TRUE | If the next transmission needs acknowledgment.
  FALSE | If the next transmission does not need acknowledgment.

ant_request_controller_evt_t ant_request_controller_disp_evt_handler | ( | ant_request_controller_t * | p_controller,
|  | ant_evt_t * | p_ant_event
| ) |  |

Function for handling ANT events on display side.

All events from the ANT stack that are related to the appropriate channel number should be propagated.

Parameters

  [in] | p_controller | Pointer to the controller instance.
  [in] | p_ant_event | Event received from the ANT stack.

void ant_request_controller_init | ( | ant_request_controller_t * | p_controller | ) |

Function for initializing the ANT request controller instance.

Parameters

  [in] | p_controller | Pointer to the controller instance.

bool ant_request_controller_pending_get | ( | ant_request_controller_t * | p_controller,
|  | uint8_t * | p_page_number
| ) |  |

Function for getting pending page number.

This function checks whether a page number was requested.

Parameters

  [in] | p_controller | Pointer to the controller instance.
  [out] | p_page_number | Pending page number (valid if true was returned).

Return values

  TRUE | If there was a pending page.
  FALSE | If no page was pending.

uint32_t ant_request_controller_request | ( | ant_request_controller_t * | p_controller,
|  | uint8_t | channel_number,
|  | ant_common_page70_data_t * | p_page_70
| ) |  |

Function for sending a request.

Parameters

  [in] | p_controller | Pointer to the controller instance.
  [in] | channel_number | Channel number.
  [in] | p_page_70 | Pointer to the prepared page 70.

Returns
  Error code returned by sd_ant_acknowledge_message_tx().

void ant_request_controller_sens_evt_handler | ( | ant_request_controller_t * | p_controller,
|  | ant_evt_t * | p_ant_event
| ) |  |

Function for handling ANT events on sensor side.

All events from the ANT stack that are related to the appropriate channel number should be propagated.

Parameters

  [in] | p_controller | Pointer to the controller instance.
  [in] | p_ant_event | Event received from the ANT stack.

Return values

  TRUE | If there was a pending page.