Hello everyone,
I am trying to create a structure by defining 2 different txEntry, one 260bit/32byte and the other 255byte, sending one of them 50 times and sending the other one once. This is exactly what I want to do:
sync_entry[33] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33} --> send 1 times. When 50 sends(sync_data_entry) are completed
data_entry[255] = {0}; --> send 50 times
To perform the above operation;
1. First of all, I define 2 different entities.
2. I'm running the RF_EventTxEntryDone callback with RF_runCmd.
3. I keep a counter every time the callback is active.
4. I change txQueu.pCurrEntry according to the status of this counter.
The relevant code is below;
rfc_dataEntryPointer_t txEntry;
rfc_dataEntryPointer_t sync_txEntry;
dataQueue_t txQueue;
void *rf_transmitThread(void *arg0)
{
txEntry.pNextEntry = (uint8_t*)&txEntry;
txEntry.status = DATA_ENTRY_PENDING;
txEntry.config.type = DATA_ENTRY_TYPE_PTR;
txEntry.pData = (uint8_t*)data_entry;
txEntry.length = sizeof(data_entry);
sync_txEntry.pNextEntry = (uint8_t*)&sync_txEntry;
sync_txEntry.status = DATA_ENTRY_PENDING;
sync_txEntry.config.type = DATA_ENTRY_TYPE_PTR;
sync_txEntry.pData = (uint8_t*)sync_entry;
sync_txEntry.length = sizeof(sync_entry);
txQueue.pCurrEntry = (uint8_t*)&sync_txEntry;
txQueue.pLastEntry = NULL;
while(1)
{
RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTxAdv, RF_PriorityNormal, &callback, RF_EventTxEntryDone);
}
}
void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
{
if ( e & RF_EventTxEntryDone)
{
tx_entry_counter++;
}
if(tx_entry_counter % 50 == 0)
{
txQueue.pCurrEntry = (uint8_t*)&sync_txEntry;
}
else
{
txQueue.pCurrEntry = (uint8_t*)&txEntry;
}
}
When I decode the data in the spectrum analyzer, I observe that the sync packet is not sent at all.
What I'm wondering is this. Does RF_EventTxEntryDone inform that the block we want has left the RF? When I read the description, I see that it only informs the queue that the packet has been received. Do you think there is any problem in the example I gave?
Sincelery