ARMmbed / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
4.63k stars 2.96k forks source link

[ATHandler] Mbed Os 5.12.4 ATHandler::resp_stop #10854

Closed huarunlin closed 4 years ago

huarunlin commented 5 years ago

Description

my program works fine in Mbed Os 5.12.2 version, updated to version 5.12.4 is abnormal, and finally found ATHandler :: resp_stop returns a failure, I alone put ATHandler :: resp_stop fall back Mbed Os 5.12.2 version, the program It works fine.

Issue request type

[ ] Question
[ ] Enhancement
[*] Bug
ciarmcom commented 5 years ago

Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-1297

AriParkkila commented 4 years ago

@huarunlin I don't find any difference in git diff mbed-os-5.12.2..mbed-os-5.12.4 -- features/cellular/framework/AT/ATHandler.cpp.

Can you share the changes you made in ATHandler :: resp_stop and/or AT debug logs?

huarunlin commented 4 years ago

@AriParkkila , I found the problem, I am using the QUECTEL M26 module. QUECTEL_M26_CellularStack.cpp: socket_sendto_impl in on "AT + QISEND =" return directive judgment in question, there is no right to call ATHandler :: resp_start, modified to the following code to run properly.

_at.cmd_start("AT+QISEND=");
_at.write_int(socket->id);
_at.write_int(sent_len);
_at.cmd_stop();

_at.resp_start(">");
_at.write_bytes((uint8_t *)data, sent_len);
//_at.resp_start();
_at.resp_start("SEND ", true);
_at.resp_stop();
AriParkkila commented 4 years ago

@huarunlin Since it works in mbed-os-5.12.2 and AT driver has not changed to mbed-os-5.12.4, it's difficult to see what could have caused this. Can you share your AT spec and firmware version.

kivaisan commented 4 years ago

@huarunlin I think driver needs to set proper stop tag as send command stops either to SEND OK, SEND FAIL or ERROR response. Could you test to add CRLF stop tag to response:

_at.resp_start(">");
_at.write_bytes((uint8_t *)data, sent_len);
_at.resp_start();
_at.set_stop_tag("\r\n");
_at.resp_stop();