public void setTerminalConfiguration ( final DeviceControllerTerminalConfiguration config ) throws IOException { if ( config == null ) { throw new RuntimeException ( "null-config is not allowed!" ) ; } final DeviceControllerChannel channel = config . getChannel ( ) ; if ( channel == null ) { throw new RuntimeException ( "null-channel is not allowed. For devices " + "knowing just one wiper Channel.A is mandatory for " + "parameter 'channel'" ) ; } byte memAddr = config . getChannel ( ) . getTerminalControllAddress ( ) ; // read current configuration from device int tcon = read ( memAddr ) ; // modify configuration tcon = setBit ( tcon , channel . getHardwareConfigControlBit ( ) , config . isChannelEnabled ( ) ) ; tcon = setBit ( tcon , channel . getTerminalAConnectControlBit ( ) , config . isPinAEnabled ( ) ) ; tcon = setBit ( tcon , channel . getWiperConnectControlBit ( ) , config . isPinWEnabled ( ) ) ; tcon = setBit ( tcon , channel . getTerminalBConnectControlBit ( ) , config . isPinBEnabled ( ) ) ; // write new configuration to device write ( memAddr , tcon ) ; }
Sets the given terminal - configuration to the device .