private void createSignals() { try { // Device Arrival Signal AdapterSignal deviceArrivalSignal = new AdapterSignal(Constants.DEVICE_ARRIVAL_SIGNAL); AdapterValue deviceHandle_arrival = new AdapterValue(Constants.DEVICE_ARRIVAL__DEVICE_HANDLE, null); deviceArrivalSignal.Params.Add(deviceHandle_arrival); // Device Removal Signal AdapterSignal deviceRemovalSignal = new AdapterSignal(Constants.DEVICE_REMOVAL_SIGNAL); AdapterValue deviceHandle_removal = new AdapterValue(Constants.DEVICE_REMOVAL__DEVICE_HANDLE, null); deviceRemovalSignal.Params.Add(deviceHandle_removal); // Add Signals to the Adapter Signals this.Signals.Add(deviceArrivalSignal); this.Signals.Add(deviceRemovalSignal); // change of value signal AdapterSignal changeOfAttributeValue = new AdapterSignal(Constants.CHANGE_OF_VALUE_SIGNAL); changeOfAttributeValue.AddParam(Constants.COV__PROPERTY_HANDLE); changeOfAttributeValue.AddParam(Constants.COV__ATTRIBUTE_HANDLE); this.Signals.Add(changeOfAttributeValue); } catch (OutOfMemoryException ex) { Debug.WriteLine("Out of memory while trying to create signals." + ex.Message); throw; } }
private void CreateSignals() { // change of value signal AdapterSignal changeOfAttributeValue = new AdapterSignal(Constants.CHANGE_OF_VALUE_SIGNAL); changeOfAttributeValue.AddParam(Constants.COV__PROPERTY_HANDLE); changeOfAttributeValue.AddParam(Constants.COV__ATTRIBUTE_HANDLE); Signals.Add(changeOfAttributeValue); }
private uint CreateSignals() { // create device arrival signal and add it to list AdapterSignal deviceArrival = new AdapterSignal(Constants.DEVICE_ARRIVAL_SIGNAL); deviceArrival.AddParam(Constants.DEVICE_ARRIVAL__DEVICE_HANDLE); Signals.Add(deviceArrival); // create device removal signal and add it to list AdapterSignal deviceRemoval = new AdapterSignal(Constants.DEVICE_REMOVAL_SIGNAL); deviceRemoval.AddParam(Constants.DEVICE_REMOVAL__DEVICE_HANDLE); Signals.Add(deviceRemoval); return(ERROR_SUCCESS); }