diff --git a/database b/database new file mode 100644 index 000000000..02b9b718b Binary files /dev/null and b/database differ diff --git a/src/vscp/common/vscp.h b/src/vscp/common/vscp.h index 868ad5a49..05d1ac406 100644 --- a/src/vscp/common/vscp.h +++ b/src/vscp/common/vscp.h @@ -585,68 +585,66 @@ extern "C" Template for VSCP XML event data data: -datetime,head,obid,datetime,timestamp,class,type,guid,sizedata,data,note +datetime,vscpHead,vscpObId,vscpDateTime,vscpTimeStamp,vscpClass,vscpType,vscpGuid,vscpData,note + vscpHead="3" + vscpObId="1234" + vscpDateTime="2017-01-13T10:16:02" + vscpTimeStamp="50817" + vscpClass="10" + vscpType="6" + vscpGuid="00:00:00:00:00:00:00:00:00:00:00:00:00:01:00:02" + vscpData="0x48,0x34,0x35,0x2E,0x34,0x36,0x34" /> */ #define VSCP_XML_EVENT_TEMPLATE \ "" /* Template for VSCP JSON event data - data: datetime,head,obid,datetime,timestamp,class,type,guid,data,note + data: datetime,vscpHead,vscpObId,datetime,timestamp,class,type,guid,data,note { - "head": 2, - "obid": 123, - "datetime": "2017-01-13T10:16:02", - "timestamp":50817, - "class": 10, - "type": 8, - "guid": "00:00:00:00:00:00:00:00:00:00:00:00:00:01:00:02", - "data": [1,2,3,4,5,6,7], - "note": "This is some text" + "vscpHead": 2, + "vscpObId": 123, + "vscpDateTime": "2017-01-13T10:16:02", + "vscpTimeStamp":50817, + "vscpClass": 10, + "vscpType": 8, + "vscpGuid": "00:00:00:00:00:00:00:00:00:00:00:00:00:01:00:02", + "vscpData": [1,2,3,4,5,6,7], + "vscpNote": "This is some text" } */ #define VSCP_JSON_EVENT_TEMPLATE \ "{\n" \ - "\"head\": %d,\n" \ - "\"obid\": %lu,\n" \ - "\"datetime\": \"%s\",\n" \ - "\"timestamp\": %lu,\n" \ - "\"class\": %d,\n" \ - "\"type\": %d,\n" \ - "\"guid\": \"%s\",\n" \ - "\"data\": [%s],\n" \ - "\"note\": \"%s\"\n" \ + "\"vscpHead\": %d,\n" \ + "\"vscpObId\": %lu,\n" \ + "\"vscpDateTime\": \"%s\",\n" \ + "\"vscpTimeStamp\": %lu,\n" \ + "\"vscpClass\": %d,\n" \ + "\"vscpType\": %d,\n" \ + "\"vscpGuid\": \"%s\",\n" \ + "\"vscpData\": [%s],\n" \ + "\"vscpNote\": \"%s\"\n" \ "}" /*! Template for VSCP HTML event data - data: datetime,class,type,data-count,data,guid,head,timestamp,obid,note + data: vscpDateTime,vscpClass,type,data-count,data,guid,vscpHead,vscpTimeStamp,vscpObId,note

VSCP Event

@@ -664,10 +662,10 @@ Data: 1,2,3,4,5,6,7
From GUID: 00:00:00:00:00:00:00:00:00:00:00:00:00:01:00:02

-Head: 6
+vscpHead: 6
DateTime: 2013-11-02T12:34:22Z Timestamp: 1234
-obid: 1234
+ObId: 1234
note: This is a note

@@ -686,12 +684,12 @@ note: This is a note
"From GUID: %s
" \ "

" \ "

" \ - "Head: %d
" \ + "vscpHead: %d
" \ "

" \ "DateTime: %s
" \ "

" \ "Timestamp: %lu
" \ - "obid: %lu
" \ + "ObId: %lu
" \ "note: %s
" \ "

