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
conf.h@14:ee6cc1632166, 2011-03-29 (annotated)
- Committer:
- okini3939
- Date:
- Tue Mar 29 18:15:27 2011 +0000
- Revision:
- 14:ee6cc1632166
- Parent:
- 13:20c0f845df68
- Child:
- 15:07bfa25ba6ae
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
okini3939 | 9:8c63e4f3edab | 1 | /** @file |
okini3939 | 9:8c63e4f3edab | 2 | * @brief mbed Weather Platform |
okini3939 | 9:8c63e4f3edab | 3 | */ |
okini3939 | 9:8c63e4f3edab | 4 | #include "mbed.h" |
okini3939 | 9:8c63e4f3edab | 5 | #include "EthernetNetIf.h" |
okini3939 | 9:8c63e4f3edab | 6 | |
okini3939 | 14:ee6cc1632166 | 7 | #define CONFIG_FILE "weather.cfg" |
okini3939 | 9:8c63e4f3edab | 8 | |
okini3939 | 9:8c63e4f3edab | 9 | |
okini3939 | 9:8c63e4f3edab | 10 | #define CF_ACTION_EXPS 10 |
okini3939 | 9:8c63e4f3edab | 11 | #define CF_ACTION_NUM 10 |
okini3939 | 9:8c63e4f3edab | 12 | |
okini3939 | 9:8c63e4f3edab | 13 | enum eEXPRESSION { |
okini3939 | 9:8c63e4f3edab | 14 | EXP_NULL, |
okini3939 | 9:8c63e4f3edab | 15 | EXP_EQ, |
okini3939 | 9:8c63e4f3edab | 16 | EXP_NE, |
okini3939 | 9:8c63e4f3edab | 17 | EXP_LE, |
okini3939 | 9:8c63e4f3edab | 18 | EXP_LT, |
okini3939 | 9:8c63e4f3edab | 19 | EXP_GE, |
okini3939 | 9:8c63e4f3edab | 20 | EXP_GT, |
okini3939 | 9:8c63e4f3edab | 21 | EXP_MOD, |
okini3939 | 9:8c63e4f3edab | 22 | EXP_NMOD, |
okini3939 | 14:ee6cc1632166 | 23 | EXP_FALL, |
okini3939 | 14:ee6cc1632166 | 24 | EXP_RISE, |
okini3939 | 9:8c63e4f3edab | 25 | }; |
okini3939 | 9:8c63e4f3edab | 26 | |
okini3939 | 11:c6356e5949cd | 27 | enum eINPUTTYPE { |
okini3939 | 13:20c0f845df68 | 28 | INPUT_MOIST = 0, |
okini3939 | 13:20c0f845df68 | 29 | INPUT_FALL = 1, |
okini3939 | 13:20c0f845df68 | 30 | INPUT_RISE = 2, |
okini3939 | 11:c6356e5949cd | 31 | }; |
okini3939 | 11:c6356e5949cd | 32 | |
okini3939 | 9:8c63e4f3edab | 33 | struct tExpression { |
okini3939 | 9:8c63e4f3edab | 34 | char key; |
okini3939 | 9:8c63e4f3edab | 35 | enum eEXPRESSION expression; |
okini3939 | 9:8c63e4f3edab | 36 | float value; |
okini3939 | 9:8c63e4f3edab | 37 | }; |
okini3939 | 9:8c63e4f3edab | 38 | |
okini3939 | 9:8c63e4f3edab | 39 | struct tAction { |
okini3939 | 9:8c63e4f3edab | 40 | int action; |
okini3939 | 9:8c63e4f3edab | 41 | int count; |
okini3939 | 9:8c63e4f3edab | 42 | struct tExpression exps[CF_ACTION_EXPS]; |
okini3939 | 9:8c63e4f3edab | 43 | }; |
okini3939 | 9:8c63e4f3edab | 44 | |
okini3939 | 14:ee6cc1632166 | 45 | struct Sensor { |
okini3939 | 14:ee6cc1632166 | 46 | float pres, temp, humi, light, anemo, vane, rain, uv, moist, temp2; |
okini3939 | 14:ee6cc1632166 | 47 | }; |
okini3939 | 14:ee6cc1632166 | 48 | |
okini3939 | 9:8c63e4f3edab | 49 | struct Config { |
okini3939 | 9:8c63e4f3edab | 50 | int interval; |
okini3939 | 9:8c63e4f3edab | 51 | IpAddr ipaddr, netmask, gateway, nameserver; |
okini3939 | 9:8c63e4f3edab | 52 | char ntpserver[32]; |
okini3939 | 9:8c63e4f3edab | 53 | int filetype, actionscount; |
okini3939 | 9:8c63e4f3edab | 54 | struct tAction actions[CF_ACTION_NUM]; |
okini3939 | 9:8c63e4f3edab | 55 | char pachube_apikey[70], pachube_feedid[8]; |
okini3939 | 9:8c63e4f3edab | 56 | char twitter_user[30], twitter_pwd[30], twitter_mesg[160]; |
okini3939 | 9:8c63e4f3edab | 57 | char stations_id[8], stations_pin[34]; |
okini3939 | 9:8c63e4f3edab | 58 | char snmp_commname[30]; |
okini3939 | 10:848a2205aed1 | 59 | char lcd_mesg[100]; |
okini3939 | 10:848a2205aed1 | 60 | char leddisp_mesg[100]; |
okini3939 | 11:c6356e5949cd | 61 | enum eINPUTTYPE inputtype; |
okini3939 | 9:8c63e4f3edab | 62 | }; |
okini3939 | 9:8c63e4f3edab | 63 | |
okini3939 | 9:8c63e4f3edab | 64 | int config (char *); |