mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 11:44:54 +00:00
fix: ignore CameraBase routing port list
The `RoutingPortCollection` type appears to not be currently serializable. If a class that contains this collection is going to be serialized, the collection should have the `JsonIgnore` attribute added. If the list is needed, use a conversion object and convert it to a regular list.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Logging;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using System;
|
||||
@@ -152,11 +153,13 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
message.Name = _device.Name;
|
||||
|
||||
PostStatusMessage(JToken.FromObject(message), MessagePath, clientId);
|
||||
var token = JToken.FromObject(message);
|
||||
|
||||
PostStatusMessage(token, MessagePath, clientId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogMessage(ex, "Exception posting status message", this);
|
||||
this.LogError(ex, "Exception posting status message for {messagePath} to {clientId}", MessagePath, clientId ?? "all clients");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,11 +176,13 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
deviceState.MessageBasePath = MessagePath;
|
||||
|
||||
PostStatusMessage(JToken.FromObject(deviceState), type, clientId);
|
||||
var token = JToken.FromObject(deviceState);
|
||||
|
||||
PostStatusMessage(token, type, clientId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogMessage(ex, "Exception posting status message", this);
|
||||
this.LogError(ex, "Exception posting status message for {type} to {clientId}", type, clientId ?? "all clients");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user