Ejemplo n.º 1
0
        public async Task Set(byte scheduleId, byte scheduleIdBlock, ScheduleData data, CancellationToken cancellationToken)
        {
            if (!await IsSupportScheduleIdBlock(cancellationToken))
            {
                throw new VersionNotSupportedException($"Schedule ID blocks work with class type {Class} greater or equal to {ScheduleIdBlockMinimalProtocolVersion}.");
            }

            await Send(new Command(Class, command.Set, data.ToPayload(scheduleId, scheduleIdBlock)), cancellationToken);
        }
Ejemplo n.º 2
0
        internal ScheduleReport(Node node, byte[] payload) : base(node)
        {
            if (payload == null)
            {
                throw new ArgumentNullException(nameof(payload));
            }
            if (payload.Length < 12)
            {
                throw new ReponseFormatException($"The response was not in the expected format. {GetType().Name}: Payload: {BitConverter.ToString(payload)}");
            }

            ID   = payload[0];
            Data = ScheduleData.FromPayload(payload);
        }
Ejemplo n.º 3
0
 public async Task Set(byte scheduleId, ScheduleData data, CancellationToken cancellationToken)
 {
     await Send(new Command(Class, command.Set, data.ToPayload(scheduleId)), cancellationToken);
 }
Ejemplo n.º 4
0
 public Task Set(byte scheduleId, ScheduleData data)
 {
     return(Set(scheduleId, data, CancellationToken.None));
 }