Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        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");
        }
Esempio n. 3
0
 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");
 }
Esempio n. 4
0
 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");
 }
Esempio n. 5
0
 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");
 }