This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1310: EasyLink_transmit's requirements for data packets

Part Number: CC1310


Hi Team,

The EasyLink_transmit function is implemented as follows:

EasyLink_Status EasyLink_transmit(EasyLink_TxPacket *txPacket)
{
RF_CmdHandle cmdHdl;
uint8_t *pu8Data;

EasyLink_Status status = EasyLink_Status_Tx_Error;

if ( (!configured) || suspended)
{
return EasyLink_Status_Config_Error;
}
if (txPacket->len > EASYLINK_MAX_DATA_LENGTH)
{
return EasyLink_Status_Param_Error;
}
//Check and take the busyMutex
if (Semaphore_pend(busyMutex, 0) == false)
{
return EasyLink_Status_Busy_Error;
}

/* Transmit */
pTransmitDataEntry = (rfc_dataEntryGeneral_t*)txBuffer;
pTransmitDataEntry->length = txPacket->len + NUM_APPENDED_BYTES_TX;
pTransmitDataEntry->status = DATA_ENTRY_PENDING;
pTransmitDataEntry->pNextEntry = (uint8_t*)pTransmitDataEntry; // Circle buffer.

dataTxQueue.pCurrEntry = (uint8_t*)pTransmitDataEntry;
dataTxQueue.pLastEntry = NULL;
/* txPaket copy and send. */
pu8Data = &pTransmitDataEntry->data;
memcpy(pu8Data, &txPacket->payload, txPacket->len);

memcpy(&EasyLink_cmdTx, &RF_cmdTxHS, sizeof(RF_cmdTxHS));
EasyLink_cmdTx.pQueue = &dataTxQueue;
EasyLink_cmdTx.startTrigger.triggerType = TRIG_NOW;
EasyLink_cmdTx.startTrigger.pastTrig = 1;
EasyLink_cmdTx.startTime = 0;
// RF_cmdTxHS.startTime = time;

RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&EasyLink_cmdTx, RF_PriorityHigh, 0, 0);

// cmdHdl = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdTxHS, RF_PriorityNormal, &tx_callback, 0);
/* Wait for Command to complete */
// RF_EventMask result = RF_pendCmd(rfHandle, cmdHdl, EASYLINK_RF_EVENT_MASK);

if (result & RF_EventLastCmdDone)
{
status = EasyLink_Status_Success;
}

//Release the busyMutex
Semaphore_post(busyMutex);


return status;
}

Among them, EASYLINK_MAX_DATA_LENGTH is 256.

txPacket[0] = 0xCC

txPacket[1] = 0x77,

txPacket[2] = a multiple of 16, which is less than or equal to 250

During the test, I found that if txPacket[3-5] were 0 at the same time (that is, txPacket[3] = 0x0, txPacket[4] = 0x0, txPacket[5] = 0x0), EasyLink_transmit would fail to execute.

What kind of requirements does EasyLink_transmit have for txPacket?

Thanks,

Katherine

  • The structure for the txPacket is defined in EasyLink.h and looks like this:

    //! \brief Structure for the TX Packet
    typedef struct
    {
    uint8_t dstAddr[8]; //!< Destination address
    uint32_t absTime; //!< Absolute time to Tx packet (0 for immediate)
    //!< Layer will use last SeqNum used + 1
    
    uint8_t len; //!< Payload Length
    uint8_t payload[EASYLINK_MAX_DATA_LENGTH]; //!< Payload
    } EasyLink_TxPacket;

    You should not overwrite any of the fields in the packet manually, but only make changes to the length through defines, and the payload, through txPacket.payload

    If you have problems using the EasyLink_transmit function, you need to provide an example that runs on our LP, that illustrate the failure you are seeing.

    Siri

  • In order to improve bandwidth utilization, we modified the structure of EasyLink_TxPacket as follows:

    typedef __RFC_STRUCT struct
    {
    uint16_t len;
    uint8_t payload[EASYLINK_MAX_DATA_LENGTH];
    } __RFC_STRUCT_ATTR EasyLink_TxPacket;

    In the EasyLink_TxPacket structure in the reference code, is there any requirement for the value of dstAddr?

    Katherine

  • We do not have any guidelines as to what you need to change in EasyLink if you start messing with the packet structure that the complete API is based upon.

    I strongly recommend that you do not change anything in the EasyLink implementation. 

    If you do, you need to figure out yourself what consequences that have, and what else needs to be changed to not "break" anything.

    If the packet format of EasyLink does not fit your application needs, you should simply base your application directly on the prop API (CMD_PROP_RX and CMD_PROP_TX, or the advanced command). This is much easier that trying to change the EasyLink API.

    SIri