Is it possible to serialize a dictionary using protobuf?
At a high level, I have a function written using Lua that contains a table:
function DM()
config = {
stop_sign = 0.60,
traffic_signal = 0.80
}
UDC:publishAIMLConfig("config")
UDC:aimlEventImageDataReq('aimldatacollection',1,priorityLevel,cameraID,resolution,1,5,5,uplink)
end
On C#, I have a function that it is receiving the values from the table and storing them into a Dictionary of type <object, object> and printing them out. But what I really would like to do is receive these values, serialize them and send it via MQTT to another application.
public void publishAIMLConfig(string inputTable)
{
LuaTable tb = Form1.state.GetTable(inputTable);
Dictionary<object, object> dict = Form1.state.GetTableDict(tb);
foreach (KeyValuePair<object, object> de in dict)
{
Console.WriteLine("{0} {1}", de.Key.ToString(), de.Value.ToString());
}
}
Q: is there a way to serialize objects inside the C# dictionary and if so, how would the proto file looks like?