Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AT_Slave example only accept first AT command #45

Open
peterj43 opened this issue Apr 13, 2023 · 0 comments
Open

AT_Slave example only accept first AT command #45

peterj43 opened this issue Apr 13, 2023 · 0 comments

Comments

@peterj43
Copy link

When using the AT_slave example I found that I would only get a response to the first AT command I sent. I am working with version 1.2.3 but don't think the issue is only in this version.
I have debugged the issue and believe the issue is in command.c CMD_Process(void)

void CMD_Process(void)
{
  static char command[CMD_SIZE];
  static unsigned i = 0;                                 // This should not be declared as "static" 

  /* Process all commands */
  while (IsNewCharReceived() == SET)
  {
    command[i] = GetNewChar();

#if 0 /* echo On    */
    PRINTF("%c", command[i]);
#endif

    if (command[i] == AT_ERROR_RX_CHAR)
    {
      i = 0;
      com_error(AT_RX_ERROR);
      break;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant