Skip to content

Move the logic in pin function to parse lines into a parse_response func #2

@XayOn

Description

@XayOn

Basically this:

parse_response(char* at_response){ /* type might not be that, dunno /
char
at_response;
char* parsed_response[20];
int i=0, j=0, k=strlen(at_response);

for(i=0;i<k;i++){
if (at_response[i]=='\x0d') at_response[i]='\x00';
if (at_response[i]=='\x0a'&& at_response[i+1]!='\x00'){
parsed_response[j]=&at_response[i+1];
Serial.println(at_response[i+1]);
j++;
}
if (at_response[i]=='\x0a'&& at_response[i+1]=='\0') at_response[i]='\0';
}
}

To be called like this:

Serial3.println("AT+CPIN?");
while (Serial3.available()==0);
foo = parse_response(serial_read());

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions