MC13226 Kit - WirelessUART

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC13226 Kit - WirelessUART

Jump to solution
2,243 Views
minhcuong
Contributor II

In "WirelessUart" example, before transmit data between Condinator and  Endevice need binding

But I want to transmit data directly (without binding), How can I do it?

Labels (3)
1 Solution
1,871 Views
AngelC
Senior Contributor I

Hello Cuong,

In order to use direct addressing, you should modify the dstAddrMode from gZbAddrModeIndirect_c to gZbAddrMode16Bit_c (for instance) and specify the destination address (Coordinator is always 0x0000). The other nodes such as the ZR and ZED might get a different network address.

Sending a message to a device whose short address is unknown (like ZR or ZED), you can do several things to achieve it. The easiest one is to use 64 bit addressing.

In order to transmit data to another node using its 64 bit address (known MAC address) you will have to set the dstAddrMode variable to gZbAddrMode64Bit_c and specify the destination 64 bit address by modifying the dstAddr parameter as addrInfo.dstAddr.aIeeeAddr[]. This will let you send messages to a known MAC address in the network.  ZigBee will do the rest for you (search for the corresponding short address and send the message over the air using it). I strongly recommend you to use this solution since you already know the device’s MAC addresses and thus you do not need to add overhead to application.

Anyway, another option is to use the APS_GetNwkAddress() function, which returns a pointer to the Nwk(16 bit) short address given a Known IEEE (64 bit) long address as a parameter. Notice that this function performs a local search. In other words, it only searches for network addresses contained in the device’s address table; it does NOT send anything over the air. This will help you to know the end device’s short address and specify it on the message parameters.

Regards,

AngelC

View solution in original post

1 Reply
1,872 Views
AngelC
Senior Contributor I

Hello Cuong,

In order to use direct addressing, you should modify the dstAddrMode from gZbAddrModeIndirect_c to gZbAddrMode16Bit_c (for instance) and specify the destination address (Coordinator is always 0x0000). The other nodes such as the ZR and ZED might get a different network address.

Sending a message to a device whose short address is unknown (like ZR or ZED), you can do several things to achieve it. The easiest one is to use 64 bit addressing.

In order to transmit data to another node using its 64 bit address (known MAC address) you will have to set the dstAddrMode variable to gZbAddrMode64Bit_c and specify the destination 64 bit address by modifying the dstAddr parameter as addrInfo.dstAddr.aIeeeAddr[]. This will let you send messages to a known MAC address in the network.  ZigBee will do the rest for you (search for the corresponding short address and send the message over the air using it). I strongly recommend you to use this solution since you already know the device’s MAC addresses and thus you do not need to add overhead to application.

Anyway, another option is to use the APS_GetNwkAddress() function, which returns a pointer to the Nwk(16 bit) short address given a Known IEEE (64 bit) long address as a parameter. Notice that this function performs a local search. In other words, it only searches for network addresses contained in the device’s address table; it does NOT send anything over the air. This will help you to know the end device’s short address and specify it on the message parameters.

Regards,

AngelC