Exemplo n.º 1
0
 public static void InitTransmit()
 {
     if (!inited)
     {
         HD_Transmit.Init();
         inited = true;
     }
 }
Exemplo n.º 2
0
        public void ResetInstance()
        {
            if (transmitInstance == System.IntPtr.Zero)
            {
                transmitInstance = HD_Transmit.CreateSendInstance(HdTransmitTool.sCallback, ptr);

                if (transmitInstance == IntPtr.Zero)
                {
                    Console.WriteLine("CreateSendInstance failed!");
                }

                HD_Transmit.InitSendInstance(transmitInstance, null, ip);
            }
        }
Exemplo n.º 3
0
        public void Send(string ip, byte[] buffer, bool transFile)
        {
            HdTransmitObj trans;

            if (GetTransmitObjFromIP(ip, out trans))
            {
                trans.semaphore.WaitOne();
                //trans = new HdTransmitObj(ip);
            }
            trans.time = DateTime.Now;
            Console.WriteLine(">>" + ip + " : " + trans.time.ToString("HH:mm:ss.fff"));
            HD_Transmit.SendExternCmdBuff(trans.transmitInstance, buffer, buffer.Length, transFile);
            //HD_Transmit.SirenClose(trans.transmitInstance);
        }
Exemplo n.º 4
0
        public void Send(String ip, String file, bool transFile)
        {
            HdTransmitObj trans;

            if (GetTransmitObjFromIP(ip, out trans))
            {
                trans.semaphore.WaitOne();
                //trans = new HdTransmitObj(ip);
            }

            //trans.semaphore.WaitOne();
            trans.time = DateTime.Now;
            HD_Transmit.SendExternCmd(trans.transmitInstance, file, transFile);
            //sTransObjs.Add(trans);

            Console.WriteLine(">>" + ip);
        }
Exemplo n.º 5
0
        public void SendCommand(string ip, string cmd)
        {
            HdTransmitObj trans;

            if (GetTransmitObjFromIP(ip, out trans))
            {
                trans.semaphore.WaitOne();
                //trans = new HdTransmitObj(ip);
            }

            //trans.semaphore.WaitOne();
            trans.time = DateTime.Now;
            switch (cmd)
            {
            case "GreenLightsOn":
                HD_Transmit.GreenLightsOn(trans.transmitInstance);
                break;

            case "GreenLightsOff":
                HD_Transmit.GreenLightsOff(trans.transmitInstance);
                break;

            case "RedLightsOn":
                HD_Transmit.RedLightsOn(trans.transmitInstance);
                break;

            case "RedLightsOff":
                HD_Transmit.RedLightsOff(trans.transmitInstance);
                break;

            case "SirenOpen":
                HD_Transmit.SirenOpen(trans.transmitInstance);
                break;

            default:
                HD_Transmit.SirenClose(trans.transmitInstance);
                break;
            }

            //sTransObjs.Add(trans);

            Console.WriteLine(">>" + ip + " : " + cmd);
        }
Exemplo n.º 6
0
 private HdTransmitTool()
 {
     HD_Transmit.InitTransmit();
 }