I am having a problem understanding the syntax of this project. I am trying to deserialize a complex object and things keep getting out of order. I have the code deserializing to the high level "MsgPackMsg" object appropriately. However, the content of "PlcData" is not deserializing appropriately. I am not sure the best practice way of doing this on a nested complex object so an example would be great!!
[MessagePackEnum]
public enum MsgPackMsgType
{
[MessagePackEnumMember]
PlcData,
[MessagePackEnumMember]
LogData,
};
[MessagePackEnum]
public enum PlcDataMsgType
{
[MessagePackEnumMember]
PlcInput,
[MessagePackEnumMember]
PlcOutput
};
[MessagePackEnum]
public enum ZoneStatus
{
[MessagePackEnumMember]
UNKNOWN,
[MessagePackEnumMember]
WARNING,
[MessagePackEnumMember]
SHUTDOWN,
[MessagePackEnumMember]
SAFE
}
public class MsgPackMsg
{
[MessagePackMember(0)]
public UInt64 timestamp;
[MessagePackMember(1)]
public string version;
[MessagePackMember(2)]
public MsgPackMsgType msg_type;
[MessagePackMember(3)]
public PlcData data;
}
public class PlcData
{
[MessagePackMember(0)]
public PlcDataMsgType type;
[MessagePackMember(1)]
public PlcInputData inputs;
[MessagePackMember(2)]
public PlcOutputData outputs;
}
public class PlcInputData
{
[MessagePackMember(0)]
public List<byte> digIn;
[MessagePackMember(1)]
public List<byte> zoneBreach;
[MessagePackMember(2)]
public List<int> algIn;
[MessagePackMember(3)]
public int proxZoneStat;
}
public class PlcOutputData
{
[MessagePackMember(0)]
public List<byte> digOut;
[MessagePackMember(1)]
public List<byte> zoneActivate;
}
I am having a problem understanding the syntax of this project. I am trying to deserialize a complex object and things keep getting out of order. I have the code deserializing to the high level "MsgPackMsg" object appropriately. However, the content of "PlcData" is not deserializing appropriately. I am not sure the best practice way of doing this on a nested complex object so an example would be great!!