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

cAT returning ERROR when running embedded. #53

Open
andrewstillie opened this issue Feb 12, 2024 · 2 comments
Open

cAT returning ERROR when running embedded. #53

andrewstillie opened this issue Feb 12, 2024 · 2 comments

Comments

@andrewstillie
Copy link

I have been testing cAT locally using a Linux machine and compiling with GCC and all is working fine.
This is how I have the comms interface set.
static int write_char(char ch)
{
putc(ch, stdout);
return 1;
}

static int read_char(char *ch)
{
*ch = getc(stdin);
return 1;
}

I now want to run the code embedded in a SiLabs Microcontroller via a UART and TeraTerm.
Serial output from the application is working fine. But when I send AT#HELP (or any other command) I get the "ERROR" response.

The main loop is calling handleATProcessing() every iteration.

struct cat_object at; is declared as a global.

int handleATProcessing(void)
{

    while ((cat_service(&at) != 0) && (quit_flag == 0))
    {
        sl_sleeptimer_delay_millisecond(1);
    };


    printf("Bye!\n");

    return 0;

}

My gut feeling is that a command is not being built as characters are received, so command buffer is empty when CR is received.
Can you see where I am going wrong or advise how to debug this?

@andrewstillie
Copy link
Author

I had to add code to my .read as getc was returning 255 when no characters where detected.

@andrewstillie
Copy link
Author

My issue - not cAT

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