/// <summary> /// /// </summary> /// <param name="reader"></param> /// <param name="portVal"></param> /// <returns></returns> public bool SetMultiplexerPort(STPv3Reader reader, byte portVal) { byte[] data = new byte[1]; byte[] muxPorts = MuxPortList(multiplexerType); if (multiplexerType.Equals(MUXType.FOUR_PORT_HF) || multiplexerType.Equals(MUXType.FOUR_PORT_UHF)) { if ((portVal != 0) && (portVal != 2) && (portVal != 5) && (portVal != 7)) { return(false); } if (portVal == 0) { portIndex = 0; } if (portVal == 2) { portIndex = 1; } if (portVal == 5) { portIndex = 2; } if (portVal == 7) { portIndex = 3; } } else { if (portVal > maxPort) { return(false); } } data[0] = portVal; currentPort = portVal; if (reader.WriteSystemParameter(data, (ushort)SYS_PARAMS.SYS_MUX_CONTROL, 1) == true) { return(true); } else { return(false); } }
/// <summary> /// This function checks the current port and switches to the next port. If the max port is reached, /// then /// </summary> /// <param name="reader"></param> /// <returns></returns> public bool IncrementMultiplexerPort(STPv3Reader reader) { byte[] data = new byte[1]; byte[] muxPorts = MuxPortList(multiplexerType); currentPort++; if (portIndex >= maxPort) { portIndex = 0; } data[0] = muxPorts[portIndex]; if (reader.WriteSystemParameter(data, (ushort)SYS_PARAMS.SYS_MUX_CONTROL, 1) == true) { return(true); } else { return(false); } }
/// <summary> /// /// </summary> /// <param name="reader"></param> /// <param name="portVal"></param> /// <returns></returns> public bool SetMultiplexerPort(STPv3Reader reader, byte portVal) { byte[] data = new byte[1]; byte[] muxPorts = MuxPortList(multiplexerType); if (multiplexerType.Equals(MUXType.FOUR_PORT_HF) || multiplexerType.Equals(MUXType.FOUR_PORT_UHF)) { if ((portVal != 0) && (portVal != 2) && (portVal != 5) && (portVal != 7)) { return false; } if (portVal == 0) portIndex = 0; if (portVal == 2) portIndex = 1; if (portVal == 5) portIndex = 2; if (portVal == 7) portIndex = 3; } else { if (portVal > maxPort) return false; } data[0] = portVal; currentPort = portVal; if (reader.WriteSystemParameter(data, (ushort)SYS_PARAMS.SYS_MUX_CONTROL, 1) == true) return true; else return false; }
/// <summary> /// This function checks the current port and switches to the next port. If the max port is reached, /// then /// </summary> /// <param name="reader"></param> /// <returns></returns> public bool IncrementMultiplexerPort(STPv3Reader reader) { byte[] data = new byte[1]; byte[] muxPorts = MuxPortList(multiplexerType); currentPort++; if (portIndex >= maxPort) portIndex = 0; data[0] = muxPorts[portIndex]; if (reader.WriteSystemParameter(data, (ushort)SYS_PARAMS.SYS_MUX_CONTROL, 1) == true) return true; else return false; }