public Task SendDeviceSpecificFrame(FrameModel frame)
 {
     return(Task.Run(() =>
     {
         var messageProvider = MessageProviderFactory.Create(frame.Device.IncludeSaveConfig);
         var message = messageProvider.CreateMessageFor(frame);
         _linProvider.Send(message);
     }));
 }
        public Task ReadById(FrameModel frame)
        {
            return(Task.Run(() =>
            {
                var messageProvider = MessageProviderFactory.Create(frame.Device.IncludeSaveConfig);
                var message = messageProvider.CreateReadByIdMessage(frame);

                _linProvider.Send(message);
                _linProvider.Send(messageProvider.CreateSubscriberMessage());
            }));
        }
        public Task UpdateFrameId(FrameModel frame)
        {
            return(Task.Run(() =>
            {
                var newFrameId = frame.FrameId;
                _linProvider.GetPIDFor(ref newFrameId);

                var messageProvider = MessageProviderFactory.Create(frame.Device.IncludeSaveConfig);
                var message = messageProvider.CreateUpdateFrameIdMessage(frame, newFrameId);

                _linProvider.Send(message);

                if (frame.Device.IncludeSaveConfig)
                {
                    _linProvider.Send(messageProvider.CreateSaveConfigMessage());
                }

                _linProvider.Send(messageProvider.CreateSubscriberMessage());
            }));
        }