void GenerateEvent() { var n = new Notify(PinDriver.UPDATE_EVENT_NAME, PinDriver.DRIVER_NAME); n.AddParameter(PinDriver.PIN_PARAM_NAME, "punch"); n.AddParameter(PinDriver.VALUE_PARAM_NAME, newValue.ToString()); uOS.gateway.Notify(n, uOS.gateway.currentDevice); }
void GenerateRepetitionsEvent() { var n = new Notify(PinDriver.UPDATE_EVENT_NAME, PinDriver.DRIVER_NAME); n.AddParameter(PinDriver.PIN_PARAM_NAME, "repetitions"); n.AddParameter(PinDriver.VALUE_PARAM_NAME, 20.ToString()); uOS.gateway.Notify(n, uOS.gateway.currentDevice); Debug.Log("Repetitions event"); }
private void FireDriverEvent(string pinName, string eventKey, object newValue) { HashSet<UpDevice> listeners; lock (_lock) { if (!driverListeners.TryGetValue(pinName, out listeners)) return; } Notify n = new Notify(eventKey, DRIVER_NAME, instanceId); n.AddParameter(PIN_PARAM_NAME, pinName); if (UPDATE_EVENT_NAME.Equals(eventKey)) n.AddParameter(VALUE_PARAM_NAME, newValue.ToString()); foreach (var device in listeners) gateway.Notify(n, device); }