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: Does EasyLink_enableRxAddrFilter() filter on the destination address or the source address?

Part Number: CC1310

I'm trying to set up a sort of network 'joining' system based on the rfWSN examples. 

I can't seem to get the filter to work though, and the API doesn't make it immediately clear how the EasyLink_enableRxAddrFilter() function works. I'd assume it filters on the source address and not the destination...

Can someone clarify: Does it filter based on the destination address or the source address?

Also, I've extended the addressing scheme to use 4 bytes instead of one. Mostly it seems fine, but does this have any repercussion on the operation of EasyLink_enableRxAddrFilter()?

Thanks,
Craig

  • Hi Craig,

    The address filter filters based on the destination address that is put in the EasyLink packet. The rfEasyLinkTx and rfEasyLinkRx example have filtering enabled if you want to test the example and the EasyLink.h and .c file are pretty well documented.

    As far as 4byte address, the easylink address filter is expecting a 1 byte address so the parameters in the EasyLink.h and .c file would have to be changed in order to handle a 4 byte address.

    Hope this answers clarifies your question

    Thanks,

    AJS

  • In the concentrator code:
    EasyLink_enableRxAddrFilter(&concentratorAddress, 1, 1);
    The concentrator address is the dstAddr for the node (set as currentRadioOperation.easyLinkTxPacket.dstAddr[0] = RADIO_CONCENTRATOR_ADDRESS; in the node code)

    In the Node code:
    EasyLink_enableRxAddrFilter(&nodeAddress, 1, 1)
    For the node the nodeAddress is the source address placed in the payload.

    To use 4 byte address you need to use EasyLink_setCtrl(). The EasyLink_enableRxAddrFilter() is designed to handle up to 8 byte address.

    Note that node and concentrator may need different address lengths. The concentrator is in the example set to use the address 0x00. Normally you would not need a long address here but the nodes may need a longer address. Note that if you don't change the packet construction the node will send a 4 byte address if the address length is set up to 4 byte.

    This thread (e2e.ti.com/.../524923) contains an example on 2 byte address.
  • Craig,
    It is the receiver that checks the address of the packet and receives only if the address matches any of the entries in the address table.

    For example, suppose there is one central node talking to 3 different nodes. The central node should be able to send packets to each unique node separately and also be able to broadcast packet to all nodes. To achieve this the 3 nodes can have a unique address and also a broadcast address in their respective tables as follows: Node 1 {0x11, 0xbb}; Node 2 {0x22, 0xbb}; Node 3 {0x33, 0xbb}. To broadcast a message the central node sends a packet with address 0xbb. This packet will be received by all nodes. And to send a message to only Node 1, the central node will send a packet with address 0x11. This packet will be received only by node 1 and not by the rest of the nodes.

    Regards,
    Prashanth

  • Hi Craig,

    Additionally, you can use the MAC address that comes with each radio.

    In my product, I am configuring the radio to accept messages to a broadcast address and to its own MAC address.

    void radio_task_init(void)
    {
    	u8 addrFilter[EASYLINK_MAX_ADDR_SIZE * EASYLINK_MAX_ADDR_FILTERS] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Broadcast address
    																	     0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, // Own address
    																	     0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; // Not used
    
    	EasyLink_init(dRADIO_EASYLINK_MODULATION);
    	EasyLink_setFrequency(dRADIO_FREQUENCY);
    	EasyLink_setRfPwr(dRADIO_POWER);
    
    	// It will accept messages to the broadcast address and to its own address
    	EasyLink_setCtrl(EasyLink_Ctrl_AddSize, EASYLINK_MAX_ADDR_SIZE);
    	EasyLink_getIeeeAddr(&addrFilter[8]);
    	EasyLink_enableRxAddrFilter(addrFilter, EASYLINK_MAX_ADDR_SIZE, EASYLINK_MAX_ADDR_FILTERS);
    }

  • Thank you for your responses.

    I'm actually using the MAC address of the devices, but only the last 4 bytes which should be enough variation to guarantee unique addresses for my application.

    I noticed something interested with the EasyLink_enableRxAddrFilter() though, or maybe it's just how uint32_t types are stored in memory...

    I have to reverse the uint32_t where I store my address to match correctly with data sent.

    Setting up the address I do this:

    uint8_t ieeeAddr[8];
        EasyLink_getIeeeAddr(ieeeAddr);
        //      MSB - 0x[4][5][6][7] - LSB
        concentratorAddress = ieeeAddr[4]<<24 | ieeeAddr[5]<<16 | ieeeAddr[6]<<8 | ieeeAddr[7];
        // Flip the address for the filter since it doesn't like pulled from the 32b address memory
        panFilterAddress = ieeeAddr[4] | ieeeAddr[5]<<8 | ieeeAddr[6]<<16 | ieeeAddr[7]<<24;
        if(EasyLink_enableRxAddrFilter((uint8_t*) &panFilterAddress, RADIO_ADDRESS_LENGTH, 1) != EasyLink_Status_Success) {
                        System_abort("Failed to enable RxAddrFilter");
        }

    Sending data from the node I do this:

        /* Set destination address in EasyLink API - by this time it should have obtained the concentrator address*/
        currentRadioOperation.easyLinkTxPacket.dstAddr[0] |= (concentratorAddress & 0xFF000000) >> 24;
        currentRadioOperation.easyLinkTxPacket.dstAddr[1] |= (concentratorAddress & 0xFF0000) >> 16;
        currentRadioOperation.easyLinkTxPacket.dstAddr[2] |= (concentratorAddress & 0xFF00) >> 8;
        currentRadioOperation.easyLinkTxPacket.dstAddr[3] |= (concentratorAddress & 0XFF);

    And in my rxCallback:

                /* Save packet */
                latestRxPacket.header.sourceAddress =   (rxPacket->payload[0] << 24) |
                                                        (rxPacket->payload[1] << 16) |
                                                        (rxPacket->payload[2] << 8) |
                                                         rxPacket->payload[3];

    If I send this data like this the rx packet arrives visibly matching my concentratorAddress uin32_t. However, if I used that same variable to set up my RxAddrFilter, then it doesn't match. I have to use the reversed version. Weird, but it works:

  • Hi

    The header is transmitted as one field in the bit ordering programmed in the radio. If the header has more than 8 bits, it is always read from the transmit buffer in little-endian byte order. If the radio is configured to transmit the MSB first, the last header byte from the TX buffer is transmitted first.

    This is explained in Section 23.7.5.3.2 in rev. G of the TRM (http://www.ti.com/lit/swcu117)

    BR

    Siri