@@ -38,6 +38,15 @@ typedef struct fhss_callback fhss_callback_t;
3838#define FHSS_SYNCH_REQUEST_FRAME 1 /**< FHSS synchronization request frame */
3939#define FHSS_DATA_FRAME 2 /**< FHSS data frame */
4040
41+ /**
42+ * @brief FHSS information element types.
43+ */
44+ #define FHSS_UTT_IE 0 /**< UTT-IE */
45+ #define FHSS_BT_IE 1 /**< BT-IE */
46+ #define FHSS_US_IE 2 /**< US-IE */
47+ #define FHSS_BS_IE 3 /**< BS-IE */
48+ #define FHSS_PLAIN_SYNCH_INFO 4 /**< Plain synchronization information */
49+
4150/**
4251 * @brief FHSS synchronization info length.
4352 */
@@ -74,7 +83,6 @@ typedef bool fhss_use_broadcast_queue(const fhss_api_t *api, bool is_broadcast_a
7483 * @param is_broadcast_addr Destination address type of packet (true if broadcast address).
7584 * @param destination_address Destination MAC address.
7685 * @param frame_type Frame type of packet (Frames types are defined by FHSS api).
77- * @param synch_info Pointer to where FHSS synchronization info is written (if synch frame).
7886 * @param frame_length MSDU length of the frame.
7987 * @param phy_header_length PHY header length.
8088 * @param phy_tail_length PHY tail length.
@@ -84,7 +92,7 @@ typedef bool fhss_use_broadcast_queue(const fhss_api_t *api, bool is_broadcast_a
8492 * @return -3 Broadcast packet on Unicast channel (not allowed), push packet back to queue.
8593 * @return -4 Synchronization info missing.
8694 */
87- typedef int fhss_tx_handle (const fhss_api_t * api , bool is_broadcast_addr , uint8_t * destination_address , int frame_type , uint8_t * synch_info , uint16_t frame_length , uint8_t phy_header_length , uint8_t phy_tail_length );
95+ typedef int fhss_tx_handle (const fhss_api_t * api , bool is_broadcast_addr , uint8_t * destination_address , int frame_type , uint16_t frame_length , uint8_t phy_header_length , uint8_t phy_tail_length );
8896
8997/**
9098 * @brief Check TX permission.
@@ -152,6 +160,17 @@ typedef uint32_t fhss_read_timestamp(const fhss_api_t *api);
152160 */
153161typedef uint16_t fhss_get_retry_period (const fhss_api_t * api , uint8_t * destination_address , uint16_t phy_mtu );
154162
163+ /**
164+ * @brief Write synchronization info to given pointer.
165+ * @param api FHSS instance.
166+ * @param info_ptr Pointer to written data.
167+ * @param info_type Type of the written info (UTT-IE, BT-IE, US-IE, BS-IE).
168+ * @param frame_type_id Frame type of packet which will be written in info element.
169+ * @param tx_time TX time must be referenced to the first symbol following the SFD of the transmitted frame.
170+ * @return -1 on fail, write length otherwise.
171+ */
172+ 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 );
173+
155174/**
156175 * @brief Initialize MAC functions.
157176 * @param api FHSS instance.
@@ -177,6 +196,7 @@ struct fhss_api {
177196 fhss_synch_state_set * synch_state_set ; /**< Change synchronization state. */
178197 fhss_read_timestamp * read_timestamp ; /**< Read timestamp. */
179198 fhss_get_retry_period * get_retry_period ; /**< Get retransmission period. */
199+ fhss_write_synch_info * write_synch_info ; /**< Write synchronization info to TX frame*/
180200 fhss_init_callbacks * init_callbacks ; /**< Initialize MAC functions. */
181201};
182202
@@ -256,6 +276,18 @@ typedef int mac_broadcast_notify(const fhss_api_t *fhss_api, uint32_t broadcast_
256276 */
257277typedef int mac_read_coordinator_mac_address (const fhss_api_t * fhss_api , uint8_t * mac_address );
258278
279+ /**
280+ * @brief Read synchronization info for a specific peer.
281+ * @param fhss_api FHSS instance.
282+ * @param info_ptr Pointer to info data.
283+ * @param mac_address MAC address pointer.
284+ * @param info_type Type of the read info (UTT-IE, BT-IE, US-IE, BS-IE).
285+ * @param rx_timestamp Time of reception of the element.
286+ * @return >=0 Length of the info.
287+ * @return -1 Fail.
288+ */
289+ typedef int mac_read_synch_info (const fhss_api_t * fhss_api , uint8_t * info_ptr , uint8_t * mac_address , int info_type , uint32_t rx_timestamp );
290+
259291/**
260292 * \brief Struct fhss_callback defines functions that software MAC needs to implement.
261293 * Function pointers are passed to FHSS using fhss_init_callbacks function.
@@ -270,6 +302,7 @@ struct fhss_callback {
270302 mac_tx_poll * tx_poll ; /**< Poll TX queue. */
271303 mac_broadcast_notify * broadcast_notify ; /**< Broadcast channel notification from FHSS. */
272304 mac_read_coordinator_mac_address * read_coord_mac_address ; /**< Read coordinator MAC address. */
305+ mac_read_synch_info * read_synch_info ; /**< Read information element for a specific MAC address. */
273306};
274307
275308#ifdef __cplusplus
0 commit comments