szaszm commented on a change in pull request #674: Minificpp 1007 - ECU C2 
integration.
URL: https://github.com/apache/nifi-minifi-cpp/pull/674#discussion_r371962298
 
 

 ##########
 File path: nanofi/src/coap/c2payload.c
 ##########
 @@ -0,0 +1,701 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <ecu_api/ecuapi.h>
+#include <coap/c2payload.h>
+#include <stdio.h>
+
+typedef enum {
+    TYPE,
+    NAME,
+    INPUT,
+    OUTPUT,
+    IDENTIFIER,
+    DISPLAYNAME,
+    DESCRIPTION,
+    VALIDATOR,
+    SENSITIVE,
+    DYNAMIC,
+    REQUIRED,
+    PROPERTIES,
+    VERSION,
+    STATUS,
+    DEVICEINFO,
+    SYSTEMFINO,
+    MACHINEARCH,
+    VCORES,
+    PHYSICALMEMORYBYTES,
+    NETWORKINFO,
+    HOSTNAME,
+    IPADDRESS,
+    AGENTINFO,
+    AGENTCLASS,
+    UPTIME,
+    AGENTMANIFEST,
+    AGENTTYPE,
+    IOMANIFEST,
+    PROPERTYDESCRIPTORS,
+    ECUINFO,
+    OPERATION,
+    OPERAND,
+    FILEPATH,
+    CHUNKSIZEBYTES,
+    DELIMITER,
+    TAILFREQMILLISECONDS,
+    TCPPORT,
+    NIFIPORT,
+    REQUESTEDOPERATIONS
+} c2_keys_t;
+
+value_t value_uint8(uint8_t value) {
+    value_t val;
+    memset(&val, 0, sizeof(value_t));
+    val.v_uint8 = value;
+    val.val_type = UINT8_TYPE;
+    return val;
+}
+
+value_t value_uint16(uint16_t value) {
+    value_t val;
+    memset(&val, 0, sizeof(value_t));
+    val.v_uint16 = value;
+    val.val_type = UINT16_TYPE;
+    return val;
+}
+
+value_t value_uint32(uint32_t value) {
+    value_t val;
+    memset(&val, 0, sizeof(value_t));
+    val.v_uint32 = value;
+    val.val_type = UINT32_TYPE;
+    return val;
+}
+
+value_t value_uint64(uint64_t value) {
+    value_t val;
+    memset(&val, 0, sizeof(value_t));
+    val.v_uint64 = value;
+    val.val_type = UINT64_TYPE;
+    return val;
+}
+
+value_t value_string(const char * value) {
+    value_t val;
+    memset(&val, 0, sizeof(value_t));
+    copystr(value, &val.v_str);
 
 Review comment:
   `copystr` is undeclared. Add `#include "core/string_utils.h"`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to