This module provides configuration and utils for the serialization of the MAC layer in PRIME.
Macros | |
#define | NOTVALID 0 |
#define | VALID 1 |
Functions | |
static int8_t | _serial_if_mac_pack_data_conf (uint16_t us_con_handle, const uint8_t *puc_data, uint8_t uc_result, uint8_t uc_type, uint8_t uc_error_type) |
This function packs the MAC callback primitive Data.Confirm. More... | |
static int8_t | _serial_if_mac_pack_data_ind (uint16_t us_con_handle, const uint8_t *puc_data, uint16_t us_data_len, uint8_t uc_type, uint8_t uc_error_type) |
This function packs the MAC callback primitive Data.Indication. More... | |
static int8_t | _serial_if_mac_pack_establish_conf (uint16_t us_con_handle, uint8_t uc_reason, const uint8_t *puc_eui48_addr, uint8_t uc_type, const uint8_t *puc_data, uint16_t us_data_len, uint8_t uc_error_type) |
This function packs the MAC callback primitive Establish.Confirm. More... | |
static int8_t | _serial_if_mac_pack_establish_ind (uint16_t us_con_handle, const uint8_t *puc_eui48_addr, uint8_t uc_type, const uint8_t *puc_data, uint16_t us_data_len, uint16_t us_cf_bytes, uint8_t uc_error_type) |
This function packs the MAC callback primitive Establish.Indication. More... | |
static int8_t | _serial_if_mac_pack_join_conf (uint16_t us_con_handle, uint8_t uc_result, uint8_t uc_type, uint8_t uc_error_type) |
This function packs the MAC callback primitive Join.Confirm. More... | |
static int8_t | _serial_if_mac_pack_join_ind_base (uint16_t us_con_handle, const uint8_t *puc_eui48_addr, uint8_t uc_type, const uint8_t *puc_data, uint16_t us_data_len, uint8_t uc_error_type) |
This function packs the MAC callback primitive Join.Indication.Base. More... | |
static int8_t | _serial_if_mac_pack_join_ind_service (uint16_t us_con_handle, const uint8_t *puc_data, uint16_t us_data_len, uint8_t uc_type, uint8_t uc_error_type) |
This function packs the MAC callback primitive Join.Indication.Service. More... | |
static int8_t | _serial_if_mac_pack_leave_conf (uint16_t us_con_handle, uint8_t uc_result, uint8_t uc_type, uint8_t uc_error_type) |
This function packs the MAC callback primitive Leave.Confirm. More... | |
static int8_t | _serial_if_mac_pack_leave_ind_base (uint16_t us_con_handle, const uint8_t *puc_eui48_addr, uint8_t uc_type, uint8_t uc_error_type) |
This function packs the MAC callback primitive Leave.Indication.Base. More... | |
static int8_t | _serial_if_mac_pack_leave_ind_service (uint16_t us_con_handle, uint8_t uc_type, uint8_t uc_error_type) |
This function packs the MAC callback primitive Leave.Indication.Service. More... | |
static int8_t | _serial_if_mac_pack_release_conf (uint16_t us_con_handle, uint8_t uc_result, uint8_t uc_type, uint8_t uc_error_type) |
This function packs the MAC callback primitive Release.Confirm. More... | |
static int8_t | _serial_if_mac_pack_release_ind (uint16_t us_con_handle, uint8_t uc_reason, uint8_t uc_type, uint8_t uc_error_type) |
This function packs the MAC callback primitive Release.Indication. More... | |
static int | _serial_if_mac_unpack_data_req (void) |
This function extracts the MAC SAP Data.Request. More... | |
static int | _serial_if_mac_unpack_establish_req (void) |
This function extracts the MAC SAP Establish.Request. More... | |
static int | _serial_if_mac_unpack_establish_resp (void) |
This function extracts the MAC SAP Establish.Response. More... | |
static int | _serial_if_mac_unpack_join_req_base (void) |
This function extracts the MAC SAP Join.Request.Base. More... | |
static int | _serial_if_mac_unpack_join_req_service (void) |
This function extracts the MAC SAP Join.Request.Service. More... | |
static int | _serial_if_mac_unpack_join_resp_base (void) |
This function extracts the MAC SAP Join.Response.Base. More... | |
static int | _serial_if_mac_unpack_join_resp_service (void) |
This function extracts the MAC SAP Join.Response.Service. More... | |
static int | _serial_if_mac_unpack_leave_req_base (void) |
This function extracts the MAC SAP Leave.Request.Base. More... | |
static int | _serial_if_mac_unpack_leave_req_service (void) |
This function extracts the MAC SAP Leave.Request.Service. More... | |
static int | _serial_if_mac_unpack_redirect_resp (void) |
This function extracts the MAC SAP Redirect.Response. More... | |
static int | _serial_if_mac_unpack_release_req (void) |
This function extracts the MAC SAP Release.Request. More... | |
static int | _serial_if_mac_unpack_release_resp (void) |
This function extracts the MAC SAP Release.Response. More... | |
uint8_t | serial_if_mac_api_parser (uint8_t *puc_rx_msg, uint16_t us_len) |
Received message. More... | |
int8_t | serial_if_mac_process (void) |
Function to encapsulate MAC Tx Control Process. More... | |
Variables | |
static MacSapCallBack | cmd |
static uint8_t | commandMacToPack [PRIME_MACSAP_DATA_SIZE] |
static MacSapCallBack * | newMacCallBackCmd = &cmd |
static uint8_t * | puc_rx |
static uint16_t | us_rx_len |
static uint16_t | us_tx_len |
#define NOTVALID 0 |
#define VALID 1 |
|
static |
This function packs the MAC callback primitive Data.Confirm.
us_con_handle | Connection handler |
puc_data | Pointer to the data attached to the connection request |
uc_result | Result of the transmission |
uc_type | Type of convergence sublayer for the connection |
uc_error_type | Error type |
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References MAX_PDU_SIZE, and PRIME_MACSAP_DATA_CONFIRM.
Referenced by serial_if_mac_process().
|
static |
This function packs the MAC callback primitive Data.Indication.
us_con_handle | Connection handler |
puc_data | Pointer to the data attached to the connection request |
us_data_len | Data length of the data attached to the request |
uc_type | Type of convergence sublayer for the connection |
uc_error_type | Error type |
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References PRIME_MACSAP_DATA_INDICATION.
Referenced by serial_if_mac_process().
|
static |
This function packs the MAC callback primitive Establish.Confirm.
us_con_handle | Connection handler |
uc_reason | Reason for the connection indication |
puc_eui48_addr | Pointer to node's MAC address to set the connection |
uc_type | Type of convergence sublayer for the connection |
puc_data | Pointer to the data attached to the connection request |
us_data_len | Data length of the data attached to the request |
uc_error_type | Error type |
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References NOTVALID, NULL, PRIME_MAC_LENGTH, PRIME_MACSAP_ESTABLISH_CONFIRM, and VALID.
Referenced by serial_if_mac_process().
|
static |
This function packs the MAC callback primitive Establish.Indication.
us_con_handle | Connection handler |
puc_eui48_addr | Pointer to node's MAC address to set the connection |
uc_type | Type of convergence sublayer for the connection |
puc_data | Pointer to the data attached to the connection request |
us_data_len | Data length of the data attached to the request |
us_cf_bytes | Number of CFP Bytes to be allocated for the conecction |
uc_error_type | Error type |
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References NOTVALID, NULL, PRIME_MAC_LENGTH, PRIME_MACSAP_ESTABLISH_INDICATION, and VALID.
Referenced by serial_if_mac_process().
|
static |
This function packs the MAC callback primitive Join.Confirm.
us_con_handle | Connection handler |
uc_result | Result to the join indication |
uc_type | Type of convergence sublayer for the connection |
uc_error_type | Error type |
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References PRIME_MACSAP_JOIN_CONFIRM.
Referenced by serial_if_mac_process().
|
static |
This function packs the MAC callback primitive Join.Indication.Base.
us_con_handle | Connection handler |
puc_eui48_addr | Pointer to node's MAC address to set the connection |
uc_type | Type of convergence sublayer for the connection |
puc_data | Pointer to the data attached to the connection request |
us_data_len | Data length of the data attached to the request |
uc_error_type | Error type |
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References NOTVALID, NULL, PRIME_MAC_LENGTH, PRIME_MACSAP_JOIN_INDICATION_BASE, and VALID.
Referenced by serial_if_mac_process().
|
static |
This function packs the MAC callback primitive Join.Indication.Service.
us_con_handle | Connection handler |
puc_data | Pointer to the data attached to the connection request |
us_data_len | Data length of the data attached to the request |
uc_type | Type of convergence sublayer for the connection |
uc_error_type | Error type |
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References PRIME_MACSAP_JOIN_INDICATION_SERVICE.
Referenced by serial_if_mac_process().
|
static |
This function packs the MAC callback primitive Leave.Confirm.
us_con_handle | Connection handler |
uc_result | Result for the leave indication |
uc_type | Type of convergence sublayer for the connection |
uc_error_type | Error type |
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References PRIME_MACSAP_LEAVE_CONFIRM.
Referenced by serial_if_mac_process().
|
static |
This function packs the MAC callback primitive Leave.Indication.Base.
us_con_handle | Connection handler |
puc_eui48_addr | Pointer to node's MAC address to set the connection |
uc_type | Type of convergence sublayer for the connection |
uc_error_type | Error type |
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References NOTVALID, NULL, PRIME_MAC_LENGTH, PRIME_MACSAP_LEAVE_INDICATION_BASE, and VALID.
Referenced by serial_if_mac_process().
|
static |
This function packs the MAC callback primitive Leave.Indication.Service.
us_con_handle | Connection handler |
uc_type | Type of convergence sublayer for the connection |
uc_error_type | Error type |
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References PRIME_MACSAP_LEAVE_INDICATION_SERVICE.
Referenced by serial_if_mac_process().
|
static |
This function packs the MAC callback primitive Release.Confirm.
us_con_handle | Connection handler |
uc_result | Result of the release |
uc_type | Type of convergence sublayer for the connection |
uc_error_type | Error type |
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References PRIME_MACSAP_RELEASE_CONFIRM.
Referenced by serial_if_mac_process().
|
static |
This function packs the MAC callback primitive Release.Indication.
us_con_handle | Connection handler |
uc_reason | Reason for the release |
uc_type | Type of convergence sublayer for the connection |
uc_error_type | Error type |
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References PRIME_MACSAP_RELEASE_INDICATION.
Referenced by serial_if_mac_process().
|
static |
This function extracts the MAC SAP Data.Request.
0 | primitive stored |
-1 | primitive could not be stored |
References MacSapCallBack::buf, MacSapCallBack::bufLength, MacSapCallBack::handler, prime_MAC_DATA_request(), MacSapCallBack::priority, and puc_rx.
Referenced by serial_if_mac_api_parser().
|
static |
This function extracts the MAC SAP Establish.Request.
0 | primitive stored |
-1 | primitive could not be stored |
References MacSapCallBack::arq, MacSapCallBack::buf, MacSapCallBack::bufLength, MacSapCallBack::cfpBytes, MacSapCallBack::macAddr, prime_MAC_ESTABLISH_request(), PRIME_MAC_LENGTH, puc_rx, MacSapCallBack::type, and VALID.
Referenced by serial_if_mac_api_parser().
|
static |
This function extracts the MAC SAP Establish.Response.
0 | primitive stored |
-1 | primitive could not be stored |
References MacSapCallBack::answer, MacSapCallBack::buf, MacSapCallBack::bufLength, MacSapCallBack::handler, prime_MAC_ESTABLISH_response(), and puc_rx.
Referenced by serial_if_mac_api_parser().
|
static |
This function extracts the MAC SAP Join.Request.Base.
0 | primitive stored |
-1 | primitive could not be stored |
References MacSapCallBack::broadcast, MacSapCallBack::buf, MacSapCallBack::bufLength, MacSapCallBack::handler, MacSapCallBack::macAddr, prime_MAC_JOIN_request_base(), PRIME_MAC_LENGTH, puc_rx, and MacSapCallBack::type.
Referenced by serial_if_mac_api_parser().
|
static |
This function extracts the MAC SAP Join.Request.Service.
0 | primitive stored |
-1 | primitive could not be stored |
References MacSapCallBack::broadcast, MacSapCallBack::buf, MacSapCallBack::bufLength, prime_MAC_JOIN_request_service(), puc_rx, and MacSapCallBack::type.
Referenced by serial_if_mac_api_parser().
|
static |
This function extracts the MAC SAP Join.Response.Base.
0 | primitive stored |
-1 | primitive could not be stored |
References MacSapCallBack::answer, MacSapCallBack::handler, MacSapCallBack::macAddr, prime_MAC_JOIN_response_base(), PRIME_MAC_LENGTH, and puc_rx.
Referenced by serial_if_mac_api_parser().
|
static |
This function extracts the MAC SAP Join.Response.Service.
0 | primitive stored |
-1 | primitive could not be stored |
References MacSapCallBack::answer, MacSapCallBack::handler, prime_MAC_JOIN_response_service(), and puc_rx.
Referenced by serial_if_mac_api_parser().
|
static |
This function extracts the MAC SAP Leave.Request.Base.
0 | primitive stored |
-1 | primitive could not be stored |
References MacSapCallBack::handler, MacSapCallBack::macAddr, prime_MAC_LEAVE_request_base(), PRIME_MAC_LENGTH, and puc_rx.
Referenced by serial_if_mac_api_parser().
|
static |
This function extracts the MAC SAP Leave.Request.Service.
0 | primitive stored |
-1 | primitive could not be stored |
References MacSapCallBack::handler, prime_MAC_LEAVE_request_service(), and puc_rx.
Referenced by serial_if_mac_api_parser().
|
static |
This function extracts the MAC SAP Redirect.Response.
0 | primitive stored |
-1 | primitive could not be stored |
References MacSapCallBack::buf, MacSapCallBack::bufLength, MacSapCallBack::handler, MacSapCallBack::macAddr, PRIME_MAC_LENGTH, prime_MAC_REDIRECT_response(), and puc_rx.
Referenced by serial_if_mac_api_parser().
|
static |
This function extracts the MAC SAP Release.Request.
0 | primitive stored |
-1 | primitive could not be stored |
References MacSapCallBack::handler, prime_MAC_RELEASE_request(), and puc_rx.
Referenced by serial_if_mac_api_parser().
|
static |
This function extracts the MAC SAP Release.Response.
0 | primitive stored |
-1 | primitive could not be stored |
References MacSapCallBack::answer, MacSapCallBack::handler, prime_MAC_RELEASE_response(), and puc_rx.
Referenced by serial_if_mac_api_parser().
uint8_t serial_if_mac_api_parser | ( | uint8_t * | puc_rx_msg, |
uint16_t | us_len | ||
) |
Received message.
puc_rx_msg | Pointer to the data attached to the connection request |
us_len | Data length of the data attached to the request |
true | primitive stored |
false | primitive could not be stored |
References _serial_if_mac_unpack_data_req(), _serial_if_mac_unpack_establish_req(), _serial_if_mac_unpack_establish_resp(), _serial_if_mac_unpack_join_req_base(), _serial_if_mac_unpack_join_req_service(), _serial_if_mac_unpack_join_resp_base(), _serial_if_mac_unpack_join_resp_service(), _serial_if_mac_unpack_leave_req_base(), _serial_if_mac_unpack_leave_req_service(), _serial_if_mac_unpack_redirect_resp(), _serial_if_mac_unpack_release_req(), _serial_if_mac_unpack_release_resp(), CMD_PRIME_PROTOCOL, PRIME_MACSAP_DATA_REQUEST, PRIME_MACSAP_ESTABLISH_REQUEST, PRIME_MACSAP_ESTABLISH_RESPONSE, PRIME_MACSAP_JOIN_REQUEST_BASE, PRIME_MACSAP_JOIN_REQUEST_SERVICE, PRIME_MACSAP_JOIN_RESPONSE_BASE, PRIME_MACSAP_JOIN_RESPONSE_SERVICE, PRIME_MACSAP_LEAVE_REQUEST_BASE, PRIME_MACSAP_LEAVE_REQUEST_SERVICE, PRIME_MACSAP_REDIRECT_RESPONSE, PRIME_MACSAP_RELEASE_REQUEST, and PRIME_MACSAP_RELEASE_RESPONSE.
Referenced by _process_msg().
int8_t serial_if_mac_process | ( | void | ) |
Function to encapsulate MAC Tx Control Process.
0 | if the request has been made to the CS layer |
-1 | if it was unable to pass the request to the CS layer |
References _serial_if_mac_pack_data_conf(), _serial_if_mac_pack_data_ind(), _serial_if_mac_pack_establish_conf(), _serial_if_mac_pack_establish_ind(), _serial_if_mac_pack_join_conf(), _serial_if_mac_pack_join_ind_base(), _serial_if_mac_pack_join_ind_service(), _serial_if_mac_pack_leave_conf(), _serial_if_mac_pack_leave_ind_base(), _serial_if_mac_pack_leave_ind_service(), _serial_if_mac_pack_release_conf(), _serial_if_mac_pack_release_ind(), MacSapCallBack::answer, MacSapCallBack::buf, MacSapCallBack::bufLength, MacSapCallBack::cfpBytes, MacSapCallBack::command, MacSapCallBack::errorType, GENERIC_CALLBACK_HANDLER, GENERIC_CALLBACK_TYPE, MacSapCallBack::handler, MacSapCallBack::macAddr, NULL, prime_MAC_callback(), PRIME_MACSAP_DATA_CONFIRM, PRIME_MACSAP_DATA_INDICATION, PRIME_MACSAP_ESTABLISH_CONFIRM, PRIME_MACSAP_ESTABLISH_INDICATION, PRIME_MACSAP_JOIN_CONFIRM, PRIME_MACSAP_JOIN_INDICATION_BASE, PRIME_MACSAP_JOIN_INDICATION_SERVICE, PRIME_MACSAP_LEAVE_CONFIRM, PRIME_MACSAP_LEAVE_INDICATION_BASE, PRIME_MACSAP_LEAVE_INDICATION_SERVICE, PRIME_MACSAP_RELEASE_CONFIRM, PRIME_MACSAP_RELEASE_INDICATION, PROTOCOL_MAC_PRIME, x_usi_serial_cmd_params_t::ptr_buf, MacSapCallBack::type, x_usi_serial_cmd_params_t::uc_protocol_type, x_usi_serial_cmd_params_t::us_len, us_tx_len, and usi_send_cmd().
|
static |
|
static |
|
static |
|
static |
Referenced by _serial_if_mac_unpack_data_req(), _serial_if_mac_unpack_establish_req(), _serial_if_mac_unpack_establish_resp(), _serial_if_mac_unpack_join_req_base(), _serial_if_mac_unpack_join_req_service(), _serial_if_mac_unpack_join_resp_base(), _serial_if_mac_unpack_join_resp_service(), _serial_if_mac_unpack_leave_req_base(), _serial_if_mac_unpack_leave_req_service(), _serial_if_mac_unpack_redirect_resp(), _serial_if_mac_unpack_release_req(), and _serial_if_mac_unpack_release_resp().
|
static |
|
static |
Referenced by serial_if_mac_process().