public static void OnCanMessageReceived(CZCom_MessageType MsgType, short DestAddr, short SourceAddr, short CmdClass, short CmdNbr, short SubNr, short sPID, object vData) { byte[] byteArray = System.Text.Encoding.Default.GetBytes((string)vData); Console.WriteLine("[Main]OnReceivedCANMessage called and vData is {0}", vData); }
public static void OnCanMessageReceived(CZCom_MessageType MsgType, short DestAddr, short SourceAddr, short CmdClass, short CmdNbr, short SubNr, short sPID, IntPtr vData, int vDataLength) { int size = Marshal.SizeOf(typeof(char)); byte[] anotherParray = new byte[vDataLength]; for (int i = 0; i < vDataLength; i++) { anotherParray[i] = (byte)Marshal.PtrToStructure(new IntPtr(vData.ToInt32() + i * size), typeof(byte)); } //Console.WriteLine(vData); //byte[] byteArray = (byte[])vData; //byte[] byteArrayResult = new byte[vDataLength]; //try //{ // Array.Copy(byteArray, byteArrayResult, vDataLength); //} //catch(Exception ex) //{ // Console.WriteLine(ex.ToString()); //} Console.WriteLine("[Main]OnReceivedCANMessage called"); }
public void OnReceivedCANMessage(CZCom_MessageType MsgType, short DestAddr, short SourceAddr, short CmdClass, short CmdNbr, short SubNr, short sPID, object vData) { Console.WriteLine("[Can29]OnReceivedCANMessage called"); }
public static void OnCanServerChanged2(CZCom_MessageType MsgType, short DestAddr, short SourceAddr, short CmdClass, short CmdNbr, short SubNr, short sPID, IntPtr vData, int vDataArray) { Console.WriteLine("OnCanServerChanged 2 called"); }
public static void OnCanMessageReceivedBack(CZCom_MessageType MsgType, short DestAddr, short SourceAddr, short CmdClass, short CmdNbr, short SubNr, short sPID, object vData) { Console.WriteLine("[Main]OnCanMessageReceivedBack called"); }