One board uses smartrf to receive , and the other runs the tx application. Bellow shows the code, anyone please give me a hand, thanks in advance!
void echoTxDoneCb(EasyLink_Status status) { if (status == EasyLink_Status_Success) { /* Toggle LED1 to indicate TX */ PIN_setOutputValue(ledPinHandle, Board_PIN_LED1,!PIN_getOutputValue(Board_PIN_LED1)); /* Turn LED2 off, in case there was a prior error */ PIN_setOutputValue(ledPinHandle, Board_PIN_LED2, 0); } else { /* Set both LED1 and LED2 to indicate error */ PIN_setOutputValue(ledPinHandle, Board_PIN_LED1, !PIN_getOutputValue(Board_PIN_LED1)); PIN_setOutputValue(ledPinHandle, Board_PIN_LED2, 1); } Semaphore_post(echoDoneSem); } static void concentratorRadioTaskFunction(UArg arg0, UArg arg1) { /* Create a semaphore for Async */ Semaphore_Params params; Error_Block eb; /* Init params */ Semaphore_Params_init(¶ms); Error_init(&eb); /* Create semaphore instance */ echoDoneSem = Semaphore_create(0, ¶ms, &eb); if(echoDoneSem == NULL) { System_abort("Semaphore creation failed"); } /* Initialize EasyLink */ EasyLink_Params easyLink_params; EasyLink_Params_init(&easyLink_params); easyLink_params.ui32ModType = RADIO_EASYLINK_MODULATION; if(EasyLink_init(&easyLink_params) != EasyLink_Status_Success){ System_abort("EasyLink_init failed"); } EasyLink_getAbsTime(&absTime); while (1) { /* Create packet with incrementing sequence number and random payload */ txPacket.payload[0] = (uint8_t)(seqNumber >> 8); txPacket.payload[1] = (uint8_t)(seqNumber++); uint8_t i; for (i = 2; i < RFEASYLINKECHO_PAYLOAD_LENGTH; i++) { txPacket.payload[i] = rand(); } txPacket.len = RFEASYLINKECHO_PAYLOAD_LENGTH; txPacket.dstAddr[0] = 0xaa; txPacket.absTime = absTime + EasyLink_ms_To_RadioTime(1000); EasyLink_transmitAsync(&txPacket, echoTxDoneCb); /* Wait for Tx to complete. A Successful TX will cause the echoTxDoneCb * to be called and the echoDoneSem to be released, so we must * consume the echoDoneSem */ Semaphore_pend(echoDoneSem, BIOS_WAIT_FOREVER); /* Switch to Receiver */ EasyLink_receiveAsync(echoRxDoneCb, 0); /* Wait 1000ms for Rx */ if(Semaphore_pend(echoDoneSem, (1000000 / Clock_tickPeriod)) == FALSE) { /* RX timed out abort */ if(EasyLink_abort() == EasyLink_Status_Success) { /* Wait for the abort */ Semaphore_pend(echoDoneSem, BIOS_WAIT_FOREVER); } } } }