Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

fhss_api.h File Reference

fhss_api.h File Reference

Go to the source code of this file.

Data Structures

struct  fhss_api
 Struct fhss_api defines interface between software MAC and FHSS. More...
struct  fhss_callback
 Struct fhss_callback defines functions that software MAC needs to implement. More...

Typedefs

typedef bool fhss_is_broadcast_channel (const fhss_api_t *api)
 FHSS is broadcast channel.
typedef bool fhss_use_broadcast_queue (const fhss_api_t *api, bool is_broadcast_addr, int frame_type)
 FHSS queue check.
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, uint32_t tx_time)
 FHSS TX handle.
typedef bool fhss_check_tx_conditions (const fhss_api_t *api, bool is_broadcast_addr, uint8_t handle, int frame_type, uint16_t frame_length, uint8_t phy_header_length, uint8_t phy_tail_length)
 Check TX permission.
typedef void fhss_receive_frame (const fhss_api_t *api, uint16_t pan_id, uint8_t *source_address, uint32_t timestamp, uint8_t *synch_info, int frame_type)
 Notification of received FHSS synch or synch request frame.
typedef void fhss_data_tx_done (const fhss_api_t *api, bool waiting_ack, bool tx_completed, uint8_t handle)
 Data TX done callback.
typedef bool fhss_data_tx_fail (const fhss_api_t *api, uint8_t handle, int frame_type)
 Data TX or CCA failed callback.
typedef int16_t fhss_synch_state_set (const fhss_api_t *api, fhss_states fhss_state, uint16_t pan_id)
 Change synchronization state.
typedef uint32_t fhss_read_timestamp (const fhss_api_t *api)
 Read timestamp.
typedef uint32_t fhss_get_retry_period (const fhss_api_t *api, uint8_t *destination_address, uint16_t phy_mtu)
 Get additional retransmission period.
typedef int16_t fhss_write_synch_info (const fhss_api_t *api, uint8_t *ptr, uint8_t length, int frame_type, uint32_t tx_time)
 Write synchronization info to given pointer.
typedef int fhss_init_callbacks (const fhss_api_t *api, fhss_callback_t *callbacks)
 Initialize MAC functions.
typedef uint16_t mac_read_tx_queue_size (const fhss_api_t *fhss_api, bool broadcast_queue)
 Read MAC TX queue size.
typedef int mac_read_mac_address (const fhss_api_t *fhss_api, uint8_t *mac_address)
 Read MAC address.
typedef uint32_t mac_read_datarate (const fhss_api_t *fhss_api)
 Read PHY datarate.
typedef uint32_t mac_read_timestamp (const fhss_api_t *fhss_api)
 Read 32-bit timestamp.
typedef int mac_change_channel (const fhss_api_t *fhss_api, uint8_t channel_number)
 Change channel.
typedef int mac_send_fhss_frame (const fhss_api_t *fhss_api, int frame_type)
 Send FHSS frame.
typedef int mac_synch_lost_notification (const fhss_api_t *fhss_api)
 Send notification when FHSS synchronization is lost.
typedef int mac_tx_poll (const fhss_api_t *fhss_api)
 Poll TX queue.
typedef int mac_broadcast_notify (const fhss_api_t *fhss_api, uint32_t broadcast_time)
 Broadcast channel notification from FHSS.
typedef int mac_read_coordinator_mac_address (const fhss_api_t *fhss_api, uint8_t *mac_address)
 Read coordinator MAC address.
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)
 Read synchronization info for a specific peer.

Enumerations

enum  fhss_states
 

FHSS states.

More...

Detailed Description

Definition in file fhss_api.h.


Typedef Documentation

typedef bool fhss_check_tx_conditions(const fhss_api_t *api, bool is_broadcast_addr, uint8_t handle, int frame_type, uint16_t frame_length, uint8_t phy_header_length, uint8_t phy_tail_length)

Check TX permission.

Parameters:
apiFHSS instance.
is_broadcast_addrDestination address type of packet (true if broadcast address).
handleHandle of the data request.
frame_typeFrame type of packet (Frames types are defined by FHSS api).
frame_lengthMSDU length of the frame.
phy_header_lengthPHY header length.
phy_tail_lengthPHY tail length.
Returns:
false if transmission is denied, true if transmission is allowed.

