ACKme Logo WiConnect Host Library- API Reference Guide
 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
GhmInterface.h
1 
29 #pragma once
30 
31 #include "Wiconnect.h"
32 
33 #include "api/types/WiconnectSocket.h"
34 #include "api/types/GhmMessageList.h"
35 
39 namespace wiconnect {
40 
45 #define GHM_ADD_INT(array, name, integerVal) \
46 { \
47  array.elementName = name; \
48  array.type = GHM_VALUE_INT; \
49  array.u.intValue = (uint32_t)integerVal; \
50 }
51 
52 
57 #define GHM_ADD_STR(array, name, stringVal) \
58 { \
59  array.elementName = name; \
60  array.type = GHM_VALUE_STR; \
61  array.u.strValue = (const char*)stringVal; \
62 }
63 
64 
65 
66 
82 {
83 public:
84 
95  WiconnectResult ghmDownloadCapabilities(const char *capsNameOrCustomUrl = NULL, uint32_t version = 0);
96 
110  WiconnectResult ghmActivate(const char *userName, const char *password, const char *capsFilename = NULL);
111 
124  WiconnectResult ghmDeactivate(const char *userName, const char *password);
125 
134  WiconnectResult ghmIsActivated(bool *statusPtr);
135 
136 
137  // ------------------------------------------------------------------------
138 
139 
151  WiconnectResult ghmRead(const char *controlName, const char **valueStrPtr);
152 
164  WiconnectResult ghmRead(const char *controlName, uint32_t *valueIntPtr);
165 
178  WiconnectResult ghmRead(const char *controlName, char *valueBuffer, uint16_t valueBufferLen);
179 
191  WiconnectResult ghmWrite(const char *elementName, const char *strValue);
192 
204  WiconnectResult ghmWrite(const char *elementName, uint32_t uintValue);
205 
217  WiconnectResult ghmWrite(const char *elementName, int32_t intValue);
218 
229  WiconnectResult ghmWrite(const GhmElementArray *elementArray);
230 
242 
243 
244  // ------------------------------------------------------------------------
245 
246 
258  WiconnectResult ghmPostMessage(WiconnectSocket &socket, bool jsonFormatted=false);
259 
272 
288 
302 
315  WiconnectResult ghmDeleteMessage(uint8_t listIndex);
316 
327  WiconnectResult ghmDeleteMessage(const char *msgId);
328 
341  WiconnectResult ghmListMessages(GhmMessageList &msgList, uint8_t maxCount = 0);
342 
343 
344 protected:
345  GhmInterface(Wiconnect *wiconnect);
346 
347  WiconnectResult ghmGetMessage(WiconnectSocket &socket, uint8_t listIndex, const char *msgId, GhmMessageGetType getType);
348  WiconnectResult processMessageList(char *resultStr, GhmMessageList &resultList);
349 
350 private:
351  Wiconnect *wiconnect;
352 
353 };
354 
355 
356 }
WiconnectResult ghmDeactivate(const char *userName, const char *password)
Deactivate WiFi module with http://goHACK.me.
WiconnectResult ghmListMessages(GhmMessageList &msgList, uint8_t maxCount=0)
List available messages for device on http://goHACK.me.
Push and pull all streams and controls.
WiconnectResult
API Result code.
WiconnectResult ghmIsActivated(bool *statusPtr)
Return if WiFi module is activated with http://goHACK.me.
WiconnectResult ghmDeleteMessage(uint8_t listIndex)
Delete message from http://goHACK.me.
WiconnectResult ghmWrite(const char *elementName, const char *strValue)
Write stream or control data to http://goHACK.me.
WiconnectResult ghmPostMessage(WiconnectSocket &socket, bool jsonFormatted=false)
POST message to http://goHACK.me.
GhmMessageGetType
goHACK.me message GET type
List of goHACK.me messages.
The provides an interface for http://goHACK.me.
Definition: GhmInterface.h:81
Only GET the message data.
GhmSyncType
goHACK.me sychronization type
WiconnectResult ghmActivate(const char *userName, const char *password, const char *capsFilename=NULL)
Activate WiFi module with http://goHACK.me.
WiconnectResult ghmDownloadCapabilities(const char *capsNameOrCustomUrl=NULL, uint32_t version=0)
Download a device capabilities file to WiFi module's internal file system.
WiconnectResult ghmRead(const char *controlName, const char **valueStrPtr)
Read control data from http://goHACK.me.
Connection object to remote server.
WiconnectResult ghmSynchronize(GhmSyncType type=GHM_SYNC_ALL)
Synchronize WiFi module with http://goHACK.me.
WiconnectResult ghmGetMessage(WiconnectSocket &socket, GhmMessageGetType getType=GHM_MSG_GET_DATA_ONLY)
GET message from http://goHACK.me.
The root WiConnect library class. This class inheriets all WiConnect functionality.
Array of goHACK.me stream or control values.