public void UpdateCheckInstruction(object receiver, MessageDecodedArgs e) { informationReceived = ((ushort)(Commands)e.MsgFunction); if (informationReceived != informationSent) { TextBoxReception.Text += "/!\\ WARNING : Information Sent Corrupted /!\\"; } }
static public void OnPrintDecodedMessage(object sender, MessageDecodedArgs e) { ResetConsoleCursorAndConsoleColor(); ConvertMessageToByte(e.MsgFunction, e.MsgPayloadLength); Console.Write("[Decoded : " + hex_receiver_index++ + "] : "); Console.ForegroundColor = ConsoleColor.Yellow; Console.Write("0x" + msgFunctionMSB.ToString("2X") + " " + "0x" + msgFunctionLSB.ToString("2X") + " "); Console.ForegroundColor = ConsoleColor.Blue; Console.Write("0x" + msgPayloadLenghtMSB.ToString("2X") + " 0x" + msgPayloadLenghtLSB.ToString("2X") + " "); Console.ForegroundColor = ConsoleColor.White; for (int poss = 0, max = e.MsgPayload.Length - 1; poss < max; poss++) { Console.Write("0x" + e.MsgPayload[poss].ToString("2x") + " "); } if (e.ChecksumCorrect) { Console.ForegroundColor = ConsoleColor.Green; } else { Console.ForegroundColor = ConsoleColor.Red; } Console.Write("0x" + e.MsgPayload[e.MsgPayload.Length].ToString("2x")); }
//Input CallBack public void ProcessRobotDecodedMessage(object sender, MessageDecodedArgs e) { ProcessDecodedMessage((Int16)e.MsgFunction, (Int16)e.MsgPayloadLength, e.MsgPayload); }
public void DisplayMessageDecodedError(object sender, MessageDecodedArgs e) { nbMsgReceivedErrors += 1; }
public void MessageDecodedErrorCB(object sender, MessageDecodedArgs e) { nbMsgReceivedErrors += 1; }