protected void UpdatePropertyValue(IAdapterProperty property, IAdapterAttribute attribute, object newValue) { //if (newValue.Equals(attribute.Value.Data)) return; attribute.Value.Data = newValue; if (((BridgeAdapterAttribute)attribute).COVBehavior == SignalBehavior.Always) { this.NotifyChangeOfValueSignal(property, attribute); } }
public void NotifyChangeOfValueSignal(IAdapterProperty Property, IAdapterAttribute Attribute) { if (!_enableSignals) { return; } IAdapterSignal covSignal = this.Signals[CHANGE_OF_VALUE_SIGNAL_INDEX]; covSignal.Params[0].Data = Property; covSignal.Params[1].Data = Attribute.Value; _adapter.NotifySignalListener(covSignal); }
internal void SignalChangeOfAttributeValue(IAdapterDevice device, IAdapterProperty property, IAdapterAttribute attribute) { // find change of value signal of that end point (end point == bridgeRT device) var covSignal = device.Signals.OfType<AdapterSignal>().FirstOrDefault(s => s.Name == Constants.CHANGE_OF_VALUE_SIGNAL); if (covSignal == null) { // no change of value signal return; } // set property and attribute param of COV signal // note that // - ZCL cluster correspond to BridgeRT property // - ZCL attribute correspond to BridgeRT attribute var param = covSignal.Params.FirstOrDefault(p => p.Name == Constants.COV__PROPERTY_HANDLE); if (param == null) { // signal doesn't have the expected parameter return; } param.Data = property; param = covSignal.Params.FirstOrDefault(p => p.Name == Constants.COV__ATTRIBUTE_HANDLE); if (param == null) { // signal doesn't have the expected parameter return; } param.Data = attribute.Value; // signal change of value to BridgeRT NotifySignalListener(covSignal); }
internal void SignalChangeOfAttributeValue(IAdapterDevice device, IAdapterProperty property, IAdapterAttribute attribute) { // find change of value signal of that end point (end point == bridgeRT device) var covSignal = device.Signals.OfType <AdapterSignal>().FirstOrDefault(s => s.Name == Constants.CHANGE_OF_VALUE_SIGNAL); if (covSignal == null) { // no change of value signal return; } // set property and attribute param of COV signal // note that // - ZCL cluster correspond to BridgeRT property // - ZCL attribute correspond to BridgeRT attribute var param = covSignal.Params.FirstOrDefault(p => p.Name == Constants.COV__PROPERTY_HANDLE); if (param == null) { // signal doesn't have the expected parameter return; } param.Data = property; param = covSignal.Params.FirstOrDefault(p => p.Name == Constants.COV__ATTRIBUTE_HANDLE); if (param == null) { // signal doesn't have the expected parameter return; } param.Data = attribute.Value; // signal change of value to BridgeRT NotifySignalListener(covSignal); }