![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
DeviceInfo.h@116:5de54f09f754, 2015-05-20 (annotated)
- Committer:
- xinlei
- Date:
- Wed May 20 09:55:49 2015 +0000
- Revision:
- 116:5de54f09f754
- Parent:
- 107:f1ee3e1eb126
device bootstrap revamp
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Cumulocity | 41:804f6a0bda26 | 1 | #ifndef DEVICEINFO_H |
Cumulocity | 41:804f6a0bda26 | 2 | #define DEVICEINFO_H |
Cumulocity | 41:804f6a0bda26 | 3 | #include "MDM.h" |
Cumulocity | 41:804f6a0bda26 | 4 | |
Cumulocity | 41:804f6a0bda26 | 5 | class DeviceInfo |
Cumulocity | 41:804f6a0bda26 | 6 | { |
Cumulocity | 41:804f6a0bda26 | 7 | public: |
Cumulocity | 41:804f6a0bda26 | 8 | typedef struct { |
xinlei | 107:f1ee3e1eb126 | 9 | int rssi; // RSSI [dBm] |
xinlei | 107:f1ee3e1eb126 | 10 | int ber; // BER [%] |
Cumulocity | 41:804f6a0bda26 | 11 | } SignalQuality; |
xinlei | 107:f1ee3e1eb126 | 12 | |
xinlei | 107:f1ee3e1eb126 | 13 | DeviceInfo(MDMParser::DevStatus& devStatus) { |
xinlei | 107:f1ee3e1eb126 | 14 | *_cellId = 0; |
xinlei | 107:f1ee3e1eb126 | 15 | memcpy(&_devStatus, &devStatus, sizeof(MDMParser::DevStatus)); |
xinlei | 107:f1ee3e1eb126 | 16 | memset(&_netStatus, 0, sizeof(MDMParser::NetStatus)); |
xinlei | 107:f1ee3e1eb126 | 17 | memset(&_signalQuality, 0, sizeof(DeviceInfo::SignalQuality)); |
xinlei | 107:f1ee3e1eb126 | 18 | } |
Cumulocity | 41:804f6a0bda26 | 19 | |
xinlei | 107:f1ee3e1eb126 | 20 | const char* cellId(); |
xinlei | 107:f1ee3e1eb126 | 21 | const char* iccid() const { return _devStatus.ccid; } |
xinlei | 116:5de54f09f754 | 22 | const char* imei() const { return _devStatus.imei; } |
xinlei | 116:5de54f09f754 | 23 | const char* imsi() const { return _devStatus.imsi; } |
xinlei | 77:f6717e4eccc4 | 24 | SignalQuality * signalQuality(bool realTime=true); |
Cumulocity | 41:804f6a0bda26 | 25 | |
Cumulocity | 41:804f6a0bda26 | 26 | private: |
Cumulocity | 41:804f6a0bda26 | 27 | MDMParser::DevStatus _devStatus; |
Cumulocity | 41:804f6a0bda26 | 28 | MDMParser::NetStatus _netStatus; |
Cumulocity | 41:804f6a0bda26 | 29 | char _cellId[9]; |
Cumulocity | 41:804f6a0bda26 | 30 | SignalQuality _signalQuality; |
Cumulocity | 41:804f6a0bda26 | 31 | }; |
Cumulocity | 41:804f6a0bda26 | 32 | |
Cumulocity | 41:804f6a0bda26 | 33 | #endif |