static void SetConfiguration(string State) { string MessageHelp = "TSetConf {Port[1..8]} [0|1|2|3]"; int port = GetFirstParameterInteger(State, MessageHelp); eVersiportConfiguration value = (eVersiportConfiguration)GetSecondParameterInteger(State, MessageHelp); if ((int)value < 0 || (int)value > 3) { CrestronConsole.ConsoleCommandResponse(MessageHelp); return; } if (port >= 1 && port <= 8) { switch (port) { case 1: _IO8AnalogInputCard.Configuration1 = value; break; case 2: _IO8AnalogInputCard.Configuration2 = value; break; case 3: _IO8AnalogInputCard.Configuration3 = value; break; case 4: _IO8AnalogInputCard.Configuration4 = value; break; case 5: _IO8AnalogInputCard.Configuration5 = value; break; case 6: _IO8AnalogInputCard.Configuration6 = value; break; case 7: _IO8AnalogInputCard.Configuration7 = value; break; case 8: _IO8AnalogInputCard.Configuration8 = value; break; default: break; } } else { CrestronConsole.ConsoleCommandResponse(MessageHelp); return; } CrestronConsole.ConsoleCommandResponse("CMD:Changing Configuration for Port {0} to {1}...\r\n", port, value); }
private int ReRegisterPort() { if (_Versiport.Registered) { if (_Versiport.UnRegister() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("Error Unregistering IOPort ID {0}: {1}", _Versiport.ID, _Versiport.DeviceRegistrationFailureReason); return(-1); } } if (_Versiport.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("Error Registering IOPort ID {0}: {1}", _Versiport.ID, _Versiport.DeviceRegistrationFailureReason); return(-1); } _Configuration = _Versiport.VersiportConfiguration; return(0); }
void SetConfiguration(int Index, eVersiportConfiguration Conf) { IOPorts[Index - 1].Configuration = Conf; }