" diff --git a/src/vscp/common/vscp_class.h b/src/vscp/common/vscp_class.h index 2cabb1fe2..9c43541ba 100644 --- a/src/vscp/common/vscp_class.h +++ b/src/vscp/common/vscp_class.h @@ -11,7 +11,7 @@ /* ****************************************************************************** * VSCP (Very Simple Control Protocol) - * https://www.vscp.org + * http://www.vscp.org * * The MIT License (MIT) * @@ -37,7 +37,7 @@ * SOFTWARE. * * This file is part of VSCP - Very Simple Control Protocol - * https://www.vscp.org + * http://www.vscp.org * * ****************************************************************************** */ @@ -47,7 +47,7 @@ !!!!!!!!!!!!!!!!!!!! W A R N I N G !!!!!!!!!!!!!!!!!!!! This file is auto-generated see https://github.com/grodansparadis/vscp-classes - Generated: 2020-01-23 10:19:53.945307 + Generated: 2020-02-19 17:52:49.804727 */ #ifndef VSCP_CLASS_H diff --git a/src/vscp/common/vscp_hashclass.h b/src/vscp/common/vscp_hashclass.h index 91220029f..0c095f462 100644 --- a/src/vscp/common/vscp_hashclass.h +++ b/src/vscp/common/vscp_hashclass.h @@ -2,7 +2,7 @@ !!!!!!!!!!!!!!!!!!!! W A R N I N G !!!!!!!!!!!!!!!!!!!! This file is auto-generated see https://github.com/grodansparadis/vscp-classes - Generated: 2020-01-23 10:19:54.261153 + Generated: 2020-02-19 17:52:50.955217 */ m_hashClass[ 0 ] = _("CLASS1_PROTOCOL"); diff --git a/src/vscp/common/vscp_hashtype.h b/src/vscp/common/vscp_hashtype.h index 7e0ad73a3..cc3de773d 100644 --- a/src/vscp/common/vscp_hashtype.h +++ b/src/vscp/common/vscp_hashtype.h @@ -2,7 +2,7 @@ !!!!!!!!!!!!!!!!!!!! W A R N I N G !!!!!!!!!!!!!!!!!!!! This file is auto-generated see https://github.com/grodansparadis/vscp-classes - Generated: 2020-01-23 10:19:54.346308 + Generated: 2020-02-19 17:52:51.503163 */ diff --git a/src/vscp/common/vscp_type.h b/src/vscp/common/vscp_type.h index 35b0f8e6d..0d4f85657 100644 --- a/src/vscp/common/vscp_type.h +++ b/src/vscp/common/vscp_type.h @@ -12,7 +12,7 @@ /* ****************************************************************************** * VSCP (Very Simple Control Protocol) - * https://www.vscp.org + * http://www.vscp.org * * The MIT License (MIT) * @@ -37,7 +37,7 @@ * SOFTWARE. * * This file is part of VSCP - Very Simple Control Protocol - * https://www.vscp.org + * http://www.vscp.org * * ****************************************************************************** */ @@ -48,7 +48,7 @@ !!!!!!!!!!!!!!!!!!!! W A R N I N G !!!!!!!!!!!!!!!!!!!! This file is auto-generated see https://github.com/grodansparadis/vscp-classes - Generated: 2020-01-23 10:19:54.182518 + Generated: 2020-02-19 17:52:50.376925 */ #ifndef VSCP_TYPE_H diff --git a/src/vscp/common/vscphelper.cpp b/src/vscp/common/vscphelper.cpp index 96caa611d..a017f7b86 100644 --- a/src/vscp/common/vscphelper.cpp +++ b/src/vscp/common/vscphelper.cpp @@ -3373,14 +3373,15 @@ vscp_convertEventToJSON(std::string& strJSON, vscpEvent* pEvent) // vscp_convertJSONToEvent // // { -// "head": 2, -// "obid"; 123, -// "datetime": "2017-01-13T10:16:02", -// "timestamp":50817, -// "class": 10, -// "type": 8, -// "guid": "00:00:00:00:00:00:00:00:00:00:00:00:00:01:00:02", -// "data": [1,2,3,4,5,6,7] +// "vscpHead": 2, +// "vscpObId": 123, +// "vscpDateTime": "2017-01-13T10:16:02Z", +// "vscpTimeStamp":50817, +// "vscpClass": 10, +// "vscpType": 8, +// "vscpGuid": "00:00:00:00:00:00:00:00:00:00:00:00:00:01:00:02", +// "vscpData": [1,2,3,4,5,6,7], +// "vscpNote": "This is some text" // } bool @@ -3396,24 +3397,24 @@ vscp_convertJSONToEvent(vscpEvent* pEvent, std::string& strJSON) auto j = json::parse(strJSON); - // Head - if (j.find("head") != j.end()) { - pEvent->head = j.at("head").get(); + // vscpHead + if (j.find("vscpHead") != j.end()) { + pEvent->head = j.at("vscpHead").get(); } - // obid - if (j.find("obid") != j.end()) { - pEvent->obid = j.at("obid").get(); + // vscpObId + if (j.find("vscpObId") != j.end()) { + pEvent->obid = j.at("vscpObId").get(); } - // TimeStamp - if (j.find("timestamp") != j.end()) { - pEvent->timestamp = j.at("timestamp").get(); + // vscpTimeStamp + if (j.find("vscpTimeStamp") != j.end()) { + pEvent->timestamp = j.at("vscpTimeStamp").get(); } - // DateTime - if (j.find("datetime") != j.end()) { - std::string dtStr = j.at("datetime").get(); + // vscpDateTime + if (j.find("vscpDateTime") != j.end()) { + std::string dtStr = j.at("vscpDateTime").get(); struct tm tm; memset(&tm, 0, sizeof(tm)); vscp_parseISOCombined(&tm, dtStr); @@ -3421,27 +3422,27 @@ vscp_convertJSONToEvent(vscpEvent* pEvent, std::string& strJSON) } // VSCP class - if (j.find("class") != j.end()) { - pEvent->vscp_class = j.at("class").get(); + if (j.find("vscpClass") != j.end()) { + pEvent->vscp_class = j.at("vscpClass").get(); } // VSCP type - if (j.find("type") != j.end()) { - pEvent->vscp_type = j.at("type").get(); + if (j.find("vscpType") != j.end()) { + pEvent->vscp_type = j.at("vscpType").get(); } // GUID - if (j.find("guid") != j.end()) { - std::string guidStr = j.at("guid").get(); + if (j.find("vscpGuid") != j.end()) { + std::string guidStr = j.at("vscpGuid").get(); cguid guid; guid.getFromString(guidStr); guid.writeGUID(pEvent->GUID); } pEvent->sizeData = 0; - if (j.find("data") != j.end()) { + if (j.find("vscpData") != j.end()) { - std::vector data_array = j.at("data"); + std::vector data_array = j.at("vscpData"); // Check size if (data_array.size() > VSCP_MAX_DATA) @@ -3512,14 +3513,14 @@ vscp_convertEventExToJSON(std::string& strJSON, vscpEventEx* pEventEx) // vscp_convertJSONToEvent // // { -// "head": 2, -// "obid"; 123, -// "datetime": "2017-01-13T10:16:02", -// "timestamp":50817, -// "class": 10, -// "type": 8, -// "guid": "00:00:00:00:00:00:00:00:00:00:00:00:00:01:00:02", -// "data": [1,2,3,4,5,6,7] +// "vscpHead": 2, +// "vscpObId"; 123, +// "vscpDateTime": "2017-01-13T10:16:02Z", +// "vscpTimeStamp":50817, +// "vscpClass": 10, +// "vscpType": 8, +// "vscpGuid": "00:00:00:00:00:00:00:00:00:00:00:00:00:01:00:02", +// "vscpData": [1,2,3,4,5,6,7] // } bool @@ -3536,23 +3537,23 @@ vscp_convertJSONToEventEx(vscpEventEx* pEventEx, std::string& strJSON) auto j = json::parse(strJSON); // Head - if (j.find("head") != j.end()) { - pEventEx->head = j.at("head").get(); + if (j.find("vscpHead") != j.end()) { + pEventEx->head = j.at("vscpHead").get(); } // obid - if (j.find("obid") != j.end()) { - pEventEx->obid = j.at("obid").get(); + if (j.find("vscpObId") != j.end()) { + pEventEx->obid = j.at("vscpObId").get(); } // TimeStamp - if (j.find("timestamp") != j.end()) { - pEventEx->timestamp = j.at("timestamp").get(); + if (j.find("vscpTimeStamp") != j.end()) { + pEventEx->timestamp = j.at("vscpTimeStamp").get(); } // DateTime - if (j.find("datetime") != j.end()) { - std::string dtStr = j.at("datetime").get(); + if (j.find("vscpDateTime") != j.end()) { + std::string dtStr = j.at("vscpDateTime").get(); struct tm tm; memset(&tm, 0, sizeof(tm)); vscp_parseISOCombined(&tm, dtStr); @@ -3560,27 +3561,27 @@ vscp_convertJSONToEventEx(vscpEventEx* pEventEx, std::string& strJSON) } // VSCP class - if (j.find("class") != j.end()) { - pEventEx->vscp_class = j.at("class").get(); + if (j.find("vscpClass") != j.end()) { + pEventEx->vscp_class = j.at("vscpClass").get(); } // VSCP type - if (j.find("type") != j.end()) { - pEventEx->vscp_type = j.at("type").get(); + if (j.find("vscpType") != j.end()) { + pEventEx->vscp_type = j.at("vscpType").get(); } // GUID - if (j.find("guid") != j.end()) { - std::string guidStr = j.at("guid").get(); + if (j.find("vscpGuid") != j.end()) { + std::string guidStr = j.at("vscpGuid").get(); cguid guid; guid.getFromString(guidStr); guid.writeGUID(pEventEx->GUID); } pEventEx->sizeData = 0; - if (j.find("data") != j.end()) { + if (j.find("vscpData") != j.end()) { - std::vector data_array = j.at("data"); + std::vector data_array = j.at("vscpData"); // Check size if (data_array.size() > VSCP_MAX_DATA) @@ -3647,14 +3648,14 @@ vscp_convertEventToXML(std::string& strXML, vscpEvent* pEvent) // vscp_convertXMLToEvent // // // ---------------------------------------------------------------------------- @@ -3673,27 +3674,27 @@ startEventXMLParser(void* data, const char* name, const char** attr) for (int i = 0; attr[i]; i += 2) { std::string attribute = attr[i + 1]; - if (0 == strcmp(attr[i], "head")) { + if (0 == strcmp(attr[i], "vscpHead")) { pev->head = vscp_readStringValue(attribute); - } else if (0 == strcmp(attr[i], "obid")) { + } else if (0 == strcmp(attr[i], "vscpObId")) { pev->obid = vscp_readStringValue(attribute); - } else if (0 == strcmp(attr[i], "datetime")) { + } else if (0 == strcmp(attr[i], "vscpDateTime")) { struct tm tm; memset(&tm, 0, sizeof(tm)); std::string dt = attribute; if (vscp_parseISOCombined(&tm, dt)) { vscp_setEventDateTime(pev, &tm); } - } else if (0 == strcmp(attr[i], "timestamp")) { + } else if (0 == strcmp(attr[i], "vscpTimeStamp")) { pev->timestamp = vscp_readStringValue(attribute); - } else if (0 == strcmp(attr[i], "class")) { + } else if (0 == strcmp(attr[i], "vscpClass")) { pev->vscp_class = vscp_readStringValue(attribute); - } else if (0 == strcmp(attr[i], "type")) { + } else if (0 == strcmp(attr[i], "vscpType")) { pev->vscp_type = vscp_readStringValue(attribute); - } else if (0 == strcmp(attr[i], "guid")) { + } else if (0 == strcmp(attr[i], "vscpGuid")) { std::string strGUID = attribute; vscp_setEventGuidFromString(pev, strGUID); - } else if (0 == strcmp(attr[i], "data")) { + } else if (0 == strcmp(attr[i], "vscpData")) { std::string str = attribute; vscp_setEventDataFromString(pev, str); } @@ -3782,14 +3783,14 @@ vscp_convertEventExToXML(std::string& strXML, vscpEventEx* pEventEx) // vscp_convertXMLToEventEx // // // ---------------------------------------------------------------------------- @@ -3808,27 +3809,27 @@ startEventExXMLParser(void* data, const char* name, const char** attr) for (int i = 0; attr[i]; i += 2) { std::string attribute = attr[i + 1]; - if (0 == strcmp(attr[i], "head")) { + if (0 == strcmp(attr[i], "vscpHead")) { pex->head = vscp_readStringValue(attribute); - } else if (0 == strcmp(attr[i], "obid")) { + } else if (0 == strcmp(attr[i], "vscpObId")) { pex->obid = vscp_readStringValue(attribute); - } else if (0 == strcmp(attr[i], "datetime")) { + } else if (0 == strcmp(attr[i], "vscpDateTime")) { struct tm tm; memset(&tm, 0, sizeof(tm)); std::string dt = attribute; if (vscp_parseISOCombined(&tm, dt)) { vscp_setEventExDateTime(pex, &tm); } - } else if (0 == strcmp(attr[i], "timestamp")) { + } else if (0 == strcmp(attr[i], "vscpTimeStamp")) { pex->timestamp = vscp_readStringValue(attribute); - } else if (0 == strcmp(attr[i], "class")) { + } else if (0 == strcmp(attr[i], "vscpClass")) { pex->vscp_class = vscp_readStringValue(attribute); - } else if (0 == strcmp(attr[i], "type")) { + } else if (0 == strcmp(attr[i], "vscpType")) { pex->vscp_type = vscp_readStringValue(attribute); - } else if (0 == strcmp(attr[i], "guid")) { + } else if (0 == strcmp(attr[i], "vscpGuid")) { std::string strGUID = attribute; vscp_setEventExGuidFromString(pex, strGUID); - } else if (0 == strcmp(attr[i], "data")) { + } else if (0 == strcmp(attr[i], "vscpData")) { std::string str = attribute; vscp_setEventExDataFromString(pex, str); }