From 49429a4f10d9e40d3c2bcba2d9c8fc0d5a9bc830 Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Wed, 26 Jun 2019 09:03:38 +0300 Subject: [MTS-MTQ] QuectelRadio implementation A small fix for the QuectelRadio::getNetwork - removed extra `"` character when only short / long operator name is returned by +COPS? --- src/MTS_IO_QuectelRadio.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp index 8ac9bac..472255f 100644 --- a/src/MTS_IO_QuectelRadio.cpp +++ b/src/MTS_IO_QuectelRadio.cpp @@ -167,8 +167,10 @@ CellularRadio::CODE QuectelRadio::getNetwork(std::string& sNetwork) { // +COPS: 0,0,"CHN-UNICOM UNICOM",7 // ^start ^end + // +COPS: 0,0,"AT&T",7 + // ^st ^end size_t start = sValue.find("\"") + 1; - size_t end = sValue.find(" ", start); + size_t end = sValue.find_first_of(" \"", start); sNetwork = sValue.substr(start, end-start); } else { sNetwork = ""; // Not connected to any network -- cgit v1.2.3