Send AT Command to GSM Module via UART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-18 2:33 AM
I 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
Solved! Go to Solution.
- Labels:
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-18 5:22 AM
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");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-18 3:30 AM
try to use below.
sprintf(cmd, "AT+QCGDEFCONT=/"IP/",/"v-internert/"\r\");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-18 4:35 AM
Thank you very much, i have try this but it seem isn't correct too, this below is error code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-18 5:22 AM
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");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-18 6:46 AM
Thank you very much. I have understanded.
