Rick McConney
/
AvnetATT_shape_hackathon
This program simply connects to a HTS221 I2C device to proximity sensor
Diff: Wnc.h
- Revision:
- 42:8500f0cb2ea5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Wnc.h Fri Oct 07 17:01:22 2016 +0000 @@ -0,0 +1,47 @@ + +#ifndef Wnc_ +#define Wnc_ + +#define WNC_WAIT_TIME_MS 500 + + +extern void SetLedColor(unsigned char ucColor); + + +class Wnc { +public: + Wnc(void); + int init(void); + bool isModemResponding(); + + char* read(int timeout_ms); + char* send(const char *cmd, int timeout_ms); + + + void setPowerSave(bool on,int t3412,int t3324); + void resumePowerSave(); + bool isPowerSaveOn(); + void wakeFromPowerSave(); + + char* getIccid(); + void startInternet(); + bool connect(char* ip, int port); + void disconnect(); + char* writeSocket(const char * s); + char* readSocket(); + char* ping(char* ip); + void setIn(); + void passthrough(); + void checkPassthrough(); + void toggleWake(); + +private: + int secToTau(int time); + int secToActivity(int time); + int hex_to_int(char c); + int hex_to_ascii(char h, char l); + int indexOf(char* str, char c); + char* encode(int value, char* result, int base); +}; + +#endif \ No newline at end of file