Esempio n. 1
0
        public void 退币信号延时检测指令(string Code, string Address)
        {
            RouteInfo route;

            if (GetRouteInfo(Code, out route))
            {
                if (route.IsOnline)
                {
                    Info.HeadInfo.机头绑定信息 bind = new Info.HeadInfo.机头绑定信息();
                    bind.控制器令牌 = Code;
                    bind.短地址   = Address;
                    Info.HeadInfo.机头信息 h = Info.HeadInfo.GetHeadInfoByShort(bind);
                    if (h != null)
                    {
                        FrameData data = new FrameData();
                        data.commandType  = CommandType.远程被动退分解锁指令;
                        data.routeAddress = route.Segment;
                        List <byte> dataList = new List <byte>();
                        dataList.Add((byte)Convert.ToByte(Address, 16));
                        dataList.Add(0x01);
                        byte[] Send = PubLib.GetFrameDataBytes(data, dataList.ToArray(), CommandType.远程被动退分解锁指令);

                        SendData(Send, route.RemotePoint);
                    }
                }
            }
        }
Esempio n. 2
0
        public void 远程投币上分(string Code, string Address, string ICCardID, int Coins)
        {
            RouteInfo route;

            if (GetRouteInfo(Code, out route))
            {
                if (route.IsOnline)
                {
                    Info.HeadInfo.机头绑定信息 bind = new Info.HeadInfo.机头绑定信息();
                    bind.控制器令牌 = Code;
                    bind.短地址   = Address;
                    Info.HeadInfo.机头信息 h = Info.HeadInfo.GetHeadInfoByShort(bind);
                    if (h != null)
                    {
                        h.常规.当前卡片号 = ICCardID;
                        FrameData data = new FrameData();
                        data.commandType  = CommandType.远程投币上分指令;
                        data.routeAddress = route.Segment;
                        List <byte> dataList = new List <byte>();
                        dataList.Add((byte)Convert.ToByte(Address, 16));
                        dataList.AddRange(BitConverter.GetBytes((UInt16)Coins));
                        dataList.AddRange(BitConverter.GetBytes((UInt16)h.远程投币上分流水号));
                        byte[] Send = PubLib.GetFrameDataBytes(data, dataList.ToArray(), CommandType.远程投币上分指令);

                        SendData(Send, route.RemotePoint);
                    }
                }
            }
        }
Esempio n. 3
0
        public void 机头锁定解锁指令(string Code, string Address, bool isLock)
        {
            try
            {
                RouteInfo route;
                if (GetRouteInfo(Code, out route))
                {
                    if (route.IsOnline)
                    {
                        //当前路由器在线
                        FrameData data = new FrameData();
                        data.commandType  = CommandType.机头锁定解锁指令;
                        data.routeAddress = route.Segment;
                        List <byte> dataList = new List <byte>();
                        dataList.Add((byte)Convert.ToByte(Address, 16));
                        dataList.Add((byte)(isLock ? 1 : 0));
                        byte[] Send = PubLib.GetFrameDataBytes(data, dataList.ToArray(), CommandType.机头锁定解锁指令);

                        SendData(Send, route.RemotePoint);
                    }
                }
            }
            catch
            {
                throw;
            }
        }
Esempio n. 4
0
        public void SendConnect()
        {
            FrameData data = new FrameData();

            data.frameType    = FrameType.命令帧;
            data.routeAddress = "0001";

            byte[] sDat = PubLib.GetFrameDataBytes(data, null, CommandType.网络初始化连接);
            SendData(sDat);
        }
Esempio n. 5
0
        public void 指定路由器复位(string Code)
        {
            RouteInfo route;

            if (GetRouteInfo(Code, out route))
            {
                if (route.IsOnline)
                {
                    byte[]    routeBytes = BitConverter.GetBytes(Convert.ToUInt16(route.Segment, 16));
                    FrameData data       = new FrameData();
                    data.commandType  = CommandType.设置路由器地址;
                    data.routeAddress = "FFFF";
                    byte[] Senddata = PubLib.GetFrameDataBytes(data, routeBytes, CommandType.设置路由器地址);

                    SendData(Senddata, route.RemotePoint);
                }
            }
        }
Esempio n. 6
0
        public void 设置机头长地址(string Code, string MCUID)
        {
            RouteInfo route;

            if (GetRouteInfo(Code, out route))
            {
                if (route.IsOnline)
                {
                    List <byte> send = new List <byte>();
                    send.AddRange(PubLib.StringToByte(MCUID));
                    List <byte> sendRe = new List <byte>();
                    //位置调换,低位在前
                    for (int i = send.Count - 1; i >= 0; i--)
                    {
                        sendRe.Add(send[i]);
                    }
                    FrameData data = new FrameData();
                    data.routeAddress = "FFFF";
                    byte[] Senddata = PubLib.GetFrameDataBytes(data, sendRe.ToArray(), CommandType.设置机头长地址);

                    SendData(Senddata, route.RemotePoint);
                }
            }
        }