Skip to content

Commit

Permalink
FHSS API: Added synch info write callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarkko Paso committed Jan 12, 2018
1 parent 3ed145f commit 6830fd3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions nanostack/fhss_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ typedef struct fhss_callback fhss_callback_t;
#define FHSS_SYNCH_REQUEST_FRAME 1 /**< FHSS synchronization request frame */
#define FHSS_DATA_FRAME 2 /**< FHSS data frame */

/**
* @brief FHSS information element types.
*/
#define FHSS_UTT_IE 0 /**< UTT-IE */
#define FHSS_BT_IE 1 /**< BT-IE */
#define FHSS_US_IE 2 /**< US-IE */
#define FHSS_BS_IE 3 /**< BS-IE */
#define FHSS_PLAIN_SYNCH_INFO 4 /**< Plain synchronization information */

/**
* @brief FHSS synchronization info length.
*/
Expand Down Expand Up @@ -152,6 +161,17 @@ typedef uint32_t fhss_read_timestamp(const fhss_api_t *api);
*/
typedef uint16_t fhss_get_retry_period(const fhss_api_t *api, uint8_t *destination_address, uint16_t phy_mtu);

/**
* @brief Write synchronization info to given pointer.
* @param api FHSS instance.
* @param info_ptr Pointer to written data.
* @param info_type Type of the written info (UTT-IE, BT-IE, US-IE, BS-IE).
* @param frame_type_id Frame type of packet which will be written in info element.
* @param tx_time TX time must be referenced to the first symbol following the SFD of the transmitted frame.
* @return -1 on fail, write length otherwise.
*/
typedef int16_t fhss_write_synch_info(const fhss_api_t *api, uint8_t *info_ptr, int info_type, int frame_type_id, uint32_t tx_time);

/**
* @brief Initialize MAC functions.
* @param api FHSS instance.
Expand All @@ -177,6 +197,7 @@ struct fhss_api {
fhss_synch_state_set *synch_state_set; /**< Change synchronization state. */
fhss_read_timestamp *read_timestamp; /**< Read timestamp. */
fhss_get_retry_period *get_retry_period; /**< Get retransmission period. */
fhss_write_synch_info *write_synch_info; /**< Write synchronization info to TX frame*/
fhss_init_callbacks *init_callbacks; /**< Initialize MAC functions. */
};

Expand Down

0 comments on commit 6830fd3

Please sign in to comment.