From 934b7cf27d712000cf9221943f0ca5c40ed05d08 Mon Sep 17 00:00:00 2001
From: florian <f.spreckelsen@inidscale.com>
Date: Thu, 12 Aug 2021 18:27:37 +0200
Subject: [PATCH] ENH: Add missing imlementations of message code and
 description

---
 src/ccaosdb.cpp | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/ccaosdb.cpp b/src/ccaosdb.cpp
index 24a21c1..c48d346 100644
--- a/src/ccaosdb.cpp
+++ b/src/ccaosdb.cpp
@@ -747,6 +747,27 @@ CAOSDB_PROPERTY_GET(datatype,
 CAOSDB_PROPERTY_GET(unit, strcpy(out, wrapped_property->GetUnit().c_str());)
 CAOSDB_PROPERTY_GET(value, strcpy(out, wrapped_property->GetValue().c_str());)
 
+ERROR_RETURN_CODE(
+  GENERIC_ERROR,
+  int caosdb_entity_message_get_code(caosdb_entity_message *message, int *out),
+  {
+    auto *wrapped_message =
+      static_cast<caosdb::entity::Message *>(message->wrapped_message);
+    *out = wrapped_message->GetCode();
+    return 0;
+  })
+
+ERROR_RETURN_CODE(
+  GENERIC_ERROR,
+  int caosdb_entity_message_get_description(caosdb_entity_message *message,
+                                            char *out),
+  {
+    auto *wrapped_message =
+      static_cast<caosdb::entity::Message *>(message->wrapped_message);
+    strcpy(out, wrapped_message->GetDescription().c_str());
+    return 0;
+  })
+
 CAOSDB_ENTITY_SET(role, role, wrapped_entity->SetRole(std::string(role));)
 CAOSDB_ENTITY_SET(name, name, wrapped_entity->SetName(std::string(name));)
 CAOSDB_ENTITY_SET(description, description,
-- 
GitLab