static void txTaskFunction(UArg arg0, UArg arg1) { uint32_t time; RF_Params rfParams; RF_Params_init(&rfParams); while(1) { Semaphore_pend(semTxHandle, BIOS_WAIT_FOREVER); uint8_t j=0; static uint8_t veri[]="0123456789\r\n"; //12 karakter static uint8_t packet[PAYLOAD_LENGTH]; uint8_t i; for (i = 0; i < PAYLOAD_LENGTH; i++) { //packet[i] = rand(); packet[i] = veri[j]; j++; if(j==12) //12 kARAKTER { j=0; } } RF_cmdPropTx.pktLen = 12; RF_cmdPropTx.pPkt = packet; RF_cmdPropTx.startTrigger.triggerType = TRIG_ABSTIME; RF_cmdPropTx.startTrigger.pastTrig = 1; if (!rfHandle){ /* Request access to the radio */ rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams); /* Set the frequency */ RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0); } /* Get current time */ time = RF_getCurrentTime(); /* Set absolute TX time to utilize automatic power management */ time += PACKET_INTERVAL; RF_cmdPropTx.startTime = time; /* Send RF_Data.Raw_Buffer */ rfTxCmd = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0); RF_EventMask result = RF_pendCmd(rfHandle, rfTxCmd, (RF_EventCmdDone | RF_EventCmdError | RF_EventLastCmdDone | RF_EventCmdAborted | RF_EventCmdCancelled | RF_EventCmdStopped)); if (!(result & RF_EventLastCmdDone)) { /* Error */ while(1); } PIN_setOutputValue(pinHandle, Board_PIN_LED0,!PIN_getOutputValue(Board_PIN_LED0)); memset(packet, 0, sizeof(packet)); //clear buffer Semaphore_post(semRxHandle); } }