/// <summary> /// The demultiplexing routing for incoming operations /// </summary> /// <param name="message"></param> public override IList <VParamType> OnInvoke(string roleName, String opName, IList <VParamType> args) { if (!roleName.Equals(RoleSignalDigital.RoleName)) { logger.Log("Invalid role {0} in OnInvoke", roleName); return(null); } switch (opName.ToLower()) { case RoleSignalDigital.OpSetDigitalName: int slot = (int)args[0].Value(); int join = (int)args[1].Value(); DigitalSignalValue value = (DigitalSignalValue)Enum.Parse(typeof(DigitalSignalValue), args[2].Value().ToString(), true); logger.Log(string.Format("{0} SendDigital Request slot: {1} join: {2}", this.ToString(), slot, join)); bool returnValue = crestronConnection.SendDigital(slot, join, value); return(new List <VParamType>() { new ParamType(returnValue) }); default: logger.Log("Invalid operation: {0}", opName); return(null); } }
internal bool SendDigital(int Slot, int Join, DigitalSignalValue value) { switch (value) { case DigitalSignalValue.High: return(this.acnxConnection.SendDigital(Slot, Join, true)); case DigitalSignalValue.Low: return(this.acnxConnection.SendDigital(Slot, Join, false)); case DigitalSignalValue.HighLow: this.acnxConnection.SendDigital(Slot, Join, true); return(this.acnxConnection.SendDigital(Slot, Join, false)); case DigitalSignalValue.LowHigh: this.acnxConnection.SendDigital(Slot, Join, false); return(this.acnxConnection.SendDigital(Slot, Join, true)); } logger.Log(string.Format("Illegal Send digital value: {0}\r\n", Enum.GetName(typeof(DigitalSignalValue), value))); throw new ArgumentOutOfRangeException("DigitalSignalValue value"); }