Cellular Interface - Handling AT+QFREAD Responses and Binary Data in FreeRTOS Cellular Interface for BG96 Modem

I am using the FreeRTOS Cellular Interface to read files stored in the Flash memory of a Quectel BG96 modem. Specifically, I am trying to use the AT+QFREAD command to read these files. However, I need more detailed information on how to handle the responses and implement this correctly.

When using the AT+QFREAD command, the modem responds with the following format:

AT+QFREAD=1,1024
\r\n
CONNECT 1024
\r\n
(Binary Data)
\r\n
OK
\r\n

How should I handle this response in the FreeRTOS Cellular Interface? Specifically, how should I handle the CONNECT token and the binary data?

@panicjp

Have you tried using the _Cellular_TimeoutAtcmdDataRecvRequestWithCallback API?

You can see the example usage of that API in the implementation of Cellular_SocketRecv API for BG96: FreeRTOS-Cellular-Interface/modules/bg96/cellular_bg96_api.c at e173977bc8548d8720b3adda566a609910cd8bcf · FreeRTOS/FreeRTOS-Cellular-Interface · GitHub

The pktDataPrefixCallback callback function is required to indicate the data start address and data length, along with returning CELLULAR_PKT_STATUS_SIZE_MISMATCH until required raw data bytes are received.

You can refer a similar thread here for more data.

@tony-josi-aws

I was able to handle it well.
Thank you for your support

@panicjp

Thank you for reporting back.