huaiyu wei / ennoTest2
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers sitewhere.h Source File

sitewhere.h

00001 /**
00002  * sitewhere.h - Library for interacting with SiteWhere using Google Protocol Buffers.
00003  * See https://developers.google.com/protocol-buffers/ for details on protocol buffers.
00004  * The lightweight C implementation was generated with nanopb (http://code.google.com/p/nanopb/).
00005  *
00006  * Copyright 2013-2014 Reveal Technologies LLC.
00007  */
00008 #ifndef _SITEWHERE_H
00009 #define _SITEWHERE_H
00010 
00011 //#include "Arduino.h"
00012 #include "sitewhere.pb.h"
00013 #include "pb_encode.h"
00014 
00015 #include <string.h>
00016 #include <stdint.h>
00017 #include <stddef.h>
00018 //#include "string.h"                         //warning!
00019 //#include "stdint.h"                         //warning!
00020 //#include "stddef.h"                         //warning!
00021 
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 /** Create an encoded registration message for sending to SiteWhere */
00028 unsigned int sw_register(char* hardwareId, char* specificationToken, uint8_t* buffer, size_t length,
00029         char* originator);
00030 
00031 /** Create an encoded acknowledgement message for sending to SiteWhere */
00032 unsigned int sw_acknowledge(char* hardwareId, char* message, uint8_t* buffer, size_t length, char* originator);
00033 
00034 /** Create an encoded measurement message for sending to SiteWhere */
00035 unsigned int sw_measurement(char* hardwareId, char* name, float value, int64_t eventDate,
00036         uint8_t* buffer, size_t length, char* originator);
00037 
00038 /** Create an encoded location message for sending to SiteWhere */
00039 unsigned int sw_location(char* hardwareId, float lat, float lon, float elevation, int64_t eventDate,
00040         uint8_t* buffer, size_t length, char* originator);
00041 
00042 /** Create an encoded alert message for sending to SiteWhere */
00043 unsigned int sw_alert(char* hardwareId, char* type, char* message, int64_t eventDate,
00044         uint8_t* buffer, size_t length, char* originator);
00045 
00046 #ifdef __cplusplus
00047 } /* extern "C" */
00048 #endif
00049 
00050 #endif