Open WilliamAtSamraksh opened 8 years ago
Putting in a 30 second delay after instantiating OMAC and before sending seems to work. In the program, Send only occurs when the neighbor list shows a neighbor, but apparently that is before OMAC stabilizes and there's some interference.
If OMAC has to stabilize before sending then an attempt to send before that happens should throw an exception; and the user should be provided with a semaphore (ManualResetEvent in C#) such as MACReady that can be used to wait until OMAC is ready.
For consistency, MACReady should be in IMAC so that CSMA will have it as well (although in this case the stabilization time is zero). In any case, the user would be encouraged to use a wait on MACReady.as a part of normal programming.
Software ID: 571e77b411a5a7aaa02f47e0b173e11c01ca1fc5, eMote v. 16 A (or whatever our incremental numbering system is) ... To reproduce, use System > Virtual Fence > Base Node & Fence Node from the attachment.
2016.05.31 Managed Virtual Fence.zip
In the two logs below, the Base Node receives messages # 1, 2, 4 & 7 while the Fence Node sends # 1-17, so messages 3, 5-6 and 8-17 are lost. Note in the Fence Node log that between messages # 8 and 9, the Base Node is dropped from the neighbor list. The rate at which messages are sent is about one per 20 seconds.
Base Node Log
Fence Node Log