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
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@0:b32fa0c757d7, 2017-05-09 (annotated)
- Committer:
- miaotwilio
- Date:
- Tue May 09 13:16:48 2017 +0000
- Revision:
- 0:b32fa0c757d7
- Child:
- 1:5a896191c3c4
working prototype without CA validation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
miaotwilio | 0:b32fa0c757d7 | 1 | #include <mbed.h> |
miaotwilio | 0:b32fa0c757d7 | 2 | #include <mtsas.h> |
miaotwilio | 0:b32fa0c757d7 | 3 | |
miaotwilio | 0:b32fa0c757d7 | 4 | class MTSCellularManager { |
miaotwilio | 0:b32fa0c757d7 | 5 | public: |
miaotwilio | 0:b32fa0c757d7 | 6 | MTSCellularManager(const char* apn_); |
miaotwilio | 0:b32fa0c757d7 | 7 | |
miaotwilio | 0:b32fa0c757d7 | 8 | ~MTSCellularManager(); |
miaotwilio | 0:b32fa0c757d7 | 9 | |
miaotwilio | 0:b32fa0c757d7 | 10 | bool init(); |
miaotwilio | 0:b32fa0c757d7 | 11 | |
miaotwilio | 0:b32fa0c757d7 | 12 | void uninit(); |
miaotwilio | 0:b32fa0c757d7 | 13 | |
miaotwilio | 0:b32fa0c757d7 | 14 | mts::Cellular& getRadio() { return *radio; } |
miaotwilio | 0:b32fa0c757d7 | 15 | |
miaotwilio | 0:b32fa0c757d7 | 16 | private: |
miaotwilio | 0:b32fa0c757d7 | 17 | // An APN is required for GSM radios. |
miaotwilio | 0:b32fa0c757d7 | 18 | const char* apn; |
miaotwilio | 0:b32fa0c757d7 | 19 | // The MTSSerialFlowControl object represents the physical serial link between the processor and the cellular radio. |
miaotwilio | 0:b32fa0c757d7 | 20 | mts::MTSSerialFlowControl* io; |
miaotwilio | 0:b32fa0c757d7 | 21 | // The Cellular object represents the cellular radio. |
miaotwilio | 0:b32fa0c757d7 | 22 | mts::Cellular* radio; |
miaotwilio | 0:b32fa0c757d7 | 23 | }; |