NWK_DataReq() implementation.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "sysConfig.h"
#include "nwk.h"
#include "nwkTx.h"
#include "nwkFrame.h"
#include "nwkGroup.h"
#include "nwkDataReq.h"
Enumerations | |
enum | { NWK_DATA_REQ_STATE_INITIAL, NWK_DATA_REQ_STATE_WAIT_CONF, NWK_DATA_REQ_STATE_CONFIRM } |
Functions | |
void | NWK_DataReq (NWK_DataReq_t *req) |
Adds request req to the queue of outgoing requests. More... | |
static void | nwkDataReqConfirm (NWK_DataReq_t *req) |
Confirms request to the application and remove it from the queue. More... | |
void | nwkDataReqInit (void) |
Initializes the Data Request module. More... | |
static void | nwkDataReqSendFrame (NWK_DataReq_t *req) |
Prepares and send outgoing frame based on the request req parameters. More... | |
void | nwkDataReqTaskHandler (void) |
Data Request module task handler. More... | |
static void | nwkDataReqTxConf (NwkFrame_t *frame) |
Frame transmission confirmation handler. More... | |
Variables | |
static NWK_DataReq_t * | nwkDataReqQueue |
anonymous enum |
void NWK_DataReq | ( | NWK_DataReq_t * | req | ) |
Adds request req to the queue of outgoing requests.
[in] | req | Pointer to the request parameters |
References NWK_DataReq_t::frame, NwkIb_t::lock, NWK_DataReq_t::next, NULL, NWK_DATA_REQ_STATE_INITIAL, NWK_SUCCESS_STATUS, nwkDataReqQueue, nwkIb, NWK_DataReq_t::state, and NWK_DataReq_t::status.
Referenced by appCmdDataRequest(), and appSendData().
|
static |
Confirms request to the application and remove it from the queue.
[in] | req | Pointer to the request parameters |
References NWK_DataReq_t::confirm, NwkIb_t::lock, NWK_DataReq_t::next, nwkDataReqQueue, and nwkIb.
Referenced by nwkDataReqTaskHandler().
void nwkDataReqInit | ( | void | ) |
|
static |
Prepares and send outgoing frame based on the request req parameters.
[in] | req | Pointer to the request parameters |
References NwkFrameHeader_t::ackRequest, NwkIb_t::addr, NWK_DataReq_t::data, NWK_DataReq_t::dstAddr, NWK_DataReq_t::dstEndpoint, NWK_DataReq_t::frame, NwkFrame_t::header, NwkFrameHeader_t::linkLocal, NwkFrameMulticastHeader_t::maxMemberRadius, NwkFrameMulticastHeader_t::maxNonMemberRadius, NwkFrameMulticastHeader_t::memberRadius, NwkFrameHeader_t::multicast, NwkFrameMulticastHeader_t::nonMemberRadius, NULL, NWK_DATA_REQ_STATE_CONFIRM, NWK_DATA_REQ_STATE_WAIT_CONF, NWK_OPT_ACK_REQUEST, NWK_OPT_BROADCAST_PAN_ID, NWK_OPT_ENABLE_SECURITY, NWK_OPT_LINK_LOCAL, NWK_OPT_MULTICAST, NWK_OUT_OF_MEMORY_STATUS, NWK_TX_CONTROL_BROADCAST_PAN_ID, nwkDataReqTxConf(), NwkFrameHeader_t::nwkDstAddr, NwkFrameHeader_t::nwkDstEndpoint, NwkFrameHeader_t::nwkFcf, nwkFrameAlloc(), nwkIb, NwkFrameHeader_t::nwkSeq, NwkIb_t::nwkSeqNum, NwkFrameHeader_t::nwkSrcAddr, NwkFrameHeader_t::nwkSrcEndpoint, nwkTxFrame(), NWK_DataReq_t::options, NwkFrame_t::payload, NwkFrameHeader_t::security, NWK_DataReq_t::size, NwkFrame_t::size, NWK_DataReq_t::srcEndpoint, NWK_DataReq_t::state, NWK_DataReq_t::status, and NwkFrame_t::tx.
Referenced by nwkDataReqTaskHandler().
void nwkDataReqTaskHandler | ( | void | ) |
Data Request module task handler.
References NWK_DataReq_t::next, NWK_DATA_REQ_STATE_CONFIRM, NWK_DATA_REQ_STATE_INITIAL, NWK_DATA_REQ_STATE_WAIT_CONF, nwkDataReqConfirm(), and nwkDataReqSendFrame().
Referenced by NWK_TaskHandler().
|
static |
Frame transmission confirmation handler.
[in] | frame | Pointer to the sent frame |
References NWK_DataReq_t::next, NWK_DATA_REQ_STATE_CONFIRM, nwkFrameFree(), and NwkFrame_t::tx.
Referenced by nwkDataReqSendFrame().
|
static |
Referenced by NWK_DataReq(), and nwkDataReqConfirm().