From bef25cd97de240119d34bfc4fe2bd8cb6c19db24 Mon Sep 17 00:00:00 2001 From: Marcin Niestroj Date: Thu, 10 Dec 2020 18:07:20 +0100 Subject: [PATCH] drivers: wifi: esp: support 32-bit length in +IPD +IPD,, command in passive mode notifies about ESP internal buffer usage level. Hence value of can exceed 4 digit value, which currently results in failure. +IPD message is used in driver only for scheduling AT+CIPRECVDATA command and actual value of doesn't really matter. Increase maximum supported value that can be received from 9999 (maximum 4 digits) to 4294967295, which is maximum value of 32-bit unsigned integer. Signed-off-by: Marcin Niestroj --- drivers/wifi/esp/esp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/wifi/esp/esp.c b/drivers/wifi/esp/esp.c index ca89ecbe12e..caa689b77c2 100644 --- a/drivers/wifi/esp/esp.c +++ b/drivers/wifi/esp/esp.c @@ -441,8 +441,8 @@ struct net_pkt *esp_prepare_pkt(struct esp_data *dev, struct net_buf *src, * Passive mode: "+IPD,,\r\n" * Other: "+IPD,,:" */ -#define MIN_IPD_LEN (sizeof("+IPD,I,LE") - 1) -#define MAX_IPD_LEN (sizeof("+IPD,I,LLLLE") - 1) +#define MIN_IPD_LEN (sizeof("+IPD,I,0E") - 1) +#define MAX_IPD_LEN (sizeof("+IPD,I,4294967295E") - 1) MODEM_CMD_DIRECT_DEFINE(on_cmd_ipd) { char *endptr, end, ipd_buf[MAX_IPD_LEN + 1];