This pseudocode is for a sink that tries to access the wireless medium in send and receive data from sensors.
- set
pc = 0.01
- send a polling packet
- If no sensor responds to polling packet, set
pc = min (pc + 0.01, 1.0)
- If a data packet is successfully received from one of the sensors, keep
pc
at current value - If there is a collision between two or more sensors as indicated by a corrupted data packet, set
pc = pc / 2
- Repeat step 2
I have read the link by How to read a FSM diagram and it really helped me for the sensor part. But I am still confused about trying to convert the above pseudocode into an FSM.
Can anyone suggest a link or ebook that gives a clear explanation about converting the pseudocode into a FSM?