Definition at line 98 of file fhss_api.h.

typedef void fhss_data_tx_done(const fhss_api_t *api, bool waiting_ack, bool tx_completed, uint8_t handle)

Data TX done callback.

Parameters:
apiFHSS instance.
waiting_ackMAC is waiting Acknowledgement for this frame.
tx_completedTX completed (Ack received or no more retries left (if unicast frame)).
handleHandle of the data request.

Definition at line 118 of file fhss_api.h.

typedef bool fhss_data_tx_fail(const fhss_api_t *api, uint8_t handle, int frame_type)

Data TX or CCA failed callback.

Parameters:
apiFHSS instance.
handleHandle of the data request.
frame_typeFrame type of packet (Frames types are defined by FHSS api).
Returns:
true if frame has to be queued for retransmission, false otherwise.

Definition at line 127 of file fhss_api.h.

typedef uint32_t fhss_get_retry_period(const fhss_api_t *api, uint8_t *destination_address, uint16_t phy_mtu)

Get additional retransmission period.

FHSS uses different retry periods depending on destination or channel availability.

Parameters:
apiFHSS instance.
destination_addressDestination MAC address.
phy_mtuPHY MTU size.
Returns:
Retransmission period in microsecond which should be added to normal backoff period.

Definition at line 152 of file fhss_api.h.

typedef int fhss_init_callbacks(const fhss_api_t *api, fhss_callback_t *callbacks)

Initialize MAC functions.

Parameters:
apiFHSS instance.
callbacksMAC functions to be called from FHSS.
Returns:
0 Success.
-1 Invalid parameters.

Definition at line 172 of file fhss_api.h.

typedef bool fhss_is_broadcast_channel(const fhss_api_t *api)

FHSS is broadcast channel.

Checks if current channel is broadcast channel.

Parameters:
apiFHSS instance.
Returns:
false if unicast channel, true if broadcast channel.

Definition at line 59 of file fhss_api.h.

typedef uint32_t fhss_read_timestamp(const fhss_api_t *api)

Read timestamp.

Parameters:
apiFHSS instance.
Returns:
Timestamp to be written in received frame.

Definition at line 143 of file fhss_api.h.

typedef void fhss_receive_frame(const fhss_api_t *api, uint16_t pan_id, uint8_t *source_address, uint32_t timestamp, uint8_t *synch_info, int frame_type)

Notification of received FHSS synch or synch request frame.

Parameters:
apiFHSS instance.
pan_idSource PAN id of the received frame (FHSS_SYNCH_FRAME only).
source_addressSource address of the received frame (FHSS_SYNCH_FRAME only).
timestampTimestamp of reception (FHSS_SYNCH_FRAME only).
synch_infoPointer to synchronization info (FHSS_SYNCH_FRAME only).
frame_typeFrame type of packet (Frames types are defined by FHSS api).

Definition at line 109 of file fhss_api.h.

typedef int16_t fhss_synch_state_set(const fhss_api_t *api, fhss_states fhss_state, uint16_t pan_id)

Change synchronization state.

Parameters:
apiFHSS instance.
fhss_stateFHSS state (FHSS states are defined by FHSS api).
pan_idPAN id of the network FHSS synchronizes with.
Returns:
-1 when failed, otherwise current MAC channel.

Definition at line 136 of file fhss_api.h.

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, uint32_t tx_time)

FHSS TX handle.

Set destination channel and write synchronization info.

Parameters:
apiFHSS instance.
is_broadcast_addrDestination address type of packet (true if broadcast address).
destination_addressDestination MAC address.
frame_typeFrame type of packet (Frames types are defined by FHSS api).
frame_lengthMSDU length of the frame.
phy_header_lengthPHY header length.
phy_tail_lengthPHY tail length.
tx_timeTX time.
Returns:
0 Success.
-1 Transmission of the packet is currently not allowed, try again.
-2 Invalid api.
-3 Broadcast packet on Unicast channel (not allowed), push packet back to queue.

Definition at line 85 of file fhss_api.h.

typedef bool fhss_use_broadcast_queue(const fhss_api_t *api, bool is_broadcast_addr, int frame_type)

FHSS queue check.

Checks if broadcast queue must be used instead of unicast queue.

