Example #1
0
 public void SendRequest(DeviceRequest request)
 {
     lock (((ICollection)listRequest))
     {
         listRequest.Enqueue(request);
         eventRequest.Set();
     }
 }
Example #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);
        }
Example #3
0
 public DeviceRequest ReadDeviceInformation(int timeOut)
 {
     DeviceRequest req = new DeviceRequest(0x91, new byte[] { });
     return req;
 }
Example #4
0
 public DeviceRequest ReadChannelInformation(byte channelId)
 {
     DeviceRequest req = new DeviceRequest(0x93, new byte[] { channelId });
     return req;
 }
Example #5
0
 public DeviceRequest GetVersionInformation(int timeOut)
 {
     DeviceRequest req = new DeviceRequest(0x97, new byte[] { });
     return req;
 }
Example #6
0
        public DeviceRequest GetVersionInformation(int timeOut)
        {
            DeviceRequest req = new DeviceRequest(0x97, new byte[] { });

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

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

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

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

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

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

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

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

            return(req2);
        }
Example #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;
 }
Example #22
0
 public DeviceRequest GetTimeNow()
 {
     DeviceRequest req = new DeviceRequest(0x92, new byte[] { 0});
     return req;
 }
Example #23
0
 public DeviceRequest WriteDeviceInformation(byte[] cmdlist, int timeOut)
 {
     DeviceRequest req = new DeviceRequest(0x81, cmdlist);
     return req;
 }
Example #24
0
        public DeviceRequest WriteDeviceInformation(byte[] cmdlist, int timeOut)
        {
            DeviceRequest req = new DeviceRequest(0x81, cmdlist);

            return(req);
        }