public static void HandleData(object obj) { try { byte[] Datasrc = (byte[])obj; SockPackage SockPackc = new SockPackage(); SockPackc = (SockPackage)BytesToStruct(Datasrc, SockPackc.GetType()); char[] SerialNum = SockPackc.SerialNum; int CameraNum = SerialNum2CameraNum(SerialNum); //if(!System.Convert.ToBoolean(CameraOn[CameraNum])) //{ // CameraOn[CameraNum] = 1; //} if (CameraNum > 0 && CameraNum < 9) { if (OnUsedMemory == 0) { SockPack1[CameraNum] = SockPackc; } else if (OnUsedMemory == 1) { SockPack0[CameraNum] = SockPackc; } //SockPack[CameraNum] = SockPackc; } } catch (System.NullReferenceException) { } return; }
public static void HandleData(object obj) { byte[] Datasrc = (byte[])obj; SockPackage SockPackc = new SockPackage(); SockPackc = (SockPackage)BytesToStruct(Datasrc, SockPackc.GetType()); char[] SerialNum = SockPackc.SerialNum; int CameraNum = SerialNum2CameraNum(SerialNum); if (CameraNum > 0 && CameraNum < 9) { if (OnUsedMemory == 0) { SockPack1[CameraNum] = SockPackc; } else if (OnUsedMemory == 1) { SockPack0[CameraNum] = SockPackc; } //SockPack[CameraNum] = SockPackc; } return; }