this is a sample for mbed(LPC1768)
serialization_lib/sitewhere.h@0:3163adfd2cf1, 2015-11-19 (annotated)
- Committer:
- 1
- Date:
- Thu Nov 19 10:17:55 2015 +0800
- Revision:
- 0:3163adfd2cf1
????????????????????????
1.callback
2.thread
3.auto-connect,time-up
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
1 | 0:3163adfd2cf1 | 1 | /** |
1 | 0:3163adfd2cf1 | 2 | * sitewhere.h - Library for interacting with SiteWhere using Google Protocol Buffers. |
1 | 0:3163adfd2cf1 | 3 | * See https://developers.google.com/protocol-buffers/ for details on protocol buffers. |
1 | 0:3163adfd2cf1 | 4 | * The lightweight C implementation was generated with nanopb (http://code.google.com/p/nanopb/). |
1 | 0:3163adfd2cf1 | 5 | * |
1 | 0:3163adfd2cf1 | 6 | * Copyright 2013-2014 Reveal Technologies LLC. |
1 | 0:3163adfd2cf1 | 7 | */ |
1 | 0:3163adfd2cf1 | 8 | #ifndef _SITEWHERE_H |
1 | 0:3163adfd2cf1 | 9 | #define _SITEWHERE_H |
1 | 0:3163adfd2cf1 | 10 | |
1 | 0:3163adfd2cf1 | 11 | //#include "Arduino.h" |
1 | 0:3163adfd2cf1 | 12 | #include "sitewhere.pb.h" |
1 | 0:3163adfd2cf1 | 13 | #include "pb_encode.h" |
1 | 0:3163adfd2cf1 | 14 | |
1 | 0:3163adfd2cf1 | 15 | #include <string.h> |
1 | 0:3163adfd2cf1 | 16 | #include <stdint.h> |
1 | 0:3163adfd2cf1 | 17 | #include <stddef.h> |
1 | 0:3163adfd2cf1 | 18 | //#include "string.h" //warning! |
1 | 0:3163adfd2cf1 | 19 | //#include "stdint.h" //warning! |
1 | 0:3163adfd2cf1 | 20 | //#include "stddef.h" //warning! |
1 | 0:3163adfd2cf1 | 21 | |
1 | 0:3163adfd2cf1 | 22 | |
1 | 0:3163adfd2cf1 | 23 | #ifdef __cplusplus |
1 | 0:3163adfd2cf1 | 24 | extern "C" { |
1 | 0:3163adfd2cf1 | 25 | #endif |
1 | 0:3163adfd2cf1 | 26 | |
1 | 0:3163adfd2cf1 | 27 | /** Create an encoded registration message for sending to SiteWhere */ |
1 | 0:3163adfd2cf1 | 28 | unsigned int sw_register(char* hardwareId, char* specificationToken, uint8_t* buffer, size_t length, |
1 | 0:3163adfd2cf1 | 29 | char* originator); |
1 | 0:3163adfd2cf1 | 30 | |
1 | 0:3163adfd2cf1 | 31 | /** Create an encoded acknowledgement message for sending to SiteWhere */ |
1 | 0:3163adfd2cf1 | 32 | unsigned int sw_acknowledge(char* hardwareId, char* message, uint8_t* buffer, size_t length, char* originator); |
1 | 0:3163adfd2cf1 | 33 | |
1 | 0:3163adfd2cf1 | 34 | /** Create an encoded measurement message for sending to SiteWhere */ |
1 | 0:3163adfd2cf1 | 35 | unsigned int sw_measurement(char* hardwareId, char* name, float value, int64_t eventDate, |
1 | 0:3163adfd2cf1 | 36 | uint8_t* buffer, size_t length, char* originator); |
1 | 0:3163adfd2cf1 | 37 | |
1 | 0:3163adfd2cf1 | 38 | /** Create an encoded location message for sending to SiteWhere */ |
1 | 0:3163adfd2cf1 | 39 | unsigned int sw_location(char* hardwareId, float lat, float lon, float elevation, int64_t eventDate, |
1 | 0:3163adfd2cf1 | 40 | uint8_t* buffer, size_t length, char* originator); |
1 | 0:3163adfd2cf1 | 41 | |
1 | 0:3163adfd2cf1 | 42 | /** Create an encoded alert message for sending to SiteWhere */ |
1 | 0:3163adfd2cf1 | 43 | unsigned int sw_alert(char* hardwareId, char* type, char* message, int64_t eventDate, |
1 | 0:3163adfd2cf1 | 44 | uint8_t* buffer, size_t length, char* originator); |
1 | 0:3163adfd2cf1 | 45 | |
1 | 0:3163adfd2cf1 | 46 | #ifdef __cplusplus |
1 | 0:3163adfd2cf1 | 47 | } /* extern "C" */ |
1 | 0:3163adfd2cf1 | 48 | #endif |
1 | 0:3163adfd2cf1 | 49 | |
1 | 0:3163adfd2cf1 | 50 | #endif |