Exemple #1
0
 public void SendRequest(DeviceRequest request)
 {
     lock (((ICollection)listRequest))
     {
         listRequest.Enqueue(request);
         eventRequest.Set();
     }
 }
Exemple #2
0
        public DeviceRequest SetTime()
        {
            DateTime    dt      = DateTime.Now;
            byte        year    = Convert.ToByte(dt.Year - 2000);
            byte        month   = Convert.ToByte(dt.Month);
            byte        day     = Convert.ToByte(dt.Day);
            byte        hour    = Convert.ToByte(dt.Hour);
            byte        minute  = Convert.ToByte(dt.Minute);
            byte        seconds = Convert.ToByte(dt.Second);
            List <byte> bytes   = new List <byte>();

            bytes.Add(year);
            bytes.Add(month);
            bytes.Add(day);
            bytes.Add(hour);
            bytes.Add(minute);
            bytes.Add(seconds);
            byte[]        timeData = bytes.ToArray();
            DeviceRequest req      = new DeviceRequest(0x82, timeData);

            return(req);
        }
Exemple #3
0
 public DeviceRequest ReadDeviceInformation(int timeOut)
 {
     DeviceRequest req = new DeviceRequest(0x91, new byte[] { });
     return req;
 }
Exemple #4
0
 public DeviceRequest ReadChannelInformation(byte channelId)
 {
     DeviceRequest req = new DeviceRequest(0x93, new byte[] { channelId });
     return req;
 }
Exemple #5
0
 public DeviceRequest GetVersionInformation(int timeOut)
 {
     DeviceRequest req = new DeviceRequest(0x97, new byte[] { });
     return req;
 }
Exemple #6
0
        public DeviceRequest GetVersionInformation(int timeOut)
        {
            DeviceRequest req = new DeviceRequest(0x97, new byte[] { });

            return(req);
        }
Exemple #7
0
 public DeviceRequest WriteChannelInfo(byte[] RequestData)
 {
     DeviceRequest req = new DeviceRequest(0x83, RequestData);
     return req;
 }
Exemple #8
0
 //设置量程
 public DeviceRequest SetSpan(byte channelId, byte gearvalue, int timeOut)
 {
     DeviceRequest req = new DeviceRequest(0x84, new byte[] { channelId,gearvalue });
     return req;
 }
Exemple #9
0
 public DeviceRequest Reset()
 {
     DeviceRequest req2 = new DeviceRequest(0x86, new byte[] { });
     return req2;
 }
Exemple #10
0
        public DeviceRequest SetSpan(byte channelId, byte gearvalue, int timeOut) //设置量程
        {
            DeviceRequest req = new DeviceRequest(0x84, new byte[] { channelId, gearvalue });

            return(req);
        }
Exemple #11
0
        public DeviceRequest ReadChannelInformation(byte channelId)
        {
            DeviceRequest req = new DeviceRequest(0x93, new byte[] { channelId });

            return(req);
        }
Exemple #12
0
        public DeviceRequest ReadLastTime()
        {
            DeviceRequest req = new DeviceRequest(0x92, new byte[] { 1 });

            return(req);
        }
Exemple #13
0
        public DeviceRequest WriteChannelInfo(byte[] RequestData)
        {
            DeviceRequest req = new DeviceRequest(0x83, RequestData);

            return(req);
        }
Exemple #14
0
        public DeviceRequest GetTimeNow()
        {
            DeviceRequest req = new DeviceRequest(0x92, new byte[] { 0 });

            return(req);
        }
Exemple #15
0
        public DeviceRequest ReadDeviceInformation(int timeOut)
        {
            DeviceRequest req = new DeviceRequest(0x91, new byte[] { });

            return(req);
        }
Exemple #16
0
 public DeviceRequest ReadLastTime()
 {
     DeviceRequest req = new DeviceRequest(0x92, new byte[] { 1 });
     return req;
 }
Exemple #17
0
 public DeviceRequest ReadSpan(byte channelid)
 {
     DeviceRequest req2 = new DeviceRequest(0x94, new byte[]{channelid});
     return req2;
 }
Exemple #18
0
        public DeviceRequest ReadSpan(byte channelid)
        {
            DeviceRequest req2 = new DeviceRequest(0x94, new byte[] { channelid });

            return(req2);
        }
Exemple #19
0
 public void SendRequest(DeviceRequest request)
 {
     lock (((ICollection)listRequest))
     {
         listRequest.Enqueue(request);
         eventRequest.Set();
     }
 }
Exemple #20
0
        public DeviceRequest Reset()
        {
            DeviceRequest req2 = new DeviceRequest(0x86, new byte[] { });

            return(req2);
        }
Exemple #21
0
 public DeviceRequest SetTime()
 {
     DateTime dt = DateTime.Now;
     byte year = Convert.ToByte(dt.Year - 2000);
     byte month = Convert.ToByte(dt.Month);
     byte day = Convert.ToByte(dt.Day);
     byte hour = Convert.ToByte(dt.Hour);
     byte minute = Convert.ToByte(dt.Minute);
     byte seconds = Convert.ToByte(dt.Second);
     List<byte> bytes = new List<byte>();
     bytes.Add(year);
     bytes.Add(month);
     bytes.Add(day);
     bytes.Add(hour);
     bytes.Add(minute);
     bytes.Add(seconds);
     byte[] timeData = bytes.ToArray();
     DeviceRequest req = new DeviceRequest(0x82, timeData);
     return req;
 }
Exemple #22
0
 public DeviceRequest GetTimeNow()
 {
     DeviceRequest req = new DeviceRequest(0x92, new byte[] { 0});
     return req;
 }
Exemple #23
0
 public DeviceRequest WriteDeviceInformation(byte[] cmdlist, int timeOut)
 {
     DeviceRequest req = new DeviceRequest(0x81, cmdlist);
     return req;
 }
Exemple #24
0
        public DeviceRequest WriteDeviceInformation(byte[] cmdlist, int timeOut)
        {
            DeviceRequest req = new DeviceRequest(0x81, cmdlist);

            return(req);
        }