my project involves sending data from end device to coordinator which is interfaced thru serial port to computer. now how to send data from end device to coordinator without binding. can any1 plz modify serialapp for the same! thanx!!
the shortaddress of coordinator is always 0x0000,so,you could use the simple api or af api to send datas to 0x0000.
I am a beginner, so can u plz implement it in form of some short program/code . thanx
Hi,
Please refer to the following codes
DstAddr.addrMode = afAddr16Bit; DstAddr.addr.shortAddr = 0x0000; // Coordinator DstAddr.endPoint = FILL_YOUR_ENDPOINT; if ( AF_DataRequest( &DstAddr, &epDesc, CLUSTERID, (byte)DataLengthToSend, (byte *)pDataToSend, &TransID, AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS ) { // Successfully requested to be sent. } else { // Error occurred in request to send. }Hope this helps!
YK Chen
thanx, but what about at the receiving side? what is the code to receive data and send it on to the serial port?
You can receive the message at the XXX_MessageMSGCB of receiver (such as a coordinator) as the followings:
void XXX_MessageMSGCB( afIncomingMSGPacket_t *pkt ){ switch ( pkt->clusterId ) { case CLUSTERID: rcvd_frame=pkt->cmd.Data; rcvd_frame_length=pkt->cmd.DataLength;
...
}
Regards!