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.

LAUNCHXL-CC1310: EasyLink_enableRxAddrFilter for multiple devices

Part Number: CC1310

I have to configure CC1310 devices in a star network.
The central device is a CC1310 that interacts with several CC1310 devices wirelessly. The address has been configured to be 8 bytes.
Could someone please guide me on how to use the => EasyLink_enableRxAddrFilter function to get my central device to synchronize independently with each of the surrounding devices without affecting the others.

The Easylink version implemented is 4.20.02.07

  • Hello Siri.
    I have read the information in the threads provided.

    At the moment I have been presented with a problem. In my code I try to set up a communication between two CC1310 initializing the sender address ( that works fine) the problem appears when I try to perform a transmission by the ceceptor with a broadcast address to inform the message to other devices. At this point the program is blocked.

    Is there a way to disable the destination address in the receiver and switch to another one?

    Attached is the code block.


     static void Task_Nozzle_ON(UArg arg0, UArg arg1){
    
     EasyLink_enableRxAddrFilter(global,8,1);
     EasyLink_receiveAsync(RxCb, 0);
    
     while (true){
    
     if(mFlag){
    
        switch(Conection.status){
    
        case Active:{
    
            Conecton.status = sleep;
        break;
        }
    
    
        case sleep: {
            Conection.status = NFC;
        break;
        }
    
        case NFC:{
            Conection.status = Broadcast_Send;
        break;
        }// 
    
        case Broadcast_Send:{
            txPacket.payload[0] =  0x6E;
            txPacket.payload[1] =  0xA2;
    
            memcpy(txPacket.dstAddr,dir_Broadcast, sizeof(dir_Broadcast));
            txPacket.len = 2;
            EasyLink_transmitAsync(&txPacket, TxCb);//*/
        break;
        }
    

    Thank you very much Siri. 

  • I am afraid that I do not fully understand how you want to use the address filtering, so I will just share some simple examples:

    I used the default rfEasyLinkTx and rfEasyLinkRx as a starting point, but simplified the application like this:

    TX:

    static void rfEasyLinkTxFnx(UArg arg0, UArg arg1)
    {
        // Initialize the EasyLink parameters to their default values
        EasyLink_Params easyLink_params;
        EasyLink_Params_init(&easyLink_params);
    
        if(EasyLink_init(&easyLink_params) != EasyLink_Status_Success)
        {
            System_abort("EasyLink_init failed");
        }
    
        while(1)
        {
            EasyLink_TxPacket txPacket =  { {0}, 0, 0, {0} };
    
            uint8_t i;
            for (i = 0; i < RFEASYLINKTXPAYLOAD_LENGTH; i++)
            {
              txPacket.payload[i] = i + 1;
            }
    
            txPacket.len = RFEASYLINKTXPAYLOAD_LENGTH;
            txPacket.absTime = 0;
            txPacket.dstAddr[0] = 0xAA;
    
            EasyLink_Status result = EasyLink_transmit(&txPacket);
    
            if (result == EasyLink_Status_Success)
            {
                PIN_setOutputValue(pinHandle, Board_PIN_LED1,!PIN_getOutputValue(Board_PIN_LED1));
            }
            else
            {
                PIN_setOutputValue(pinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2));
            }
            sleep(1);
        }
    }
    

    RX:

    static void rfEasyLinkRxFnx(UArg arg0, UArg arg1)
    {
        EasyLink_RxPacket rxPacket = {0};
    
    
        // Initialize the EasyLink parameters to their default values
        EasyLink_Params easyLink_params;
        EasyLink_Params_init(&easyLink_params);
    
        /*
         * Initialize EasyLink with the settings found in easylink_config.h
         * Modify EASYLINK_PARAM_CONFIG in easylink_config.h to change the default
         * PHY
         */
        if(EasyLink_init(&easyLink_params) != EasyLink_Status_Success)
        {
            System_abort("EasyLink_init failed");
        }
    
        while(1)
        {
            rxPacket.absTime = 0;
            EasyLink_Status result = EasyLink_receive(&rxPacket);
    
            if (result == EasyLink_Status_Success)
            {
                /* Toggle LED2 to indicate RX */
                PIN_setOutputValue(pinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2));
            }
            else
            {
                /* Toggle LED1 and LED2 to indicate error */
                PIN_setOutputValue(pinHandle, Board_PIN_LED1,!PIN_getOutputValue(Board_PIN_LED1));
            }
        }
    }
    

    By default, both devices have 1 byte address 0xAA that it is filtering on (only packets with address 0xAA is accepted).

    In rfEasyLinkTxFnx, the address is written to the packet like this:

    txPacket.dstAddr[0] = 0xAA;

    This packet will be received by the receiver, and you will see that dstAddr in rxPacket is set to 0xAA when a packet is received.

    If you write something else on the transmitter side, like:

    txPacket.dstAddr[0] = 0xCC;

    This packet will not be received.

    If you want the receiver to receive packets with this address as well, you can add the following to the rfEasyLinkRxFnx

    uint8_t addressTable[] = {0xAA, 0xCC};
    EasyLink_enableRxAddrFilter(addressTable, 1, 2);
    

    Now the receiver will receive both packets sent with address 0xAA and address 0xCC.

    Which address was received can be seen in dstAddr in rxPacket

    Assume you want to use a 4 byte long address instead, and want the receiver to receive packets with the following addresses.

    0xAABBCCDD and 0x11223344

    the following needs to be added added in the RX code:

    EasyLink_setCtrl(EasyLink_Ctrl_AddSize, 4); // Addresses are 4 bytes long
    
    uint32_t addressTable[] = {0xDDCCBBAA,
                               0x44332211};
    
    EasyLink_enableRxAddrFilter(addressTable, 4, 2); // 2 addresses of 4 bytes each
    
    

    On the TX side, you will do the following:

    EasyLink_setCtrl(EasyLink_Ctrl_AddSize, 4);
    
    txPacket.dstAddr[0] = 0xAA;
    txPacket.dstAddr[1] = 0xBB;
    txPacket.dstAddr[2] = 0xCC;
    txPacket.dstAddr[3] = 0xDD;

    Please note how the bytes are swapped in the address table (in RX) compared to the order they are written in the txPacket.

    BR

    Siri