08-21-2017 04:50 AM
Look into using a State Machine. This way, you can have states like "Connect", "Run", "Disconnect", "Check Error", and "Shutdown". So if you try to connect and get an error, it is simple to retry by just calling the Connect state again. When you get an error from pulling to USB cable, you can go through the Disconnect and Connect states.
08-21-2017 04:59 AM
Thank you for your reply
Can you please tell me with an example. I can check it through that.I am not able to understand it in state machine.
With regards
Sudhin sudh