Parameters:
apiFHSS instance.
is_broadcast_addrDestination address type of packet (true if broadcast address).
frame_typeFrame type of packet (Frames types are defined by FHSS api).
Returns:
false if unicast queue, true if broadcast queue.

Definition at line 68 of file fhss_api.h.

typedef int16_t fhss_write_synch_info(const fhss_api_t *api, uint8_t *ptr, uint8_t length, int frame_type, uint32_t tx_time)

Write synchronization info to given pointer.

Parameters:
apiFHSS instance.
ptrPointer to data. Start of written data for Synch frame. Start of IE header for Data frame.
lengthLength of IE header. Ignored when Synch frame.
frame_typeFrame type of packet (Frames types are defined by FHSS api).
tx_timeTX time must be referenced to the first symbol following the SFD of the transmitted frame.
Returns:
-1 on fail, write length otherwise.

Definition at line 163 of file fhss_api.h.

typedef int mac_broadcast_notify(const fhss_api_t *fhss_api, uint32_t broadcast_time)

Broadcast channel notification from FHSS.

Parameters:
fhss_apiFHSS instance.
broadcast_timeRemaining broadcast time.
Returns:
0 Success.
-1 Invalid parameters.

Definition at line 266 of file fhss_api.h.

typedef int mac_change_channel(const fhss_api_t *fhss_api, uint8_t channel_number)

Change channel.

Parameters:
fhss_apiFHSS instance.
channel_numberChannel number.
Returns:
0 Success.
-1 Invalid parameters.

Definition at line 232 of file fhss_api.h.

typedef int mac_read_coordinator_mac_address(const fhss_api_t *fhss_api, uint8_t *mac_address)

Read coordinator MAC address.

Parameters:
fhss_apiFHSS instance.
mac_addressMAC address pointer.
Returns:
0 Success.
-1 Invalid parameters.

Definition at line 275 of file fhss_api.h.

typedef uint32_t mac_read_datarate(const fhss_api_t *fhss_api)

Read PHY datarate.

Parameters:
fhss_apiFHSS instance.
Returns:
PHY datarate.

Definition at line 216 of file fhss_api.h.

typedef int mac_read_mac_address(const fhss_api_t *fhss_api, uint8_t *mac_address)

Read MAC address.

Parameters:
fhss_apiFHSS instance.
mac_addressMAC address pointer.
Returns:
0 Success.
-1 Invalid parameters.

Definition at line 209 of file fhss_api.h.

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)

Read synchronization info for a specific peer.

Parameters:
fhss_apiFHSS instance.
info_ptrPointer to info data.
mac_addressMAC address pointer.
info_typeType of the read info (UTT-IE, BT-IE, US-IE, BS-IE).
rx_timestampTime of reception of the element.
Returns:
>=0 Length of the info.
-1 Fail.

Definition at line 287 of file fhss_api.h.

typedef uint32_t mac_read_timestamp(const fhss_api_t *fhss_api)

Read 32-bit timestamp.

Parameters:
fhss_apiFHSS instance.
Returns:
Timestamp.

Definition at line 223 of file fhss_api.h.

typedef uint16_t mac_read_tx_queue_size(const fhss_api_t *fhss_api, bool broadcast_queue)

Read MAC TX queue size.

Parameters:
fhss_apiFHSS instance.
broadcast_queueQueue type to be read (true if broadcast queue).
Returns:
Queue size (number of frames queued).

Definition at line 200 of file fhss_api.h.

typedef int mac_send_fhss_frame(const fhss_api_t *fhss_api, int frame_type)

Send FHSS frame.

Parameters:
fhss_apiFHSS instance.
frame_typeFrame type of packet (Frames types are defined by FHSS api).
Returns:
0 Success.
-1 Invalid parameters.

Definition at line 241 of file fhss_api.h.

Send notification when FHSS synchronization is lost.

Parameters:
fhss_apiFHSS instance.
Returns:
0 Success.
-1 Invalid parameters.

Definition at line 249 of file fhss_api.h.

typedef int mac_tx_poll(const fhss_api_t *fhss_api)

Poll TX queue.

Parameters:
fhss_apiFHSS instance.
Returns:
0 Success.
-1 Invalid parameters.

Definition at line 257 of file fhss_api.h.


Enumeration Type Documentation

FHSS states.

Definition at line 49 of file fhss_api.h.