Application principle HELP!

Hello guys,

I want to implement an application like this :

                           [img]http://capitanui.ilive.ro/app.jpg[/img]

My question is…How can i handle to split this application ( to comute in program) into RUN MODE and CONFIG MODE… I’m thinking at ADL Semaphore. Can someone more experienced help me? … In the run mode will run the application that will use services like gprs, tcp/ip, sms, fcm, etc…with parameters wich will be set with AT commands in the config mode…but somehow this two modes needs to be independent…When i enter in config mode with a command at+config the the services will stop and restart after i exit from the config mode with at+exit…

Can you guide me? …wich api i can use for this?

Thanks in advance!!

“Stopping” the services is generally a matter of unsubscribing;

If you switched FCM to data mode, you would need to switch back to AT;

For WIP, you’d need to close the Channel(s), and the bearer, etc;

etc…

I undestand…i know that i need to do that…but what i was thinking is to build this application like 2 separate subrountines…something like that…if you are in the cfg mode…you only can enter at commands for this mode…after ending the config to switch in run mode…and resubscribe to all services with new values from configuration…and i don’t know for now exactly how to implement this in C … but i think i can do exactly what you are saying…
My appl. is running …with …gprs bearer started…fcm in data mode…sms subscribed and all that…and when i enter AT+CFG …the cmd handler for this command will move the fcm in at mode…unsubscribe from other services…and subscribe for commands used in this configuration mode.

Thanks for your answer awneil…if someone have another ideas on how i can implement this …please do not hesitate!

https://forum.sierrawireless.com/t/good-paper-on-event-driven-programming/3848/1

This type of programming lends itself to a State Machine (or Finite State Machine, FSM) implementation…

Note that Windows programming is also event-driven - so you might look there for inspiration…

Thanks awneil…it seems a good resource…i will read it and see what i’ll find useful for my application…