Exemplo n.º 1
0
        public bool SetDevParamDevAddr(string devID, Int16 addr)
        {
            SetDevParamReq msg = new SetDevParamReq()
            {
                DevID           = devID.ToCharArray(XDTCPProtocol.Common.MAX_DEV_ID_LEN),
                DevAddr         = addr,
                BackLightEnable = 0,
                ContrastEnable  = 0,
                ControlEnable   = 0,
                DevAddrEnable   = 1,
                ELockEnable     = 0,
                ModelEnable     = 0,
                PasswordEnable  = 0,
                RatioEnable     = 0,
                StationEnable   = 0,
            };

            xd.SendSetDevParam(msg);
            return(true);
        }
Exemplo n.º 2
0
        public bool SetDevParam(string devID,
                                Int16 addr, bool addrEnable,
                                Int16 station, bool stationEnable,
                                bool control, bool controlEnable,
                                byte elock, bool elockEnable,
                                float ratio, bool ratioEnable,
                                string pass, bool passEnable,
                                bool model, bool modelEnable,
                                byte contrast, bool contrastEnable,
                                byte backLight, bool backLightEnable
                                )
        {
            SetDevParamReq msg = new SetDevParamReq()
            {
                DevID     = devID.ToCharArray(XDTCPProtocol.Common.MAX_DEV_ID_LEN),
                DevAddr   = addr,
                Station   = station,
                Control   = (byte)(control?1:0),
                ELock     = elock,
                Ratio     = Convert.ToInt16(ratio * 100),
                Password  = pass.ToCharArray(XDTCPProtocol.Common.MAX_PASSWORD_LEN),
                Model     = (byte)(model?1:0),
                Contrast  = contrast,
                BackLight = backLight,

                BackLightEnable = (byte)(backLightEnable ? 1 : 0),
                ContrastEnable  = (byte)(contrastEnable ? 1 : 0),
                ControlEnable   = (byte)(controlEnable ? 1 : 0),
                DevAddrEnable   = (byte)(addrEnable?1:0),
                ELockEnable     = (byte)(elockEnable ? 1 : 0),
                ModelEnable     = (byte)(modelEnable ? 1 : 0),
                PasswordEnable  = (byte)(passEnable ? 1 : 0),
                RatioEnable     = (byte)(ratioEnable ? 1 : 0),
                StationEnable   = (byte)(stationEnable ? 1 : 0),
            };

            xd.SendSetDevParam(msg);
            return(true);
        }