private async Task InternalSendMessage(Command cmd, DataWriter writer)
{
if(cmd == null)
{
return;
}
if(cmd.Program == GlowPrograms.None)
{
throw new Exception("The program can't be none!");
}
// Serialize the cmd
string cmdJson = Newtonsoft.Json.JsonConvert.SerializeObject(cmd);
UInt32 stringSize = writer.MeasureString(cmdJson);
writer.WriteUInt32(stringSize);
writer.WriteString(cmdJson);
await writer.StoreAsync();
}
}