I guess I do now have a followup question. I can get the device to now send whatever data I want. However, there seems to be a catch. The length of the message seems to be at a fixed length. Any data I send will be preceded by unwanted repeated information, such as the network sequence number, as well as the SrcAddr. I can see that these are already previously listed in the header.
I found where these extra values are being added, and its in nwkDataReqSendFrame() in nwkDatareqSendFrame.c in the function below next the arrows.
I currently have them commented out, just to see how the header looks. And it appears that this will remove the excess values, however they are replaced with 0's, and not complete removed from the data portion of wireshark. .
So I guess my question is, where is the data frame length listed from within the framework, or how can i fully rid of these values so that only the data listed in in my array is what is contained within the wireshark data. I would like to be able to change my data length.
static void nwkDataReqSendFrame(NWK_DataReq_t *req)
{
NwkFrame_t *frame;
if (NULL == (frame = nwkFrameAlloc())) {
req->state = NWK_DATA_REQ_STATE_CONFIRM;
req->status = NWK_OUT_OF_MEMORY_STATUS;
return;
}
req->frame = frame;
req->state = NWK_DATA_REQ_STATE_WAIT_CONF;
frame->tx.confirm = nwkDataReqTxConf;
frame->tx.control = req->options &
NWK_OPT_BROADCAST_PAN_ID ?
NWK_TX_CONTROL_BROADCAST_PAN_ID
: 0;
frame->header.nwkFcf.ackRequest = req->options &
NWK_OPT_ACK_REQUEST ? 1 : 0;
frame->header.nwkFcf.linkLocal = req->options &
NWK_OPT_LINK_LOCAL ? 1 : 0;
#ifdef NWK_ENABLE_SECURITY
frame->header.nwkFcf.security = req->options &
NWK_OPT_ENABLE_SECURITY ? 1 : 0;
#endif
#ifdef NWK_ENABLE_MULTICAST
frame->header.nwkFcf.multicast = req->options &
NWK_OPT_MULTICAST ? 1 : 0;
if (frame->header.nwkFcf.multicast) {
NwkFrameMulticastHeader_t *mcHeader
= (NwkFrameMulticastHeader_t *)frame->payload;
mcHeader->memberRadius = req->memberRadius;
mcHeader->maxMemberRadius = req->memberRadius;
mcHeader->nonMemberRadius = req->nonMemberRadius;
mcHeader->maxNonMemberRadius = req->nonMemberRadius;
frame->payload += sizeof(NwkFrameMulticastHeader_t);
frame->size += sizeof(NwkFrameMulticastHeader_t);
}
#endif
//frame->header.nwkSeq = ++nwkIb.nwkSeqNum; <-----**************************************
//frame->header.nwkSrcAddr = nwkIb.addr; <------------*************************************
frame->header.nwkDstAddr = req->dstAddr;
frame->header.nwkSrcEndpoint = req->srcEndpoint;
frame->header.nwkDstEndpoint = req->dstEndpoint;
memcpy(frame->payload, req->data, req->size);
frame->size += req->size;
nwkTxFrame(frame);
}