Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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);