Hi all,
I`m trying to get the short address of my end device and send a message to my coordinator device, but when y want to show the address in LCD, it shows a rare symbols. My code to do that is:
EDAddress = NLME_GetShortAddr();
char variable[] = (char)EDAddress;
if ( AF_DataRequest( &Widget_DstAddr, &Widget_epDesc, Widget_CLUSTERID, (byte)osal_strlen( variable ) + 1, (byte *)&variable, &Widget_TransID, AF_ACK_REQUEST, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS ) { // Successfully requested to be sent. } else { // Error occurred in request to send. }
I`m working GenericApplicaton (in my case WidgetApp) on SmartRF 05 EB 1.8.1 and cc2530
¿how can I do to receive and show the short Address of my ED?
First, simplify to thisand tell us what you get:
uint16 EDAddress = NLME_GetShortAddr();
if (AF_DataRequest(&Widget_DstAddr, &Widget_epDesc, Widget_CLUSTERID, 2, (uint8 *)&EDAddress, &Widget_TransID, AF_ACK_REQUEST, AF_DEFAULT_RADIUS) == afStatus_SUCCESS){
Hi Harry, I changed the code, the LCD still showing a dfferent information:
End Device Address : 298D
LCD Show: b ) ! rcvd
The part of rcvd means received, is a part of my message, the " b ) ! " should be the Short Address.
If your code to write to the LCD is something like this:
HalLcdWriteStringValue("ZED Addr", pkt->srcAddr.addr.shortAddr, 16, HAL_LCD_LINE_1);
Then I don't know.
I was using HalLcdWriteValue, but when I use HalLcdWriteStringValue it works.
Thanks Harry