connectionmanager: add deviceId to getConnectionList

Change-Id: I20a08723ae90cb8daf1b35bf7cbbea44ef067dca
diff --git a/include/connectionmanager.h b/include/connectionmanager.h
index ae08212..b03c345 100644
--- a/include/connectionmanager.h
+++ b/include/connectionmanager.h
@@ -221,7 +221,8 @@
      * Note: The connections are represented as maps with string keys and string values. The map
      *       contains the following key-value pairs:
      *       - "id": The unique identifier of the connection.
-     *       - "userUri": The user URI associated with the connection (if available).
+     *       - "peer": The contact URI associated with the connection (if available).
+     *       - "device": The device URI associated with the connection.
      *       - "status": The status of the connection, represented as an integer:
      *                   - 0: ConnectionStatus::Connected
      *                   - 1: ConnectionStatus::TLS
diff --git a/src/connectionmanager.cpp b/src/connectionmanager.cpp
index 9fda75c..9134bd9 100644
--- a/src/connectionmanager.cpp
+++ b/src/connectionmanager.cpp
@@ -1783,9 +1783,11 @@
             continue;
         std::map<std::string, std::string> connectionInfo;
         connectionInfo["id"] = callbackIdToString(key.first, key.second);
-        if (ci->tls_ && ci->tls_->peerCertificate()) {
-            auto cert = ci->tls_->peerCertificate();
-            connectionInfo["userUri"] = cert->issuer->getId().toString();
+        connectionInfo["device"] = key.first;
+        if (ci->tls_) {
+            if (auto cert = ci->tls_->peerCertificate()) {
+                connectionInfo["peer"] = cert->issuer->getId().toString();
+            }
         }
         if (ci->socket_) {
             connectionInfo["status"] = std::to_string(static_cast<int>(ConnectionStatus::Connected));