Skip to content

Commit 069d439

Browse files
ccli8kartben
authored andcommitted
drivers: wifi: esp_at: handle IP unquoted parsing with ESP-AT version <2.0
This fixes parsing error on AT+CIPDINFO with ESP-AT version discrepancy. Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
1 parent d74cf04 commit 069d439

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/wifi/esp_at/esp.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,13 @@ static int cmd_ipd_parse_hdr(struct esp_data *dev,
825825
char *remote_ip;
826826
long port;
827827

828-
err = esp_pull_quoted(&str, str_end, &remote_ip);
828+
if (IS_ENABLED(CONFIG_WIFI_ESP_AT_VERSION_1_7)) {
829+
/* NOT quoted per AT version 1.7.0 */
830+
err = esp_pull_raw(&str, str_end, &remote_ip);
831+
} else {
832+
/* Quoted per AT version 2.1.0/2.2.0 */
833+
err = esp_pull_quoted(&str, str_end, &remote_ip);
834+
}
829835
if (err) {
830836
if (err == -EAGAIN && match_len >= MAX_IPD_LEN) {
831837
LOG_ERR("Failed to pull remote_ip");

0 commit comments

Comments
 (0)