miao zhicheng
/
DragonflyMQTT
Using MQTT on Dragonfly
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 | }; |