Device management with online dashboard See https://freshen.cc for full description
README.md@0:b21e585b3aa1, 2018-04-10 (annotated)
- Committer:
- lsm
- Date:
- Tue Apr 10 06:50:09 2018 +0000
- Revision:
- 0:b21e585b3aa1
- Child:
- 1:dd0e3cc2211a
Version 1.3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lsm | 0:b21e585b3aa1 | 1 | # Freshen - device management framework |
lsm | 0:b21e585b3aa1 | 2 | |
lsm | 0:b21e585b3aa1 | 3 | See https://freshen.cc for the full description and documentation |
lsm | 0:b21e585b3aa1 | 4 | |
lsm | 0:b21e585b3aa1 | 5 | ## Example mbedOS app |
lsm | 0:b21e585b3aa1 | 6 | |
lsm | 0:b21e585b3aa1 | 7 | ```c |
lsm | 0:b21e585b3aa1 | 8 | |
lsm | 0:b21e585b3aa1 | 9 | #include "mbed.h" |
lsm | 0:b21e585b3aa1 | 10 | #include "EthernetInterface.h" |
lsm | 0:b21e585b3aa1 | 11 | |
lsm | 0:b21e585b3aa1 | 12 | #define FRESHEN_ENABLE_DASH |
lsm | 0:b21e585b3aa1 | 13 | #include "freshen.h" |
lsm | 0:b21e585b3aa1 | 14 | static struct freshen_ctx ctx; |
lsm | 0:b21e585b3aa1 | 15 | |
lsm | 0:b21e585b3aa1 | 16 | EthernetInterface net; |
lsm | 0:b21e585b3aa1 | 17 | DigitalOut myled(LED1); |
lsm | 0:b21e585b3aa1 | 18 | |
lsm | 0:b21e585b3aa1 | 19 | int main() { |
lsm | 0:b21e585b3aa1 | 20 | net.connect(); |
lsm | 0:b21e585b3aa1 | 21 | freshen_net = &net; |
lsm | 0:b21e585b3aa1 | 22 | |
lsm | 0:b21e585b3aa1 | 23 | while(1) { |
lsm | 0:b21e585b3aa1 | 24 | const char *ip = net.get_ip_address(); |
lsm | 0:b21e585b3aa1 | 25 | printf("IP address is: %s\n", ip ? ip : "No IP"); |
lsm | 0:b21e585b3aa1 | 26 | |
lsm | 0:b21e585b3aa1 | 27 | myled = 1; |
lsm | 0:b21e585b3aa1 | 28 | wait(0.5); |
lsm | 0:b21e585b3aa1 | 29 | myled = 0; |
lsm | 0:b21e585b3aa1 | 30 | wait(0.5); |
lsm | 0:b21e585b3aa1 | 31 | |
lsm | 0:b21e585b3aa1 | 32 | freshen_poll_dash(&ctx, "1.2", "ACCESS_TOKEN"); |
lsm | 0:b21e585b3aa1 | 33 | } |
lsm | 0:b21e585b3aa1 | 34 | } |
lsm | 0:b21e585b3aa1 | 35 | |
lsm | 0:b21e585b3aa1 | 36 | ``` |