update gate adaptation to pressure management
@@ -404,6 +404,17 @@ void Convert_JsonToMsg(service_t *service, uint16_t id, luos_type_t type, const
msg->header.size = sizeof(control_t);
Luos_SendMsg(service, msg);
}
+ // Pressure
+ item = json_getProperty(jobj, "pressure");
+ if ((item != NULL) && ((json_getType(item) == JSON_REAL) || (json_getType(item) == JSON_INTEGER)))
+ {
+ // this should be a function because it is frequently used
+ data = (float)json_getReal(item);
+ memcpy(msg->data, &data, sizeof(data));
+ msg->header.cmd = PRESSURE;
+ msg->header.size = sizeof(data);
+ Luos_SendMsg(service, msg);
+ }
// Color
item = json_getProperty(jobj, "color");
if ((item != NULL) && (json_getType(item) == JSON_ARRAY))
@@ -1021,9 +1032,9 @@ const char *Convert_StringFromType(luos_type_t type)
case PIPE_TYPE:
return "Pipe";
break;
- /*case PRESSURE_TYPE:
+ case PRESSURE_TYPE:
return "Pressure";
- break;*/
+ break;
default:
return "Unknown";
break;
