Beispiel #1
0
        public byte[] CacheReadSync(GroupAddr dest, ushort age, out KNXAddr src)
        {
            var r = CacheReadSyncAsync(dest, age).Result;

            src = r.Item2;
            return(r.Item1);
        }
Beispiel #2
0
        public byte[] CacheRead(GroupAddr dest, out KNXAddr src)
        {
            var r = CacheReadAsync(dest).Result;

            src = r.Item2;
            return(r.Item1);
        }
Beispiel #3
0
        public byte[] GetGroupSrc(out KNXAddr src, out GroupAddr dest)
        {
            var r = GetGroupSrcAsync().Result;

            src  = r.Item2;
            dest = r.Item3;
            return(r.Item1);
        }
Beispiel #4
0
        public async Task SendGroupAsync(GroupAddr dest, byte[] data)
        {
            var ibuf = new byte[4 + data.Length];

            StoreUshort(ibuf, 0, 0x0027);
            StoreUshort(ibuf, 2, dest.Value);
            data.CopyTo(ibuf, 4);
            await SendRequestAsync(ibuf);
        }
Beispiel #5
0
        public async Task <Tuple <byte[], KNXAddr> > CacheReadAsync(GroupAddr dest)
        {
            await SendRequestAsync(MakeRequest(0x0075, dest.Value));

            var data = await GetRequestAsync();

            CheckProtocol(data, 0x0075, 6);
            if (LoadInt16(data, 4) == 0)
            {
                throw new ApplicationException("Device not found");
            }
            if (data.Length <= 6)
            {
                throw new ApplicationException("Entry not found");
            }
            return(new Tuple <byte[], KNXAddr>(data.Skip(6).ToArray(), LoadKNXAddr(data, 2)));
        }
Beispiel #6
0
 public void CacheRemove(GroupAddr dest)
 {
     CacheRemoveAsync(dest).Wait();
 }
Beispiel #7
0
 public async Task CacheRemoveAsync(GroupAddr dest)
 {
     await DoProtocol(0x0073);
 }
Beispiel #8
0
 public byte[] CacheReadSync(GroupAddr dest, ushort age, out KNXAddr src)
 {
     var r = CacheReadSyncAsync(dest, age).Result;
     src = r.Item2;
     return r.Item1;
 }
Beispiel #9
0
 public async Task<Tuple<byte[], KNXAddr>> CacheReadSyncAsync(GroupAddr dest, ushort age)
 {
     var ibuf = MakeRequest(0x0074, dest.Value, age);
     await SendRequestAsync(ibuf);
     var data = await GetRequestAsync();
     CheckProtocol(data, 0x0074, 6);
     if (LoadInt16(data, 4) == 0)
         throw new ApplicationException("Device not found");
     if (data.Length <= 6)
         throw new ApplicationException("Entry not found");
     return new Tuple<byte[], KNXAddr>(data.Skip(6).ToArray(), LoadKNXAddr(data, 2));
 }
Beispiel #10
0
 public byte[] CacheRead(GroupAddr dest, out KNXAddr src)
 {
     var r = CacheReadAsync(dest).Result;
     src = r.Item2;
     return r.Item1;
 }
Beispiel #11
0
 public void OpenTGroup(GroupAddr dest, bool writeOnly)
 {
     OpenTGroupAsync(dest, writeOnly).Wait();
 }
Beispiel #12
0
 public async Task SendGroupAsync(GroupAddr dest, byte[] data)
 {
     var ibuf = new byte[4 + data.Length];
     StoreUshort(ibuf, 0, 0x0027);
     StoreUshort(ibuf, 2, dest.Value);
     data.CopyTo(ibuf, 4);
     await SendRequestAsync(ibuf);
 }
Beispiel #13
0
 public async Task CacheRemoveAsync(GroupAddr dest)
 {
     await DoProtocol(0x0073);
 }
Beispiel #14
0
 public void SendGroup(GroupAddr dest, byte[] data)
 {
     SendGroupAsync(dest, data).Wait();
 }
Beispiel #15
0
 public async Task OpenTGroupAsync(GroupAddr dest, bool writeOnly)
 {
     await DoProtocol_UshortByte(2, 0x0022, dest.Value, (byte)((writeOnly) ? 0xff : 0));
 }
Beispiel #16
0
 public void CacheRemove(GroupAddr dest)
 {
     CacheRemoveAsync(dest).Wait();
 }
Beispiel #17
0
 public void OpenTGroup(GroupAddr dest, bool writeOnly)
 {
     OpenTGroupAsync(dest, writeOnly).Wait();
 }
Beispiel #18
0
 public byte[] GetGroupSrc(out KNXAddr src, out GroupAddr dest)
 {
     var r = GetGroupSrcAsync().Result;
     src = r.Item2;
     dest = r.Item3;
     return r.Item1;
 }
Beispiel #19
0
 public void SendGroup(GroupAddr dest, byte[] data)
 {
     SendGroupAsync(dest, data).Wait();
 }
Beispiel #20
0
 public async Task OpenTGroupAsync(GroupAddr dest, bool writeOnly)
 {
     await DoProtocol_UshortByte(2, 0x0022, dest.Value, (byte)((writeOnly) ? 0xff : 0));
 }