mbed Weather Platform firmware http://mbed.org/users/okini3939/notebook/mbed-weather-platform-firmware/
Dependencies: EthernetNetIf SDHCFileSystem I2CLEDDisp Agentbed NTPClient_NetServices mbed BMP085 HTTPClient ConfigFile I2CLCD
Diff: ConfigFile.h
- Revision:
- 0:4265d973a98f
- Child:
- 1:86d4b7431fbe
diff -r 000000000000 -r 4265d973a98f ConfigFile.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ConfigFile.h Fri Dec 10 17:15:15 2010 +0000 @@ -0,0 +1,46 @@ +#include "mbed.h" +#include "EthernetNetIf.h" + +#define CF_ACTION_EXPS 10 +#define CF_ACTION_NUM 10 + +enum eEXPRESSION { + EXP_NULL, + EXP_EQ, + EXP_NE, + EXP_LE, + EXP_LT, + EXP_GE, + EXP_GT, +}; + +struct tExpression { + char key; + enum eEXPRESSION expression; + float value; +}; + +struct tAction { + int action; + int count; + struct tExpression exps[CF_ACTION_EXPS]; +}; + +class ConfigFile { +public: + int interval; + IpAddr ipaddr, netmask, gateway, nameserver; + char ntpserver[32]; + int filetype, actionscount; + struct tAction actions[CF_ACTION_NUM]; + char pachube_apikey[70], pachube_feedid[8]; + char twitter_user[20], twitter_pwd[20]; + + ConfigFile (); + void load (char *); + +private: + void addsub (struct tExpression *, char *); + void add (char *); + char* chop (char *); +};