public void Start(string channelName)
        {
            var dg = Container.Resolve <IDeviceGroupProvider>();
            var am = Container.Resolve <IAccessChannelManager>();

            var devices = dg.RootDeviceGroup.GetAllDevices().Where(d => !d.Registration.Config.IsSimulated);

            _channel = am.GetChannel(channelName);

            _channel.Start();
            _channel.AddToUpdateList(devices);
        }
Exemple #2
0
 public static Task WriteAsync(this IAccessChannel channel, WriteData writeData)
 {
     return(channel.WriteAsync(writeData.ToEnumerable()));
 }
Exemple #3
0
 public static void Write(this IAccessChannel channel, WriteData writeData)
 {
     channel.Write(writeData.ToEnumerable());
 }
Exemple #4
0
 public static IObservable <IList <ReadData> > DirectAsyncRead(this IAccessChannel channel,
                                                               IEnumerable <IAccessItemRegistration> registrations)
 {
     return(channel.DirectAsyncRead(registrations.Select(x => x.ServerAlias)));
 }
Exemple #5
0
 public static IObservable <ReadData> DirectAsyncRead(this IAccessChannel channel,
                                                      IAccessItemRegistration registration)
 {
     return(channel.DirectAsyncRead(registration.ToEnumerable()).Select(rds => rds.First()));
 }
Exemple #6
0
 public static Task ReadAsync(this IAccessChannel channel, IEnumerable <IAccessItemRegistration> regs)
 {
     return(channel.ReadAsync(regs.Select(x => x.ServerAlias)));
 }
Exemple #7
0
 public static Task ReadAsync(this IAccessChannel channel, IAccessItemRegistration reg)
 {
     return(channel.ReadAsync(reg.ToEnumerable()));
 }
Exemple #8
0
 public static void Read(this IAccessChannel channel,
                         uint serverAlias)
 {
     channel.Read(serverAlias.ToEnumerable());
 }
Exemple #9
0
 public static void Read(this IAccessChannel channel, IAccessItemRegistration reg)
 {
     channel.Read(reg.ToEnumerable());
 }
Exemple #10
0
 private static Task AddToUpdateListAsync(this IAccessChannel channel,
                                          IEnumerable <IAccessItemRegistration> registrations)
 {
     return(channel.AddToUpdateListAsync(registrations.Select(x => x.ClientAlias)));
 }
Exemple #11
0
 public static Task AddToUpdateListAsync(this IAccessChannel channel,
                                         IEnumerable <IDevice> devices)
 {
     return(channel.AddToUpdateListAsync(devices.Select(d => d.Registration.ClientAlias)));
 }
Exemple #12
0
 public static void AddToUpdateList(this IAccessChannel channel,
                                    IEnumerable <IDevice> devices)
 {
     channel.AddToUpdateList(devices.Select(d => d.Registration.ClientAlias));
 }
Exemple #13
0
 private static void AddToUpdateList(this IAccessChannel channel,
                                     IEnumerable <IAccessItemRegistration> registrations)
 {
     channel.AddToUpdateList(registrations.Select(x => x.ClientAlias));
 }
Exemple #14
0
 public static IDevice Register(this IAccessChannel channel,
                                DeviceConfig accessItemConfig)
 {
     return(channel.Register(accessItemConfig.ToEnumerable()).First());
 }
//        public AccessItemRegistration(AccessItemConfig config) : this()
//        {
//            Config = config;
//        }

        public AccessItemRegistration(DeviceConfig config, IAccessChannel channel)
            : this()
        {
            Config  = config;
            Channel = channel;
        }
Exemple #16
0
 public static void Read(this IAccessChannel channel, IEnumerable <IAccessItemRegistration> regs)
 {
     channel.Read(regs.Select(x => x.ServerAlias));
 }
Exemple #17
0
 public void Init(IAccessChannel channel, IAccessItemRegistration registration)
 {
     throw new NotImplementedException();
 }
 public XiAccessItemRegistration(DeviceConfig config, IAccessChannel channel)
     : base(config, channel)
 {
     ListInstanceDef = new ListInstanceDef(Config.Tag, ClientAlias, true);
 }