📄 radiomanagement.h
字号:
#define smac_pdu_size(x) (sizeof(smac_pdu_t)+x-1)
/* ------------------------------------------------------------------------------*/
/* HOW TO USE message_t STRUCTURE */
/* +--------------+--------------+--------------+--------------|*/
/* | TX | RX | ED | TO |*/
/* |----------------+--------------+--------------+--------------+--------------|*/
/* | u8Status | Msg type and state |*/
/* |----------------+--------------+--------------+--------------+--------------|*/
/* | | Location of | Start add. of| Addr to store| Timeout |*/
/* | pu8Buffer | the data to |the reception | the ED value | value |*/
/* | | be transmited| buffer | | |*/
/* |----------------+--------------+--------------+--------------+--------------|*/
/* | | Size in bytes| Number of | Channel | |*/
/* | u8BufSize | to be | received | to assess | * |*/
/* | | transmited | bytes | ED | |*/
/* |----------------+--------------+--------------+--------------+--------------|*/
/* |cbDataIndication| Callback to be executed when the requested action finish |*/
/* |----------------+--------------+--------------+--------------+--------------|*/
typedef struct message_tag {
msg_status_t u8Status;
smac_pdu_t *pu8Buffer;
uint8_t u8BufSize;
callback_t cbDataIndication;
} message_t;
typedef enum repeat_option_tag {
DO_NOT_REPEAT = 0,
REPEAT_AFTER_WAIT_PERIOD,
REPEAT_ASAP
} repeat_option_t;
/************************************************************************************
*************************************************************************************
* Public prototypes
*************************************************************************************
************************************************************************************/
/************************************************************************************
*************************************************************************************
* Public memory declarations
*************************************************************************************
************************************************************************************/
extern evnt_flags_t gRadioEvntFlags;
extern bool_t bScanReqFlag;
extern vScanCallback_t vScanReqCallBack;
extern uint16_t u16ChannToScan;
extern uint8_t u8ScanValPerChann[TOTAL_CHANN];
/************************************************************************************
*************************************************************************************
* Public functions
*************************************************************************************
************************************************************************************/
/************************************************************************************
* This function aborts a message.
*
* Interface assumptions:
*
* Routine limitations.
*
* Return value: void.
*
* Effects on global data:
*
* Source of algorithm used:
*
* Revison history:
* date Author Comments
* ------ ------ --------
*
************************************************************************************/
extern FuncReturn_t abort_message (message_t * msg);
/************************************************************************************
* This function changes the state of the current message.
*
* Interface assumptions:
*
* Routine limitations.
*
* Return value: void.
*
* Effects on global data:
*
* Source of algorithm used:
*
* Revison history:
* date Author Comments
* ------ ------ --------
*
************************************************************************************/
extern void change_current_message_state (any_mssg_state_t mssg_state);
/************************************************************************************
* This function excutes the current message callback.
*
* Interface assumptions: Application must not call this function
*
* Routine limitations.
*
* Return value:
*
* Effects on global data:
*
* Source of algorithm used:
*
* Revison history:
* date Author Comments
* ------ ------ --------
*
************************************************************************************/
extern void execute_current_message_callback (void);
/************************************************************************************
* This function returns a pointer to the message that is been processed, it will
* return NULL if there is no message.
*
* Interface assumptions: None
*
* Routine limitations.
*
* Return value: The pointer to the message that is been processed.
*
* Effects on global data: None
*
* Source of algorithm used:
*
* Revison history:
* date Author Comments
* ------ ------ --------
*
************************************************************************************/
extern message_t* get_current_message (void);
/************************************************************************************
* This function handle a new message to the queu.
*
* Interface assumptions:
*
* Routine limitations.
*
* Return value: SUCSESS - Released from the queu.
*
* Effects on global data:
*
* Source of algorithm used:
*
* Revison history:
* date Author Comments
* ------ ------ --------
*
************************************************************************************/
extern FuncReturn_t handle_new_message (message_t *, uint32_t);
/************************************************************************************
* This function process any TX/RX pending msg.
*
* Interface assumptions: This function shall be called on periodic basis
*
* Routine limitations.
*
* Return value:
*
* Effects on global data:
*
* Source of algorithm used:
*
* Revison history:
* date Author Comments
* ------ ------ --------
*
************************************************************************************/
extern FuncReturn_t process_radio_msg (void);
/************************************************************************************
* This function initializes all the module variables involved in the radio management
*
* Interface assumptions: It must be called during the inicialization
*
* Routine limitations.
*
* Return value: SUCSESS - Any case
*
* Effects on global data: None
*
* Source of algorithm used:
*
* Revison history:
* date Author Comments
* ------ ------ --------
*
************************************************************************************/
extern FuncReturn_t radio_manager_init (void);
/************************************************************************************
* This function releases the current message from the queu.
*
* Interface assumptions: Application will not modify the data passed to this handler
* until the message status is updated to RELEASED
*
* Routine limitations.
*
* Return value: SUCSESS - If the message could be allocated.
* FAIL_NO_RESOURCES_AVILABLE - If the is no memory available to
* handle the message.
*
* Effects on global data:
*
* Source of algorithm used:
*
* Revison history:
* date Author Comments
* ------ ------ --------
*
************************************************************************************/
extern FuncReturn_t release_current_message (void);
/**********************************************************************************/
#endif /* _RADIO_MNGMT_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -