Rick McConney
/
AvnetATT_shape_hackathon
This program simply connects to a HTS221 I2C device to proximity sensor
Wnc.h@43:3979ea0a2df3, 2016-10-10 (annotated)
- Committer:
- elmkom
- Date:
- Mon Oct 10 16:29:34 2016 +0000
- Revision:
- 43:3979ea0a2df3
- Parent:
- 42:8500f0cb2ea5
Flush modem buffer before send
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
elmkom | 42:8500f0cb2ea5 | 1 | |
elmkom | 42:8500f0cb2ea5 | 2 | #ifndef Wnc_ |
elmkom | 42:8500f0cb2ea5 | 3 | #define Wnc_ |
elmkom | 42:8500f0cb2ea5 | 4 | |
elmkom | 42:8500f0cb2ea5 | 5 | #define WNC_WAIT_TIME_MS 500 |
elmkom | 42:8500f0cb2ea5 | 6 | |
elmkom | 42:8500f0cb2ea5 | 7 | |
elmkom | 42:8500f0cb2ea5 | 8 | extern void SetLedColor(unsigned char ucColor); |
elmkom | 42:8500f0cb2ea5 | 9 | |
elmkom | 42:8500f0cb2ea5 | 10 | |
elmkom | 42:8500f0cb2ea5 | 11 | class Wnc { |
elmkom | 42:8500f0cb2ea5 | 12 | public: |
elmkom | 42:8500f0cb2ea5 | 13 | Wnc(void); |
elmkom | 42:8500f0cb2ea5 | 14 | int init(void); |
elmkom | 42:8500f0cb2ea5 | 15 | bool isModemResponding(); |
elmkom | 42:8500f0cb2ea5 | 16 | |
elmkom | 42:8500f0cb2ea5 | 17 | char* read(int timeout_ms); |
elmkom | 42:8500f0cb2ea5 | 18 | char* send(const char *cmd, int timeout_ms); |
elmkom | 42:8500f0cb2ea5 | 19 | |
elmkom | 42:8500f0cb2ea5 | 20 | |
elmkom | 42:8500f0cb2ea5 | 21 | void setPowerSave(bool on,int t3412,int t3324); |
elmkom | 42:8500f0cb2ea5 | 22 | void resumePowerSave(); |
elmkom | 42:8500f0cb2ea5 | 23 | bool isPowerSaveOn(); |
elmkom | 42:8500f0cb2ea5 | 24 | void wakeFromPowerSave(); |
elmkom | 42:8500f0cb2ea5 | 25 | |
elmkom | 42:8500f0cb2ea5 | 26 | char* getIccid(); |
elmkom | 42:8500f0cb2ea5 | 27 | void startInternet(); |
elmkom | 42:8500f0cb2ea5 | 28 | bool connect(char* ip, int port); |
elmkom | 42:8500f0cb2ea5 | 29 | void disconnect(); |
elmkom | 42:8500f0cb2ea5 | 30 | char* writeSocket(const char * s); |
elmkom | 42:8500f0cb2ea5 | 31 | char* readSocket(); |
elmkom | 42:8500f0cb2ea5 | 32 | char* ping(char* ip); |
elmkom | 42:8500f0cb2ea5 | 33 | void setIn(); |
elmkom | 42:8500f0cb2ea5 | 34 | void passthrough(); |
elmkom | 42:8500f0cb2ea5 | 35 | void checkPassthrough(); |
elmkom | 42:8500f0cb2ea5 | 36 | void toggleWake(); |
elmkom | 42:8500f0cb2ea5 | 37 | |
elmkom | 42:8500f0cb2ea5 | 38 | private: |
elmkom | 42:8500f0cb2ea5 | 39 | int secToTau(int time); |
elmkom | 42:8500f0cb2ea5 | 40 | int secToActivity(int time); |
elmkom | 42:8500f0cb2ea5 | 41 | int hex_to_int(char c); |
elmkom | 42:8500f0cb2ea5 | 42 | int hex_to_ascii(char h, char l); |
elmkom | 42:8500f0cb2ea5 | 43 | int indexOf(char* str, char c); |
elmkom | 42:8500f0cb2ea5 | 44 | char* encode(int value, char* result, int base); |
elmkom | 42:8500f0cb2ea5 | 45 | }; |
elmkom | 42:8500f0cb2ea5 | 46 | |
elmkom | 42:8500f0cb2ea5 | 47 | #endif |