default payload type return as request
This commit is contained in:
parent
d9931e5605
commit
8dd3f1bdac
24
apitest.json
24
apitest.json
|
|
@ -1,7 +1,9 @@
|
||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"msgid": 123456789,
|
"msgid": 123456789,
|
||||||
"time": "2023-06-03T12:25:24+00:00",
|
"srcid":"0000FFFF",
|
||||||
|
"dstid":"EFCD5174",
|
||||||
|
"time":"2023-10-20T12:56:12+00:00",
|
||||||
"msgtype": 1,
|
"msgtype": 1,
|
||||||
"payloadtype": 1,
|
"payloadtype": 1,
|
||||||
"payload": {
|
"payload": {
|
||||||
|
|
@ -22,4 +24,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"signature": "6a11b872e8f766673eb82e127b6918a0dc96a42c5c9d184604f9787f3d27bcef"
|
"signature": "6a11b872e8f766673eb82e127b6918a0dc96a42c5c9d184604f9787f3d27bcef"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"msgid": 123456789,
|
||||||
|
"srcid":"0000FFFF",
|
||||||
|
"dstid":"EFCD5174",
|
||||||
|
"time":"2023-10-20T12:56:12+00:00",
|
||||||
|
"msgtype": 1,
|
||||||
|
"payloadtype": 1,
|
||||||
|
"payload": {
|
||||||
|
"applytype": 1,
|
||||||
|
"variables": {
|
||||||
|
"exec":"SYSTEM,TEST,ARGS"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"signature": "6a11b872e8f766673eb82e127b6918a0dc96a42c5c9d184604f9787f3d27bcef"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,25 +21,6 @@
|
||||||
* \copyright Apache License, Version 2.0
|
* \copyright Apache License, Version 2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
//Example of SET [msgtype=1] variables [payloadtype=1]
|
|
||||||
{
|
|
||||||
"data":{
|
|
||||||
"msgid":123456789,
|
|
||||||
"time":"2023-06-03T12:25:24+00:00",
|
|
||||||
"msgtype":1,
|
|
||||||
"payloadtype":1,
|
|
||||||
"payload":{
|
|
||||||
"applytype":1,
|
|
||||||
"variables":{
|
|
||||||
"wifi_mode":"",
|
|
||||||
"wifi_sta_ip":"",
|
|
||||||
"wifi_sta_mask":"",
|
|
||||||
}
|
|
||||||
}},
|
|
||||||
"signature":"6a11b872e8f766673eb82e127b6918a0dc96a42c5c9d184604f9787f3d27bcef"}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "webguiapp.h"
|
#include "webguiapp.h"
|
||||||
#include "SystemApplication.h"
|
#include "SystemApplication.h"
|
||||||
#include "mbedtls/md.h"
|
#include "mbedtls/md.h"
|
||||||
|
|
@ -77,7 +58,7 @@ static sys_error_code PayloadDefaultTypeHandler(data_message_t *MSG)
|
||||||
GetRFC3339Time(time);
|
GetRFC3339Time(time);
|
||||||
jwObj_string(&jwc, "time", time);
|
jwObj_string(&jwc, "time", time);
|
||||||
jwObj_int(&jwc, "msgtype", DATA_MESSAGE_TYPE_RESPONSE);
|
jwObj_int(&jwc, "msgtype", DATA_MESSAGE_TYPE_RESPONSE);
|
||||||
jwObj_int(&jwc, "payloadtype", 1);
|
jwObj_int(&jwc, "payloadtype", MSG->parsedData.payloadType);
|
||||||
jwObj_object(&jwc, "payload");
|
jwObj_object(&jwc, "payload");
|
||||||
jwObj_int(&jwc, "applytype", 0);
|
jwObj_int(&jwc, "applytype", 0);
|
||||||
jwObj_object(&jwc, "variables");
|
jwObj_object(&jwc, "variables");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user