diff --git a/src/c/config.c b/src/c/config.c index 093f7028..e093d164 100644 --- a/src/c/config.c +++ b/src/c/config.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2022 + * Copyright (c) 2018-2023 * IoTech Ltd * * SPDX-License-Identifier: Apache-2.0 @@ -87,7 +87,6 @@ iot_data_t *edgex_config_defaults (const iot_data_t *driverconf, const char *svc iot_data_string_map_add (result, "Service/CORSConfiguration/CORSMaxAge", iot_data_alloc_ui32 (3600)); iot_data_string_map_add (result, "Device/Labels", iot_data_alloc_string ("", IOT_DATA_REF)); - iot_data_string_map_add (result, "Device/UseMessageBus", iot_data_alloc_bool (false)); iot_data_string_map_add (result, "Device/ProfilesDir", iot_data_alloc_string ("", IOT_DATA_REF)); iot_data_string_map_add (result, "Device/DevicesDir", iot_data_alloc_string ("", IOT_DATA_REF)); iot_data_string_map_add (result, "Device/EventQLength", iot_data_alloc_ui32 (0)); @@ -312,10 +311,8 @@ void edgex_device_parseTomlClients { if (clients) { - parseClient (lc, toml_table_in (clients, "core-data"), &endpoints->data, err); parseClient (lc, toml_table_in (clients, "core-metadata"), &endpoints->metadata, err); } - checkClientOverride (lc, "CORE_DATA", &endpoints->data); checkClientOverride (lc, "CORE_METADATA", &endpoints->metadata); } @@ -696,7 +693,6 @@ void edgex_device_freeConfig (devsdk_service_t *svc) free (svc->config.service.labels); } - free (svc->config.endpoints.data.host); free (svc->config.endpoints.metadata.host); iot_data_free (svc->config.sdkconf); @@ -745,7 +741,6 @@ static JSON_Value *edgex_device_config_toJson (devsdk_service_t *svc) json_object_set_boolean (dobj, "UpdateLastConnected", svc->config.device.updatelastconnected); json_object_set_uint (dobj, "EventQLength", svc->config.device.eventqlen); - json_object_set_boolean (dobj, "UseMessageBus", iot_data_string_map_get_bool (svc->config.sdkconf, "Device/UseMessageBus", false)); JSON_Value *lval = json_value_init_array (); JSON_Array *larr = json_value_get_array (lval); @@ -781,12 +776,6 @@ static JSON_Value *edgex_device_config_toJson (devsdk_service_t *svc) json_object_set_uint (mobj, "Port", svc->config.endpoints.metadata.port); json_object_set_value (cobj, "Metadata", mval); - dval = json_value_init_object (); - dobj = json_value_get_object (dval); - json_object_set_string (dobj, "Host", svc->config.endpoints.data.host); - json_object_set_uint (dobj, "Port", svc->config.endpoints.data.port); - json_object_set_value (cobj, "Data", dval); - json_object_set_value (obj, "Clients", cval); mval = json_value_init_object (); diff --git a/src/c/config.h b/src/c/config.h index 47c08541..b8a2975b 100644 --- a/src/c/config.h +++ b/src/c/config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 + * Copyright (c) 2018-2023 * IoTech Ltd * * SPDX-License-Identifier: Apache-2.0 @@ -42,7 +42,6 @@ typedef struct edgex_device_service_endpoint typedef struct edgex_service_endpoints { - edgex_device_service_endpoint data; edgex_device_service_endpoint metadata; } edgex_service_endpoints; diff --git a/src/c/data-rest.c b/src/c/data-rest.c deleted file mode 100644 index fd39ba80..00000000 --- a/src/c/data-rest.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2021 - * IoTech Ltd - * - * SPDX-License-Identifier: Apache-2.0 - * - */ - -#include "data-rest.h" -#include "rest.h" -#include "errorlist.h" - -static void edc_rest_postfn (iot_logger_t *lc, void *address, edgex_event_cooked *event) -{ - edgex_ctx ctx; - const char *baseurl = (const char *)address; - devsdk_error err = EDGEX_OK; - - memset (&ctx, 0, sizeof (edgex_ctx)); - - char *url = malloc (strlen (baseurl) + strlen (event->path) + 1); - strcpy (url, baseurl); - strcat (url, event->path); - switch (event->encoding) - { - case JSON: - { - edgex_http_post (lc, &ctx, url, event->value.json, NULL, &err); - break; - } - case CBOR: - { - edgex_http_postbin (lc, &ctx, url, event->value.cbor.data, event->value.cbor.length, CONTENT_CBOR, NULL, &err); - break; - } - } - edgex_event_cooked_free (event); - free (url); -} - -static void edc_rest_freefn (iot_logger_t *lc, void *address) -{ - free (address); -} - -edgex_data_client_t *edgex_data_client_new_rest (const edgex_device_service_endpoint *e, iot_logger_t *lc, iot_threadpool_t *queue) -{ - edgex_data_client_t *result = malloc (sizeof (edgex_data_client_t)); - result->lc = lc; - result->queue = queue; - result->pf = edc_rest_postfn; - result->ff = edc_rest_freefn; - result->mf = NULL; - char *url = malloc (URL_BUF_SIZE); - snprintf (url, URL_BUF_SIZE - 1, "http://%s:%u/api/v2/event/", e->host, e->port); - result->address = url; - iot_log_info (lc, "Event data will be posted to core-data at %s//", url); - return result; -} diff --git a/src/c/data-rest.h b/src/c/data-rest.h deleted file mode 100644 index 06acf0fc..00000000 --- a/src/c/data-rest.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2021 - * IoTech Ltd - * - * SPDX-License-Identifier: Apache-2.0 - * - */ - -#ifndef _EDGEX_DEVICE_DATA_REST_H_ -#define _EDGEX_DEVICE_DATA_REST_H_ 1 - -#include "data.h" -#include "config.h" - -edgex_data_client_t *edgex_data_client_new_rest (const edgex_device_service_endpoint *e, iot_logger_t *lc, iot_threadpool_t *queue); - -#endif diff --git a/src/c/data.h b/src/c/data.h index 58b2715c..99a00772 100644 --- a/src/c/data.h +++ b/src/c/data.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 + * Copyright (c) 2018-2023 * IoTech Ltd * * SPDX-License-Identifier: Apache-2.0 @@ -84,8 +84,6 @@ typedef struct edgex_data_client_t typedef struct edgex_device_service_endpoint edgex_device_service_endpoint; -edgex_data_client_t *edgex_data_client_new_rest (const edgex_device_service_endpoint *e, iot_logger_t *lc, iot_threadpool_t *queue); - void edgex_data_client_free (edgex_data_client_t *client); void edgex_data_client_add_event (edgex_data_client_t *client, edgex_event_cooked *eventval, devsdk_metrics_t *metrics); diff --git a/src/c/examples/bitfields/res/configuration.toml b/src/c/examples/bitfields/res/configuration.toml index c7180506..12fe64f0 100644 --- a/src/c/examples/bitfields/res/configuration.toml +++ b/src/c/examples/bitfields/res/configuration.toml @@ -11,10 +11,6 @@ HealthCheckInterval = "10s" [Clients] - [Clients.core-data] - Host = "localhost" - Port = 59880 - [Clients.core-metadata] Host = "localhost" Port = 59881 @@ -23,3 +19,21 @@ Labels = [ "Bitfields" ] ProfilesDir = "res/profiles" DevicesDir = "res/devices" + +[MessageBus] + Protocol = "redis" + Host = "localhost" + Port = 6379 + Type = "redis" + AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure) + SecretName = "redisdb" + [MessageBus.Optional] + ClientId = "device-bitfields" + Qos = 0 # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once) + KeepAlive = 10 # Seconds (must be 2 or greater) + Retained = false + SkipCertVerify = false + [MessageBus.Topics] + PublishTopicPrefix = "edgex/events/device" # /// will be added to this Publish Topic prefix + CommandRequestTopic = "edgex/device/command/request/device-bacnet/#" # subscribing for inbound command requests + CommandResponseTopicPrefix = "edgex/device/command/response" # publishing outbound command responses; /// will be added to this publish topic prefix diff --git a/src/c/examples/counters/res/configuration.toml b/src/c/examples/counters/res/configuration.toml index e072466a..baccaaaf 100644 --- a/src/c/examples/counters/res/configuration.toml +++ b/src/c/examples/counters/res/configuration.toml @@ -11,10 +11,6 @@ HealthCheckInterval = "10s" [Clients] - [Clients.core-data] - Host = "localhost" - Port = 59880 - [Clients.core-metadata] Host = "localhost" Port = 59881 @@ -23,3 +19,21 @@ Labels = [ "Counter" ] ProfilesDir = "res/profiles" DevicesDir = "res/devices" + +[MessageBus] + Protocol = "redis" + Host = "localhost" + Port = 6379 + Type = "redis" + AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure) + SecretName = "redisdb" + [MessageBus.Optional] + ClientId = "device-counters" + Qos = 0 # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once) + KeepAlive = 10 # Seconds (must be 2 or greater) + Retained = false + SkipCertVerify = false + [MessageBus.Topics] + PublishTopicPrefix = "edgex/events/device" # /// will be added to this Publish Topic prefix + CommandRequestTopic = "edgex/device/command/request/device-bacnet/#" # subscribing for inbound command requests + CommandResponseTopicPrefix = "edgex/device/command/response" # publishing outbound command responses; /// will be added to this publish topic prefix diff --git a/src/c/examples/discovery/res/configuration.toml b/src/c/examples/discovery/res/configuration.toml index a783cb16..0daa45c9 100644 --- a/src/c/examples/discovery/res/configuration.toml +++ b/src/c/examples/discovery/res/configuration.toml @@ -14,10 +14,6 @@ HealthCheckInterval = "10s" [Clients] - [Clients.core-data] - Host = "localhost" - Port = 59880 - [Clients.core-metadata] Host = "localhost" Port = 59881 @@ -30,3 +26,21 @@ Labels = [ "Template" ] ProfilesDir = "res/profiles" DevicesDir = "res/devices" + +[MessageBus] + Protocol = "redis" + Host = "localhost" + Port = 6379 + Type = "redis" + AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure) + SecretName = "redisdb" + [MessageBus.Optional] + ClientId = "device-discovery" + Qos = 0 # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once) + KeepAlive = 10 # Seconds (must be 2 or greater) + Retained = false + SkipCertVerify = false + [MessageBus.Topics] + PublishTopicPrefix = "edgex/events/device" # /// will be added to this Publish Topic prefix + CommandRequestTopic = "edgex/device/command/request/device-bacnet/#" # subscribing for inbound command requests + CommandResponseTopicPrefix = "edgex/device/command/response" # publishing outbound command responses; /// will be added to this publish topic prefix diff --git a/src/c/examples/file/res/configuration.toml b/src/c/examples/file/res/configuration.toml index d4081b65..fe433da3 100644 --- a/src/c/examples/file/res/configuration.toml +++ b/src/c/examples/file/res/configuration.toml @@ -2,10 +2,6 @@ LogLevel = "DEBUG" [Clients] - [Clients.core-data] - Host = "localhost" - Port = 59880 - [Clients.core-metadata] Host = "localhost" Port = 59881 @@ -13,3 +9,21 @@ [Device] ProfilesDir = "res/profiles" DevicesDir = "res/devices" + +[MessageBus] + Protocol = "redis" + Host = "localhost" + Port = 6379 + Type = "redis" + AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure) + SecretName = "redisdb" + [MessageBus.Optional] + ClientId = "device-file" + Qos = 0 # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once) + KeepAlive = 10 # Seconds (must be 2 or greater) + Retained = false + SkipCertVerify = false + [MessageBus.Topics] + PublishTopicPrefix = "edgex/events/device" # /// will be added to this Publish Topic prefix + CommandRequestTopic = "edgex/device/command/request/device-bacnet/#" # subscribing for inbound command requests + CommandResponseTopicPrefix = "edgex/device/command/response" # publishing outbound command responses; /// will be added to this publish topic prefix diff --git a/src/c/examples/gyro/res/configuration.toml b/src/c/examples/gyro/res/configuration.toml index c19f7c4f..57e6c636 100644 --- a/src/c/examples/gyro/res/configuration.toml +++ b/src/c/examples/gyro/res/configuration.toml @@ -11,10 +11,6 @@ HealthCheckInterval = "10s" [Clients] - [Clients.core-data] - Host = "localhost" - Port = 59880 - [Clients.core-metadata] Host = "localhost" Port = 59881 @@ -23,3 +19,21 @@ Labels = [ "Gyro" ] ProfilesDir = "res/profiles" DevicesDir = "res/devices" + +[MessageBus] + Protocol = "redis" + Host = "localhost" + Port = 6379 + Type = "redis" + AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure) + SecretName = "redisdb" + [MessageBus.Optional] + ClientId = "device-gyro" + Qos = 0 # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once) + KeepAlive = 10 # Seconds (must be 2 or greater) + Retained = false + SkipCertVerify = false + [MessageBus.Topics] + PublishTopicPrefix = "edgex/events/device" # /// will be added to this Publish Topic prefix + CommandRequestTopic = "edgex/device/command/request/device-bacnet/#" # subscribing for inbound command requests + CommandResponseTopicPrefix = "edgex/device/command/response" # publishing outbound command responses; /// will be added to this publish topic prefix diff --git a/src/c/examples/random/res/configuration.toml b/src/c/examples/random/res/configuration.toml index 575742f6..9aadcce2 100644 --- a/src/c/examples/random/res/configuration.toml +++ b/src/c/examples/random/res/configuration.toml @@ -12,10 +12,6 @@ ServerBindAddr = "0.0.0.0" # Empty defaults to listen to Host address. In case listen to all put 0.0.0.0 instead [Clients] - [Clients.core-data] - Host = "localhost" - Port = 59880 - [Clients.core-metadata] Host = "localhost" Port = 59881 @@ -24,3 +20,21 @@ Labels = [ "Random" ] ProfilesDir = "res/profiles" DevicesDir = "res/devices" + +[MessageBus] + Protocol = "redis" + Host = "localhost" + Port = 6379 + Type = "redis" + AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure) + SecretName = "redisdb" + [MessageBus.Optional] + ClientId = "device-random" + Qos = 0 # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once) + KeepAlive = 10 # Seconds (must be 2 or greater) + Retained = false + SkipCertVerify = false + [MessageBus.Topics] + PublishTopicPrefix = "edgex/events/device" # /// will be added to this Publish Topic prefix + CommandRequestTopic = "edgex/device/command/request/device-bacnet/#" # subscribing for inbound command requests + CommandResponseTopicPrefix = "edgex/device/command/response" # publishing outbound command responses; /// will be added to this publish topic prefix diff --git a/src/c/examples/res/configuration.toml b/src/c/examples/res/configuration.toml index be8b4848..9e023802 100644 --- a/src/c/examples/res/configuration.toml +++ b/src/c/examples/res/configuration.toml @@ -15,10 +15,6 @@ HealthCheckInterval = "10s" [Clients] - [Clients.core-data] - Host = "localhost" - Port = 59880 - [Clients.core-metadata] Host = "localhost" Port = 59881 @@ -30,3 +26,21 @@ Labels = [ "Template" ] ProfilesDir = "res/profiles" DevicesDir = "res/devices" + +[MessageBus] + Protocol = "redis" + Host = "localhost" + Port = 6379 + Type = "redis" + AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure) + SecretName = "redisdb" + [MessageBus.Optional] + ClientId = "device-template" + Qos = 0 # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once) + KeepAlive = 10 # Seconds (must be 2 or greater) + Retained = false + SkipCertVerify = false + [MessageBus.Topics] + PublishTopicPrefix = "edgex/events/device" # /// will be added to this Publish Topic prefix + CommandRequestTopic = "edgex/device/command/request/device-bacnet/#" # subscribing for inbound command requests + CommandResponseTopicPrefix = "edgex/device/command/response" # publishing outbound command responses; /// will be added to this publish topic prefix diff --git a/src/c/examples/terminal/res/configuration.toml b/src/c/examples/terminal/res/configuration.toml index f4b59068..99d8f332 100644 --- a/src/c/examples/terminal/res/configuration.toml +++ b/src/c/examples/terminal/res/configuration.toml @@ -11,10 +11,6 @@ HealthCheckInterval = "10s" [Clients] - [Clients.core-data] - Host = "localhost" - Port = 59880 - [Clients.core-metadata] Host = "localhost" Port = 59881 @@ -23,3 +19,21 @@ Labels = [ "Counter" ] ProfilesDir = "res/profiles" DevicesDir = "res/devices" + +[MessageBus] + Protocol = "redis" + Host = "localhost" + Port = 6379 + Type = "redis" + AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure) + SecretName = "redisdb" + [MessageBus.Optional] + ClientId = "device-terminal" + Qos = 0 # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once) + KeepAlive = 10 # Seconds (must be 2 or greater) + Retained = false + SkipCertVerify = false + [MessageBus.Topics] + PublishTopicPrefix = "edgex/events/device" # /// will be added to this Publish Topic prefix + CommandRequestTopic = "edgex/device/command/request/device-bacnet/#" # subscribing for inbound command requests + CommandResponseTopicPrefix = "edgex/device/command/response" # publishing outbound command responses; /// will be added to this publish topic prefix diff --git a/src/c/metrics.c b/src/c/metrics.c deleted file mode 100644 index 5bb98b34..00000000 --- a/src/c/metrics.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2019-2022 - * IoTech Ltd - * - * SPDX-License-Identifier: Apache-2.0 - * - */ - -#include "metrics.h" -#include "edgex2.h" -#include "edgex-rest.h" -#include "parson.h" -#include "service.h" -#include "iot/time.h" - -#include -#include - -#ifdef __GNU_LIBRARY__ -#include -#include -#endif - -#include - -static void edgex_metrics_populate (edgex_metricsresponse *m, uint64_t starttime, const char *name) -{ - struct rusage rstats; -#ifdef __GNU_LIBRARY__ - double loads[1]; -#if (__GLIBC__ * 100 + __GLIBC_MINOR__) >= 233 - struct mallinfo2 mi = mallinfo2 (); -#else - struct mallinfo mi = mallinfo (); -#endif - m->alloc = mi.uordblks; - m->totalloc = mi.arena + mi.hblkhd; - if (getloadavg (loads, 1) == 1) - { - m->loadavg = loads[0] * 100.0 / get_nprocs(); - } -#endif - if (getrusage (RUSAGE_SELF, &rstats) == 0) - { - double walltime = (double)(iot_time_msecs() - starttime) / 1e3; - double cputime = rstats.ru_utime.tv_sec + rstats.ru_stime.tv_sec; - cputime += (double)(rstats.ru_utime.tv_usec + rstats.ru_stime.tv_usec) / 1e6; - m->cputime = cputime; - m->cpuavg = cputime / walltime; - } - m->svcname = name; -} - -void edgex_device_handler_metricsv2 (void *ctx, const devsdk_http_request *req, devsdk_http_reply *reply) -{ - devsdk_service_t *svc = (devsdk_service_t *)ctx; - edgex_metricsresponse mr; - memset (&mr, 0, sizeof (mr)); - - edgex_baseresponse_populate ((edgex_baseresponse *)&mr, "v2", MHD_HTTP_OK, NULL); - edgex_metrics_populate (&mr, svc->starttime, svc->name); - - edgex_metricsresponse_write (&mr, reply); -} diff --git a/src/c/metrics.h b/src/c/metrics.h index 0c9aac2b..b11776f0 100644 --- a/src/c/metrics.h +++ b/src/c/metrics.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 + * Copyright (c) 2019-2023 * IoTech Ltd * * SPDX-License-Identifier: Apache-2.0 @@ -10,9 +10,6 @@ #define _EDGEX_DEVICE_METRICS_H_ 1 #include -#include "rest-server.h" - -extern void edgex_device_handler_metricsv2 (void *ctx, const devsdk_http_request *req, devsdk_http_reply *reply); typedef struct devsdk_metrics_t { diff --git a/src/c/service.c b/src/c/service.c index 4f4c5f17..59ffa490 100644 --- a/src/c/service.c +++ b/src/c/service.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2022 + * Copyright (c) 2018-2023 * IoTech Ltd * * SPDX-License-Identifier: Apache-2.0 @@ -12,7 +12,6 @@ #include "device.h" #include "discovery.h" #include "callback2.h" -#include "metrics.h" #include "validate.h" #include "errorlist.h" #include "rest-server.h" @@ -549,41 +548,28 @@ static void startConfigured (devsdk_service_t *svc, const devsdk_timeout *deadli svc->eventq = iot_threadpool_alloc (1, svc->config.device.eventqlen, IOT_THREAD_NO_PRIORITY, IOT_THREAD_NO_AFFINITY, svc->logger); iot_threadpool_start (svc->eventq); - /* Wait for metadata and data to be available */ + // Initialize MessageBus client - if (iot_data_string_map_get_bool (svc->config.sdkconf, "Device/UseMessageBus", false)) + const char *bustype = iot_data_string_map_get_string (svc->config.sdkconf, EX_BUS_TYPE); + if (strcmp (bustype, "mqtt") == 0) { - const char *bustype = iot_data_string_map_get_string (svc->config.sdkconf, EX_BUS_TYPE); - if (strcmp (bustype, "mqtt") == 0) - { - svc->dataclient = edgex_data_client_new_mqtt (svc, deadline, svc->eventq); - } - else if (strcmp (bustype, "redis") == 0) - { - svc->dataclient = edgex_data_client_new_redstr (svc, deadline, svc->eventq); - } - else - { - iot_log_error (svc->logger, "Unknown Message Bus type %s", bustype); - } - if (svc->dataclient == NULL) - { - *err = EDGEX_REMOTE_SERVER_DOWN; - return; - } + svc->dataclient = edgex_data_client_new_mqtt (svc, deadline, svc->eventq); + } + else if (strcmp (bustype, "redis") == 0) + { + svc->dataclient = edgex_data_client_new_redstr (svc, deadline, svc->eventq); } else { - if (svc->registry) - { - devsdk_registry_query_service (svc->registry, "core-data", &svc->config.endpoints.data.host, &svc->config.endpoints.data.port, deadline, err); - } - if (err->code || !ping_client (svc->logger, "core-data", &svc->config.endpoints.data, deadline, err)) - { - return; - } - svc->dataclient = edgex_data_client_new_rest (&svc->config.endpoints.data, svc->logger, svc->eventq); + iot_log_error (svc->logger, "Unknown Message Bus type %s", bustype); } + if (svc->dataclient == NULL) + { + *err = EDGEX_REMOTE_SERVER_DOWN; + return; + } + + /* Wait for core-metadata to be available */ if (!ping_client (svc->logger, "core-metadata", &svc->config.endpoints.metadata, deadline, err)) { @@ -771,8 +757,6 @@ static void startConfigured (devsdk_service_t *svc, const devsdk_timeout *deadli edgex_rest_server_register_handler (svc->daemon, EDGEX_DEV_API2_DISCOVERY, DevSDK_Post, svc, edgex_device_handler_discoveryv2); - edgex_rest_server_register_handler (svc->daemon, EDGEX_DEV_API2_METRICS, DevSDK_Get, svc, edgex_device_handler_metricsv2); - edgex_rest_server_register_handler (svc->daemon, EDGEX_DEV_API2_CONFIG, DevSDK_Get, svc, edgex_device_handler_configv2); edgex_rest_server_register_handler (svc->daemon, EDGEX_DEV_API2_SECRET, DevSDK_Post, svc, edgex_device_handler_secret); diff --git a/src/c/service.h b/src/c/service.h index 17247407..afa52107 100644 --- a/src/c/service.h +++ b/src/c/service.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2022 + * Copyright (c) 2018-2023 * IoTech Ltd * * SPDX-License-Identifier: Apache-2.0 @@ -10,7 +10,6 @@ #define _EDGEX_DEVICE_SERVICE_H_ 1 #include "devsdk/devsdk.h" -#include "metrics.h" #include "registry.h" #include "config.h" #include "data.h"