cancel
Showing results for 
Search instead for 
Did you mean: 

Send AT Command to GSM Module via UART

APhuc.1
Associate II

0693W00000GY0gTQAT.pngI am having a problem with this line. When i use sprintf to send command but in this command have "", so this line is error. I want to some advice and solution to this.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Double quotes within strings need to be escaped. You need to add a backslash before them.

sprintf(cmd, "AT+QCGDEFCONT=\"IP\",\"v-internert\"\r\n");

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

4 REPLIES 4
voyvoda .
Senior

try to use below.

sprintf(cmd, "AT+QCGDEFCONT=/"IP/",/"v-internert/"\r\");

Thank you very much, i have try this but it seem isn't correct too, this below is error code

0693W00000GY1whQAD.png

TDK
Guru

Double quotes within strings need to be escaped. You need to add a backslash before them.

sprintf(cmd, "AT+QCGDEFCONT=\"IP\",\"v-internert\"\r\n");

If you feel a post has answered your question, please click "Accept as Solution".

Thank you very much. I have understanded.