Skip to content

Commit a36c264

Browse files
[EGD-4120] Cellular - new line at the end of the command (#877)
1 parent 8a463aa commit a36c264

File tree

10 files changed

+109
-96
lines changed

10 files changed

+109
-96
lines changed

module-cellular/Modem/ATCommon.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Result::Code Chanel::at_check(const std::vector<std::string> &arr)
3636

3737
void Chanel::cmd_log(std::string cmd, const Result &result, uint32_t timeout)
3838
{
39-
4039
cmd.erase(std::remove(cmd.begin(), cmd.end(), '\r'), cmd.end());
4140
cmd.erase(std::remove(cmd.begin(), cmd.end(), '\n'), cmd.end());
4241
switch (result.code) {
@@ -61,13 +60,23 @@ void Chanel::cmd_log(std::string cmd, const Result &result, uint32_t timeout)
6160
#endif
6261
}
6362

63+
std::string Chanel::formatCommand(const std::string &cmd) const
64+
{
65+
bool isTerminatorValid = std::find(validTerm.begin(), validTerm.end(), cmd.back()) != validTerm.end();
66+
if (isTerminatorValid) {
67+
return cmd;
68+
}
69+
return cmd + cmdSeparator;
70+
}
71+
6472
class Result Chanel::cmd(const std::string cmd, uint32_t timeout, size_t rxCount)
6573
{
6674
Result result;
6775
blockedTaskHandle = xTaskGetCurrentTaskHandle();
6876

6977
cmd_init();
70-
cmd_send(cmd);
78+
std::string cmdFixed = formatCommand(cmd);
79+
cmd_send(cmdFixed);
7180

7281
uint32_t currentTime = cpp_freertos::Ticks::GetTicks();
7382
uint32_t timeoutNeeded = ((timeout == UINT32_MAX) ? UINT32_MAX : currentTime + timeout);
@@ -99,7 +108,7 @@ class Result Chanel::cmd(const std::string cmd, uint32_t timeout, size_t rxCount
99108

100109
blockedTaskHandle = nullptr;
101110
cmd_post();
102-
cmd_log(cmd, result, timeout);
111+
cmd_log(cmdFixed, result, timeout);
103112

104113
return result;
105114
}

module-cellular/Modem/ATCommon.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ namespace at
1717
class Chanel
1818
{
1919
protected:
20+
constexpr static char cmdSeparator = '\r';
21+
const std::array<char, 3> validTerm = {cmdSeparator, ',', '='};
22+
std::string formatCommand(const std::string &cmd) const;
23+
2024
cpp_freertos::MutexStandard mutex;
2125
TaskHandle_t blockedTaskHandle = nullptr;
2226

module-cellular/Modem/TS0710/DLC_channel.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ std::vector<std::string> DLC_channel::SendCommandPrompt(const char *cmd, size_t
140140

141141
blockedTaskHandle = xTaskGetCurrentTaskHandle();
142142
at::Result result;
143+
143144
cmd_init();
144-
cmd_send(cmd);
145+
std::string cmdFixed = formatCommand(cmd);
146+
cmd_send(cmdFixed);
145147

146148
uint32_t currentTime = cpp_freertos::Ticks::GetTicks();
147149
uint32_t timeoutNeeded = timeout == UINT32_MAX ? UINT32_MAX : currentTime + timeout;
@@ -179,7 +181,7 @@ std::vector<std::string> DLC_channel::SendCommandPrompt(const char *cmd, size_t
179181
}
180182
}
181183

182-
cmd_log(cmd, result, timeout);
184+
cmd_log(cmdFixed, result, timeout);
183185
cmd_post();
184186
blockedTaskHandle = nullptr;
185187

module-cellular/at/Commands.hpp

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -126,67 +126,67 @@ namespace at
126126
inline auto factory(AT at) -> const Cmd &
127127
{
128128
static const std::map<AT, const Cmd> fact{
129-
{AT::AT, {"AT\r", 100}},
130-
{AT::ECHO_OFF, {"ATE0\r"}},
131-
{AT::FACTORY_RESET, {"AT&F\r"}},
129+
{AT::AT, {"AT", 100}},
130+
{AT::ECHO_OFF, {"ATE0"}},
131+
{AT::FACTORY_RESET, {"AT&F"}},
132132
{AT::SW_INFO, {"ATI\r", default_doc_timeout}},
133133
{AT::FLOW_CTRL_ON, {"AT+IFC=2,2\r\n", 500}},
134-
{AT::FLOW_CTRL_OFF, {"AT+IFC=0,0\r", 500}},
135-
{AT::URC_NOTIF_CHANNEL, {"AT+QCFG=\"cmux/urcport\",1\r"}},
136-
{AT::RI_PIN_AUTO_CALL, {"AT+QCFG=\"urc/ri/ring\",\"auto\"\r"}},
137-
{AT::RI_PIN_OFF_CALL, {"AT+QCFG=\"urc/ri/ring\",\"off\"\r"}},
138-
{AT::RI_PIN_PULSE_SMS, {"AT+QCFG=\"urc/ri/smsincoming\",\"pulse\",200\r"}},
139-
{AT::RI_PIN_OFF_SMS, {"AT+QCFG=\"urc/ri/smsincoming\",\"off\"\r"}},
140-
{AT::RI_PIN_OFF_OTHER, {"AT+QCFG=\"urc/ri/other\",\"off\"\r"}},
141-
{AT::URC_DELAY_ON, {"AT+QCFG=\"urc/delay\",1\r"}},
142-
{AT::URC_UART1, {"AT+QURCCFG=\"urcport\",\"uart1\"\r"}},
143-
{AT::AT_PIN_READY_LOGIC, {"AT+QCFG=\"apready\",1,1,200\r"}},
144-
{AT::URC_NOTIF_SIGNAL, {"AT+QINDCFG=\"csq\",1\r"}},
145-
{AT::CRC_ON, {"AT+CRC=1\r"}},
146-
{AT::CALLER_NUMBER_PRESENTATION, {"AT+CLIP=1\r", 18000}},
147-
{AT::SMS_TEXT_FORMAT, {"AT+CMGF=1\r"}},
148-
{AT::SMS_UCSC2, {"AT+CSCS=\"UCS2\"\r"}},
149-
{AT::SMS_GSM, {"AT+CSCS=\"GSM\"\r"}},
150-
{AT::QSCLK_ON, {"AT+QSCLK=1\r", 3000}},
151-
{AT::QDAI, {"AT+QDAI?\r"}},
152-
{AT::QDAI_INIT, {"AT+QDAI=1,0,0,5,0,1\r"}},
153-
{AT::SET_URC_CHANNEL, {"AT+QCFG=\"cmux/urcport\",2\r", default_doc_timeout}},
154-
{AT::CSQ, {"AT+CSQ\r", default_doc_timeout}},
155-
{AT::CLCC, {"AT+CLCC\r", default_doc_timeout}},
134+
{AT::FLOW_CTRL_OFF, {"AT+IFC=0,0", 500}},
135+
{AT::URC_NOTIF_CHANNEL, {"AT+QCFG=\"cmux/urcport\",1"}},
136+
{AT::RI_PIN_AUTO_CALL, {"AT+QCFG=\"urc/ri/ring\",\"auto\""}},
137+
{AT::RI_PIN_OFF_CALL, {"AT+QCFG=\"urc/ri/ring\",\"off\""}},
138+
{AT::RI_PIN_PULSE_SMS, {"AT+QCFG=\"urc/ri/smsincoming\",\"pulse\",200"}},
139+
{AT::RI_PIN_OFF_SMS, {"AT+QCFG=\"urc/ri/smsincoming\",\"off\""}},
140+
{AT::RI_PIN_OFF_OTHER, {"AT+QCFG=\"urc/ri/other\",\"off\""}},
141+
{AT::URC_DELAY_ON, {"AT+QCFG=\"urc/delay\",1"}},
142+
{AT::URC_UART1, {"AT+QURCCFG=\"urcport\",\"uart1\""}},
143+
{AT::AT_PIN_READY_LOGIC, {"AT+QCFG=\"apready\",1,1,200"}},
144+
{AT::URC_NOTIF_SIGNAL, {"AT+QINDCFG=\"csq\",1"}},
145+
{AT::CRC_ON, {"AT+CRC=1"}},
146+
{AT::CALLER_NUMBER_PRESENTATION, {"AT+CLIP=1", 18000}},
147+
{AT::SMS_TEXT_FORMAT, {"AT+CMGF=1"}},
148+
{AT::SMS_UCSC2, {"AT+CSCS=\"UCS2\""}},
149+
{AT::SMS_GSM, {"AT+CSCS=\"GSM\""}},
150+
{AT::QSCLK_ON, {"AT+QSCLK=1", 3000}},
151+
{AT::QDAI, {"AT+QDAI?"}},
152+
{AT::QDAI_INIT, {"AT+QDAI=1,0,0,5,0,1"}},
153+
{AT::SET_URC_CHANNEL, {"AT+QCFG=\"cmux/urcport\",2", default_doc_timeout}},
154+
{AT::CSQ, {"AT+CSQ", default_doc_timeout}},
155+
{AT::CLCC, {"AT+CLCC", default_doc_timeout}},
156156
{AT::CMGD, {"AT+CMGD=", default_doc_timeout}},
157-
{AT::CNUM, {"AT+CNUM\r"}},
158-
{AT::CIMI, {"AT+CIMI\r"}},
157+
{AT::CNUM, {"AT+CNUM"}},
158+
{AT::CIMI, {"AT+CIMI"}},
159159
{AT::QCMGR, {"AT+QCMGR=", 2000}},
160-
{AT::ATH, {"ATH\r"}},
161-
{AT::ATA, {"ATA\r", 90000}},
160+
{AT::ATH, {"ATH"}},
161+
{AT::ATA, {"ATA", 90000}},
162162
{AT::ATD, {"ATD"}},
163163
{AT::IPR, {"AT+IPR="}},
164164
{AT::CMUX, {"AT+CMUX="}},
165165
{AT::CMGS, {"AT+CMGS=\""}},
166166
{AT::QCMGS, {"AT+QCMGS=\""}},
167-
{AT::CREG, {"AT+CREG?\r", default_doc_timeout}},
168-
{AT::QNWINFO, {"AT+QNWINFO\r"}},
169-
{AT::COPS, {"AT+COPS=?\r", 180000}},
170-
{AT::QSIMSTAT, {"AT+QSIMSTAT?\r"}},
171-
{AT::SIM_DET, {"AT+QSIMDET?\r"}},
172-
{AT::SIM_DET_ON, {"AT+QSIMDET=1,0\r"}},
173-
{AT::SIMSTAT_ON, {"AT+QSIMSTAT=1\r"}},
167+
{AT::CREG, {"AT+CREG?", default_doc_timeout}},
168+
{AT::QNWINFO, {"AT+QNWINFO"}},
169+
{AT::COPS, {"AT+COPS=?", 180000}},
170+
{AT::QSIMSTAT, {"AT+QSIMSTAT?"}},
171+
{AT::SIM_DET, {"AT+QSIMDET?"}},
172+
{AT::SIM_DET_ON, {"AT+QSIMDET=1,0"}},
173+
{AT::SIMSTAT_ON, {"AT+QSIMSTAT=1"}},
174174
{AT::SET_SCANMODE, {"AT+QCFG=\"nwscanmode\","}},
175-
{AT::GET_SCANMODE, {"AT+QCFG=\"nwscanmode\"\r"}},
176-
{AT::QGMR, {"AT+QGMR\r"}},
177-
{AT::STORE_SETTINGS_ATW, {"AT&W\r"}},
178-
{AT::CEER, {"AT+CEER\r"}},
179-
{AT::QIGETERROR, {"AT+QIGETERROR\r"}},
175+
{AT::GET_SCANMODE, {"AT+QCFG=\"nwscanmode\""}},
176+
{AT::QGMR, {"AT+QGMR"}},
177+
{AT::STORE_SETTINGS_ATW, {"AT&W"}},
178+
{AT::CEER, {"AT+CEER"}},
179+
{AT::QIGETERROR, {"AT+QIGETERROR"}},
180180
{AT::VTS, {"AT+VTS="}},
181181
{AT::QLDTMF, {"AT+QLDTMF=1,"}},
182-
{AT::CUSD_OPEN_SESSION, {"AT+CUSD=1\r"}},
183-
{AT::CUSD_CLOSE_SESSION, {"AT+CUSD=2\r"}},
182+
{AT::CUSD_OPEN_SESSION, {"AT+CUSD=1"}},
183+
{AT::CUSD_CLOSE_SESSION, {"AT+CUSD=2"}},
184184
{AT::CUSD_SEND, {"AT+CUSD=1,"}},
185-
{AT::SET_SMS_STORAGE, {"AT+CPMS=\"SM\",\"SM\",\"SM\"\r", 300}},
186-
{AT::ENABLE_TIME_ZONE_UPDATE, {"AT+CTZU=3\r"}},
187-
{AT::SET_TIME_ZONE_REPORTING, {"AT+CTZR=2\r"}},
188-
{AT::DISABLE_TIME_ZONE_UPDATE, {"AT+CTZU=0\r"}},
189-
{AT::DISABLE_TIME_ZONE_REPORTING, {"AT+CTZR=0\r"}},
185+
{AT::SET_SMS_STORAGE, {"AT+CPMS=\"SM\",\"SM\",\"SM\"", 300}},
186+
{AT::ENABLE_TIME_ZONE_UPDATE, {"AT+CTZU=3"}},
187+
{AT::SET_TIME_ZONE_REPORTING, {"AT+CTZR=2"}},
188+
{AT::DISABLE_TIME_ZONE_UPDATE, {"AT+CTZU=0"}},
189+
{AT::DISABLE_TIME_ZONE_REPORTING, {"AT+CTZR=0"}},
190190
};
191191
if (fact.count(at)) {
192192
return fact.at(at);

module-services/service-cellular/ServiceCellular.cpp

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,7 @@ bool ServiceCellular::handle_audio_conf_procedure()
419419
{
420420
auto audioRet = cmux->AudioConfProcedure();
421421
if (audioRet == TS0710::ConfState::Success) {
422-
auto cmd =
423-
at::factory(at::AT::IPR) + std::to_string(ATPortSpeeds_text[cmux->getStartParams().PortSpeed]) + "\r";
422+
auto cmd = at::factory(at::AT::IPR) + std::to_string(ATPortSpeeds_text[cmux->getStartParams().PortSpeed]);
424423
LOG_DEBUG("Setting baudrate %i baud", ATPortSpeeds_text[cmux->getStartParams().PortSpeed]);
425424
if (!cmux->getParser()->cmd(cmd)) {
426425
LOG_ERROR("Baudrate setup error");
@@ -657,7 +656,7 @@ sys::Message_t ServiceCellular::DataReceivedHandler(sys::DataMessage *msgl, sys:
657656
assert(msg != nullptr);
658657
auto channel = cmux->get(TS0710::Channel::Commands);
659658
if (channel) {
660-
auto ret = channel->cmd(at::factory(at::AT::ATD) + msg->number.getEntered() + ";\r");
659+
auto ret = channel->cmd(at::factory(at::AT::ATD) + msg->number.getEntered() + ";");
661660
if (ret) {
662661
responseMsg = std::make_shared<CellularResponseMessage>(true);
663662
// activate call state timer
@@ -1060,12 +1059,11 @@ bool ServiceCellular::sendSMS(SMSRecord record)
10601059
// if text fit in single message send
10611060
if (textLen < singleMessageLen) {
10621061

1063-
if (cmux->CheckATCommandPrompt(
1064-
channel->SendCommandPrompt((std::string(at::factory(at::AT::CMGS)) +
1065-
UCS2(UTF8(record.number.getEntered())).modemStr() + "\"\r")
1066-
.c_str(),
1067-
1,
1068-
commandTimeout))) {
1062+
if (cmux->CheckATCommandPrompt(channel->SendCommandPrompt(
1063+
(std::string(at::factory(at::AT::CMGS)) + UCS2(UTF8(record.number.getEntered())).modemStr() + "\"")
1064+
.c_str(),
1065+
1,
1066+
commandTimeout))) {
10691067

10701068
if (channel->cmd((UCS2(record.body).modemStr() + "\032").c_str())) {
10711069
result = true;
@@ -1099,7 +1097,7 @@ bool ServiceCellular::sendSMS(SMSRecord record)
10991097
UTF8 messagePart = record.body.substr(i * singleMessageLen, partLength);
11001098

11011099
std::string command(at::factory(at::AT::QCMGS) + UCS2(UTF8(record.number.getEntered())).modemStr() +
1102-
"\",120," + std::to_string(i + 1) + "," + std::to_string(messagePartsCount) + "\r");
1100+
"\",120," + std::to_string(i + 1) + "," + std::to_string(messagePartsCount));
11031101

11041102
if (cmux->CheckATCommandPrompt(channel->SendCommandPrompt(command.c_str(), 1, commandTimeout))) {
11051103
// prompt sign received, send data ended by "Ctrl+Z"
@@ -1142,7 +1140,7 @@ bool ServiceCellular::receiveSMS(std::string messageNumber)
11421140
channel->cmd(at::AT::SMS_UCSC2);
11431141

11441142
auto cmd = at::factory(at::AT::QCMGR);
1145-
auto ret = channel->cmd(cmd + messageNumber + "\r", cmd.timeout);
1143+
auto ret = channel->cmd(cmd + messageNumber, cmd.timeout);
11461144

11471145
bool messageParsed = false;
11481146

@@ -1339,7 +1337,7 @@ std::vector<std::string> ServiceCellular::scanOperators(void)
13391337
auto channel = cmux->get(TS0710::Channel::Commands);
13401338
std::vector<std::string> result;
13411339
if (channel) {
1342-
auto resp = channel->cmd("AT+COPS=?\r", 180000, 2);
1340+
auto resp = channel->cmd("AT+COPS=?", 180000, 2);
13431341
if (resp.code == at::Result::Code::OK) {
13441342
std::string rawResponse = resp.response[0];
13451343
std::string toErase("+COPS: ");
@@ -1497,7 +1495,7 @@ bool ServiceCellular::handle_select_sim()
14971495
sys::Bus::SendUnicast(std::make_shared<sevm::SIMMessage>(), service::name::evt_manager, this);
14981496
bool ready = false;
14991497
while (!ready) {
1500-
auto response = channel->cmd("AT+CPIN?\r");
1498+
auto response = channel->cmd("AT+CPIN?");
15011499
for (auto &line : response.response) {
15021500
if (line.find("+CPIN: READY") == std::string::npos) {
15031501
ready = true;
@@ -1513,7 +1511,7 @@ bool ServiceCellular::handle_select_sim()
15131511
bool ServiceCellular::handle_modem_on()
15141512
{
15151513
auto channel = cmux->get(TS0710::Channel::Commands);
1516-
channel->cmd("AT+CCLK?\r");
1514+
channel->cmd("AT+CCLK?");
15171515
// inform host ap ready
15181516
cmux->InformModemHostWakeup();
15191517
state.set(this, State::ST::URCReady);
@@ -1579,7 +1577,7 @@ bool ServiceCellular::SetScanMode(std::string mode)
15791577
if (channel) {
15801578
auto command = at::factory(at::AT::SET_SCANMODE);
15811579

1582-
auto resp = channel->cmd(command.cmd + mode + ",1\r", 300, 1);
1580+
auto resp = channel->cmd(command.cmd + mode + ",1", 300, 1);
15831581
if (resp.code == at::Result::Code::OK) {
15841582
return true;
15851583
}
@@ -1610,7 +1608,7 @@ bool ServiceCellular::transmitDtmfTone(uint32_t digit)
16101608
at::Result resp;
16111609
if (channel) {
16121610
auto command = at::factory(at::AT::QLDTMF);
1613-
std::string dtmfString = "\"" + std::string(1, digit) + "\"\r";
1611+
std::string dtmfString = "\"" + std::string(1, digit) + "\"";
16141612
resp = channel->cmd(command.cmd + dtmfString);
16151613
if (resp) {
16161614
command = at::factory(at::AT::VTS);
@@ -1679,7 +1677,7 @@ bool ServiceCellular::handleUSSDRequest(CellularUSSDMessage::RequestType request
16791677
if (channel != nullptr) {
16801678
if (requestType == CellularUSSDMessage::RequestType::pullSesionRequest) {
16811679
channel->cmd(at::AT::SMS_GSM);
1682-
std::string command = at::factory(at::AT::CUSD_SEND) + request + ",15\r";
1680+
std::string command = at::factory(at::AT::CUSD_SEND) + request + ",15";
16831681
auto result = channel->cmd(command, commandTimeout, commandExpectedTokens);
16841682
if (result.code == at::Result::Code::OK) {
16851683
ussdState = ussd::State::pullRequestSent;

module-services/service-fota/ServiceFota.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ namespace FotaService
189189
LOG_DEBUG("HTTP Method: %s", (msg->method == HTTPMethod::GET ? "GET" : "POST"));
190190
// setup http context
191191
std::vector<std::string> httpGetCommands;
192-
httpGetCommands.push_back("AT+QHTTPCFG=\"contextid\",1\r");
193-
httpGetCommands.push_back("AT+QHTTPCFG=\"responseheader\",1\r");
192+
httpGetCommands.push_back("AT+QHTTPCFG=\"contextid\",1");
193+
httpGetCommands.push_back("AT+QHTTPCFG=\"responseheader\",1");
194194
/// left for debuging - DNS configuration
195195
// httpGetCommands.push_back("AT+QIDNSCFG=?\r");
196196
// httpGetCommands.push_back("AT+QIDNSCFG=1\r");
@@ -344,7 +344,7 @@ namespace FotaService
344344
void Service::getActiveCotext()
345345
{
346346
if (dataChannel) {
347-
auto availableContext = sendAndLogError("AT+QIACT?\r");
347+
auto availableContext = sendAndLogError("AT+QIACT?");
348348
if (availableContext) {
349349
parseQIACT(availableContext);
350350
}
@@ -420,68 +420,68 @@ namespace FotaService
420420
std::string Service::prepareQIACT(unsigned char contextId)
421421
{
422422
std::ostringstream cmd;
423-
cmd << "AT+QIACT=" << static_cast<int>(contextId) << "\r";
423+
cmd << "AT+QIACT=" << static_cast<int>(contextId);
424424
return cmd.str();
425425
}
426426

427427
std::string Service::prepareQICSGPcmd(const APN::Config &apn)
428428
{
429429
std::ostringstream cmd;
430430
cmd << "AT+QICSGP=" << static_cast<int>(apn.contextId) << "," << static_cast<int>(apn.type) << ",\"" << apn.apn
431-
<< "\",\"" << apn.username << "\",\"" << apn.password << "\"," << static_cast<int>(apn.authMethod) << "\r";
431+
<< "\",\"" << apn.username << "\",\"" << apn.password << "\"," << static_cast<int>(apn.authMethod);
432432
return cmd.str();
433433
}
434434

435435
std::string Service::prepareQICSGPquery(const APN::Config &apn)
436436
{
437437
std::ostringstream cmd;
438-
cmd << "AT+QICSGP=" << static_cast<int>(apn.contextId) << "\r";
438+
cmd << "AT+QICSGP=" << static_cast<int>(apn.contextId);
439439
return cmd.str();
440440
}
441441

442442
std::string Service::prepareQIDEACT(unsigned char contextId)
443443
{
444444
std::ostringstream cmd;
445-
cmd << "AT+QIDEACT=" << static_cast<int>(contextId) << "\r";
445+
cmd << "AT+QIDEACT=" << static_cast<int>(contextId);
446446
return cmd.str();
447447
}
448448

449449
std::string Service::prepareQFOTADLcmd(const std::string &url)
450450
{
451451
std::string fotaCmd("AT+QFOTADL=\"");
452452
fotaCmd += url;
453-
fotaCmd += "\"\r";
453+
fotaCmd += "\"";
454454
return fotaCmd;
455455
}
456456

457457
std::string Service::prepareQHTTPGET(unsigned int timeout)
458458
{
459459
std::ostringstream cmd;
460-
cmd << "AT+QHTTPGET=" << timeout << "\r";
460+
cmd << "AT+QHTTPGET=" << timeout;
461461
return cmd.str();
462462
}
463463

464464
std::string Service::prepareQHTTPREAD(unsigned int timeout)
465465
{
466466
std::ostringstream cmd;
467-
cmd << "AT+QHTTPREAD=" << timeout << "\r";
467+
cmd << "AT+QHTTPREAD=" << timeout;
468468
return cmd.str();
469469
}
470470

471471
std::string Service::prepareQHTTPURL(const std::string &url)
472472
{
473473
std::ostringstream cmd;
474-
cmd << "AT+QHTTPURL=" << url.size() << "\r";
474+
cmd << "AT+QHTTPURL=" << url.size();
475475
return cmd.str();
476476
}
477477

478478
void Service::setupSSLContext()
479479
{
480480
std::vector<std::string> sslConfigCommands;
481-
sslConfigCommands.push_back("AT+QHTTPCFG=\"sslctxid\",1\r");
482-
sslConfigCommands.push_back("AT+QSSLCFG=\"sslversion\",1,5\r");
483-
sslConfigCommands.push_back("AT+QSSLCFG=\"ciphersuite\",1,0xFFFF\r");
484-
sslConfigCommands.push_back("AT+QSSLCFG=\"seclevel\",1,0\r");
481+
sslConfigCommands.push_back("AT+QHTTPCFG=\"sslctxid\",1");
482+
sslConfigCommands.push_back("AT+QSSLCFG=\"sslversion\",1,5");
483+
sslConfigCommands.push_back("AT+QSSLCFG=\"ciphersuite\",1,0xFFFF");
484+
sslConfigCommands.push_back("AT+QSSLCFG=\"seclevel\",1,0");
485485

486486
for (auto &currCmd : sslConfigCommands) {
487487
sendAndLogError(currCmd);

0 commit comments

Comments
 (0)