Dear all,
I am new to simpliciti and I don't know how to exactly let a node address another node when send messages (I am arranging a multihop topology where each node knows about the node that stays after and the node that stays before in the hop-chain).
In all examples I found, nodes use Link() and LinkListen() to create a new link in a sort of producer-consumer fashion. In my case all nodes should then use both primitives. If one node calls Link() to to link to the node on the right, how can I be sure that the link will not be accept by some other node around (there are lots of nodes that may do it cause nodes are spread over a bidimensional surface).
Is there any way to exactly address a node when you invoke Link()? Or can one send a message without requiring to link? Be aware that each node knows other nodes' MAC addresses (they are among the configuration).
Thanks for your help
Fabio
If you know the Addresses of the nodes, I read in the documentation that there is a function that you can use to establish "hard coded" links.
SMPL_Commission()8.4.1 DescriptionThis API is used to statically create a connection table entry. It requires detailed knowledge of the objects in theconnection table. If both peers are (correctly) populated using this API a connection can be established without anexplicit over-air linking transaction
I have never used it, but soon I will. hope this helps.
Regards,
Mario Medina
Hi Fabio,
SimpliciTI basically works with peer-to-peer logical communication, so that means once the communication is established, you do not really care about the remote address anymore.
Please refer to the SimpliciTI FAQ page especially the section explaining the basic communication:
http://processors.wiki.ti.com/index.php/SimpliciTI_FAQ
Leo Hendrawan
Hi Mario,
i have tested the SMPL_Commission() before, and basically by using this function, you can skip the link establishment which normally uses SMPL_Link() and SMPL_LinkListen(), by basically giving the following information of the link connection:
- remote address
- local port
- remote port
Here is the code that i made which is similar with the Simple Peer To Peer example code:
0216.main_LinkTo_Static.c
2728.main_LinkListen_Static.c
Hope this helps.
Hi Mario and lhend,
thanks for your replies. At them moment I switched to a different problem but will switch back to this one in the future. At first glance, the API and code examples you gave seem to be exact what I need.
Thanks a lot
Leo,
I am new to simpliciTI. In my application I have 10 ED's (Light Switch) and AP (Remote).
I need star topology i.e.
(1) ED1 to AP (peer to peer)
(2) ED2 to AP (peer to peer)
....
(10) ED10 to AP (peer to peer)
I don't want communication between ED's and hence I think Join and Link from ED will control this.
I am using CC430F5137 EVAK kit and currently testing with ED1 and AP.
Step @ ED1
(1) BSP_INIT();
(2) SMPL_INTI(sCB); i.e. Join with call back for peerframe (bidirectional comms with AP)
(3) SMPL_SMPL_Link(&sLinkID1); at this step sLinkID1=0x01 if AP is on.
(4) Communicate with AP @every two second with SMPL_SendOpt(sLinkID1, msg, sizeof(msg), SMPL_TXOPTION_ACKREQ))
(5) if ACK is ok repeate step#4 i.e. keep on communicating with AP@every two seconds.
(6) if ACL is not ok for three times in ROW, use SMPL_Unlink(sLinkID1)
(7) go to setp#2 to Rejoin and Link again...
what I obsreved here is sLinkID1 goes from 1-254 to back to 1, every time unlink and rejoinlink occurs.
My question: (a) who assign sLinkID1's value, is that ED1 or AP?
(b) If ED1 is doing it, how AP comes to know about it.
(8) Once I press button on AP, AP is sending msg to ED1 on sLID[0]
(9) Due to sCB used in SMPL_INIT on ED1 frame received. Receive linkID of frame is same as sLinkID1
My questions:
(a) In debug I am always gest sLID[0]=0x01 in AP, while on ED1 it is as per current value of sLinkID1 which is not 0x01 every time if SMPL_Unlink(sLinkID1) is used on ED1.
(b) How does mapping from sLID[0] to sLinkID1 gets done?
(c) If I have 10 ED's each one will be having different value for sLinkID1 once join and linking is over, right?
(d) In case of Unlik and Rejoinlink, how AP can address specific ED's?
(e) if AP want to send ON/OFF to specific ED's how it can comes to adress specific ED's?
i.e. How to link sLID[X] array with specific ED's address. Here X=10 as I have 10 ED's on network.
I can't use SMPL_Commission() as it is not flexible in my application.
khodidas
Great information lhend! thanks for the code!! definitely this is going to help me in some projects i'm currently involved.
One question over where. I see that you define a Static Port. I understand that for a connection between two peers it is required by the network layer.
ED1 <-------> ED2
The question is... if I establish another connection to another End device (like this:)
ED1 <---------->ED2
ED1 <---------->ED3
Do I have to specify a different port number for that new connection (between ED1 and ED3)?
Thanks!