Connecting a Multi-Tech Systems Dragonfly™ to Twilio's Sync for IoT Quickstart. Blink a dev board LED.

Dependencies:   MQTT MbedJSONValue mbed mtsas

Fork of DragonflyMQTT by miao zhicheng

Code to connect a Multi-Tech® MultiConnect® Dragonfly™ to Twilio's Sync for IoT: https://www.twilio.com/docs/api/devices

Uses MQTT over TLS and subscribes to a topic where you can control an LED. See also our Quickstart using this code, here: https://www.twilio.com/docs/quickstart/sync-iot/mqtt-multi-tech-multiconnect-dragonfly-sync-iot

MTSCellularManager.hpp

Committer:
miaotwilio
Date:
2017-05-09
Revision:
0:b32fa0c757d7
Child:
1:5a896191c3c4

File content as of revision 0:b32fa0c757d7:

#include <mbed.h>
#include <mtsas.h>

class MTSCellularManager {
public:
    MTSCellularManager(const char* apn_);

    ~MTSCellularManager();

    bool init();

    void uninit();

    mts::Cellular& getRadio() { return *radio; }

private:
    // An APN is required for GSM radios.
    const char* apn;
    // The MTSSerialFlowControl object represents the physical serial link between the processor and the cellular radio.
    mts::MTSSerialFlowControl* io;
    // The Cellular object represents the cellular radio.
    mts::Cellular* radio;
};