Closed FrancMunoz closed 6 years ago
@FrancMunoz thank you for proposing this. At this time I would prefer to leave this out.
Hi @sandeepmistry!
I see it could be complicated and could generate some problems but improves control on final coding. I would use ModemClass::addUrcHandler
because I would like to use your future improvements.
Thank you!
Hi!
I'd like to make a suggestion. I've been working in a large project and need to know for example when a SMS is received instantly without have to pooling if sms is available (that is very slow). So I've created a callback in
ModemClass
to receive all URCs in my code and parse if necessary.So in
Modem.h
added:void (*urcCallback)(const String& urc);
and in
Modem.cpp
added the call after urcHandlers:So in code could receive SMS notifications. The only issue is the use of flags during the callback to be executed at main loop, because if an operation is done in the callback all seems to fail due the design of the modem code (that I think is nice).
So:
This will give more power and control to final coding.
What do you think?
Thank you!