summaryrefslogtreecommitdiff
path: root/src/MTS_IO_CellularRadio.cpp
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-05-29 21:02:15 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-05-30 11:58:27 +0300
commit6e9ce61addd97809d5ea7b912332dd11a4bf7cee (patch)
treedc45ee1c7ce5cbdef3e2f0d9770c9562309072da /src/MTS_IO_CellularRadio.cpp
parent9f5a4f138b56a0a1b4e5764a69261aa4a4edaa71 (diff)
downloadlibmts-io-6e9ce61addd97809d5ea7b912332dd11a4bf7cee.tar.gz
libmts-io-6e9ce61addd97809d5ea7b912332dd11a4bf7cee.tar.bz2
libmts-io-6e9ce61addd97809d5ea7b912332dd11a4bf7cee.zip
Quectel Delta Radio Firmware Upgrade support - libmts-io implementation
Initial implementation of the delta firmware image upload for Quectel radios.
Diffstat (limited to 'src/MTS_IO_CellularRadio.cpp')
-rw-r--r--src/MTS_IO_CellularRadio.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp
index d3bee11..26d9f43 100644
--- a/src/MTS_IO_CellularRadio.cpp
+++ b/src/MTS_IO_CellularRadio.cpp
@@ -1072,6 +1072,23 @@ std::string CellularRadio::sendCommand(const std::string& sCmd, MTS::IO::Cellula
return ICellularRadio::sendCommand(m_apIo, sCmd, isNeedMoreData, timeoutMillis, ESC);
}
+ICellularRadio::CODE CellularRadio::sendData(const char* pData, size_t nBytes) {
+ if(m_apIo.isNull()) {
+ printError("RADIO| IO is not set in sendData");
+ return ERROR;
+ }
+
+ int32_t iResult;
+ iResult = m_apIo->write(pData, nBytes);
+
+ if(iResult == -1) {
+ printError("RADIO| Failed to send data to radio");
+ return ERROR;
+ }
+
+ return SUCCESS;
+}
+
bool CellularRadio::splitAndAssign(const std::string& sLine, const std::string& sKey, Json::Value& jParent, const std::string& sJsonKey, Json::ValueType eType) {
std::vector<std::string> vParts = MTS::Text::split(sLine, ":", 2);