1.4.3.5 PAL_PLC_TxRequest Function

C

void PAL_PLC_TxRequest(PAL_PLC_HANDLE handle, uint8_t *pData, uint16_t length);

Summary

Allows a client to transmit data through PLC device.

Description

This routine sends a new data message through PLC using the PLC PAL module. The message must have a valid IEEE 802.15.4 MAC format with its corresponding MAC header.

Precondition

PAL_PLC_HandleGet must have been called to obtain a valid PLC PAL handle.

Parameters

ParamDescription
handleA valid handle, returned from PAL_PLC_HandleGet.
pDataPointer to the data to transmit.
lengthLength of the data to transmit in bytes.

Returns

None.

Example

// 'palPlcHandle', returned from the PAL_PLC_HandleGet
MAC_RT_HEADER macHeader;
uint16_t totalLength;
uint16_t headerLength;
uint16_t payloadLength = 100;
uint8_t txData[MAC_RT_DATA_MAX_SIZE];
uint8_t payloadData[MAC_RT_MAX_PAYLOAD_SIZE];

// Local function implemented in the upper layer
headerLength = _buildMacHeader(txData, &macHeader);

memcpy(&txData[headerLength], payloadData, payloadLength);
totalLength = headerLength + payloadLength;

PAL_PLC_TxRequest(palPlcHandle, txData, totalLength);

Remarks

None.