• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

nrGSM custom AT cmds in OnAfterInit event doesn't works.

Started by ronfak, April 26, 2015, 04:37:53 am

Previous topic - Next topic

ronfak

I supposed that OnAfterInit was fired after everything else, and I supposed that it was the right place to start sending our own AT commands.

Whenever I send an AT command inside this OnAfterInit, the command will just wait until the timeout and return OK.
Even nrGsm1.PINGetStatus inside this event will return a false answer (always 'unknown' when it should be 'ready').

However, If I place everything inside a new procedure and I lunch it when I press a button after the afterInit is done, everything works perfectly. It doesn't wait for the timeout and the answers are correct.

Even adding a sleep or other things in the AfterInit is not helping. It's like the input buffer is not empty when this event triggers.

The only ugly way I found to make an automatic process (and not the need to manually press a button) is to start a timer inside the onAfterInit, so it will trigger my next procedure few seconds after the onAfterInit is complete.

Is their any better way to implement an automatic process with custom AT commands (I need to read the answers) after the initialisation ?

FYI: I am using Delphi XE7.

Thank you,
Ron

Roman Novgorodov

Hello

Please post here a sample code.
I do not understand what methods do you call for send AT commands.

Roman Novgorodov
DeepSoftware llc
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.