Simple detection for LE910-NA1 modules
Fork of MTS-Cellular by
Diff: Cellular/Cellular.cpp
- Revision:
- 8:2d7259d244d1
- Parent:
- 7:0ee8e69a3e9c
- Child:
- 9:1a03e3f3e7fe
--- a/Cellular/Cellular.cpp Wed May 21 15:21:25 2014 -0500 +++ b/Cellular/Cellular.cpp Wed May 21 15:28:37 2014 -0500 @@ -5,6 +5,16 @@ using namespace mts; +bool Cellular::init(MTSBufferedIO* io) +{ + if (io == NULL) { + return false; + } + this->io = io; + + return true; +} + std::string Cellular::getRegistrationNames(Registration registration) { switch(registration) { @@ -81,6 +91,22 @@ return UNKNOWN; } +Code Cellular::setApn(const std::string& apn) +{ + Code code = sendBasicCommand("AT#APNSERV=\"" + apn + "\"", 1000); + if (code != SUCCESS) { + return code; + } + this->apn = apn; + return code; +} + + +Code Cellular::setDns(const std::string& primary, const std::string& secondary) +{ + return sendBasicCommand("AT#DNS=1," + primary + "," + secondary, 1000); +} + Code Cellular::sendSMS(const Sms& sms) { return sendSMS(sms.phoneNumber, sms.message);