A library for talking to Multi-Tech's Cellular SocketModem Devices.
Dependents: M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more
utils/Vars.h@71:82205735732b, 2013-12-26 (annotated)
- Committer:
- sgodinez
- Date:
- Thu Dec 26 16:12:49 2013 +0000
- Revision:
- 71:82205735732b
- Parent:
- 39:6e94520a3217
- Child:
- 87:5db6c084adc7
Dropped Cellular::Code::CELL_ scope. Changed OK to SUCCESS. Moved common constants to Var.h
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jengbrecht | 0:563b70517320 | 1 | #ifndef VARS_H |
jengbrecht | 0:563b70517320 | 2 | #define VARS_H |
jengbrecht | 0:563b70517320 | 3 | |
jengbrecht | 0:563b70517320 | 4 | #include <string> |
jengbrecht | 0:563b70517320 | 5 | |
mfiore | 39:6e94520a3217 | 6 | namespace mts { |
mfiore | 39:6e94520a3217 | 7 | |
sgodinez | 32:629e6b1c8e22 | 8 | #ifndef MAX |
sgodinez | 32:629e6b1c8e22 | 9 | #define MAX(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a > _b ? _a : _b; }) |
sgodinez | 32:629e6b1c8e22 | 10 | #endif |
sgodinez | 32:629e6b1c8e22 | 11 | |
sgodinez | 32:629e6b1c8e22 | 12 | #ifndef MIN |
sgodinez | 32:629e6b1c8e22 | 13 | #define MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; }) |
sgodinez | 32:629e6b1c8e22 | 14 | #endif |
sgodinez | 32:629e6b1c8e22 | 15 | |
sgodinez | 32:629e6b1c8e22 | 16 | |
sgodinez | 71:82205735732b | 17 | /// An enumeration for common responses. |
sgodinez | 71:82205735732b | 18 | enum Code { |
sgodinez | 71:82205735732b | 19 | SUCCESS, ERROR, FAILURE, NO_RESPONSE |
sgodinez | 71:82205735732b | 20 | }; |
sgodinez | 71:82205735732b | 21 | |
sgodinez | 71:82205735732b | 22 | |
sgodinez | 71:82205735732b | 23 | const unsigned int PINGDELAY = 3; //Time to wait on each ping for a response before timimg out (seconds) |
sgodinez | 71:82205735732b | 24 | const unsigned int PINGNUM = 4; //Number of pings to try on ping command |
sgodinez | 71:82205735732b | 25 | |
sgodinez | 71:82205735732b | 26 | //Special Payload Characters |
sgodinez | 71:82205735732b | 27 | const char ETX = 0x03; //Ends socket connection |
sgodinez | 71:82205735732b | 28 | const char DLE = 0x10; //Escapes ETX and DLE within Payload |
sgodinez | 71:82205735732b | 29 | const char CR = 0x0D; |
sgodinez | 71:82205735732b | 30 | const char NL = 0x0A; |
sgodinez | 71:82205735732b | 31 | const char CTRL_Z = 0x1A; |
sgodinez | 71:82205735732b | 32 | |
jengbrecht | 0:563b70517320 | 33 | |
jengbrecht | 0:563b70517320 | 34 | /** This class holds several enum types and other static variables |
jengbrecht | 0:563b70517320 | 35 | * that are used throughout the rest of the SDK. |
jengbrecht | 0:563b70517320 | 36 | */ |
jengbrecht | 0:563b70517320 | 37 | class Vars |
jengbrecht | 0:563b70517320 | 38 | { |
jengbrecht | 0:563b70517320 | 39 | public: |
jengbrecht | 0:563b70517320 | 40 | /// Enumeration for different cellular radio types. |
jengbrecht | 0:563b70517320 | 41 | enum Radio {NA, E1, G2, EV2, H4, EV3, H5}; |
jengbrecht | 0:563b70517320 | 42 | |
jengbrecht | 0:563b70517320 | 43 | enum RelationalOperator {GREATER, LESS, EQUAL, GREATER_EQUAL, LESS_EQUAL}; |
jengbrecht | 0:563b70517320 | 44 | }; |
jengbrecht | 0:563b70517320 | 45 | |
mfiore | 39:6e94520a3217 | 46 | } |
mfiore | 39:6e94520a3217 | 47 | |
jengbrecht | 1:f641337952a9 | 48 | //Test Commit!!! |
jengbrecht | 1:f641337952a9 | 49 | |
jengbrecht | 0:563b70517320 | 50 | #endif /* VARS_H */ |