data = message.substring(3);
}
} catch (Exception e) {
- logger.error("processDSCAlarmMessage(): Error processing message: ({}) ", message, e);
+ logger.warn("processDSCAlarmMessage(): Error processing message: ({}) ", message, e);
return;
}
logger.trace("addBridge(): '{}' was added to inbox.", thingUID);
} catch (Exception e) {
- logger.error("addBridge(): Error", e);
+ logger.warn("addBridge(): Error", e);
}
}
}
lowIP = convertIPToNumber(subnetInfo.getLowAddress());
highIP = convertIPToNumber(subnetInfo.getHighAddress());
} catch (IllegalArgumentException e) {
- logger.error("discoverBridge(): Illegal Argument Exception - {}", e.toString());
+ logger.warn("discoverBridge(): Illegal Argument Exception - {}", e.toString());
return;
} catch (Exception e) {
- logger.error("discoverBridge(): Error - Unable to get Subnet Information! {}", e.toString());
+ logger.warn("discoverBridge(): Error - Unable to get Subnet Information! {}", e.toString());
return;
}
sendCommand(DSCAlarmCode.StatusReport);
}
} else {
- logger.error("Not Connected to the DSC Alarm!");
+ logger.warn("Not Connected to the DSC Alarm!");
connect();
}
}
}
} else {
- logger.error("checkThings(): Thing handler not found!");
+ logger.warn("checkThings(): Thing handler not found! Thing: {}", thing.getUID());
}
}
}
}
if (password == null) {
- logger.error("sendCommand(): No password!");
+ logger.warn("sendCommand(): No password!");
break;
}
data = password;
break;
case CommandOutputControl: /* 020 */
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[1-8]")) {
- logger.error(
+ logger.warn(
"sendCommand(): Partition number must be a single character string from 1 to 8, it was: {}",
dscAlarmData[0]);
break;
}
if (dscAlarmData[1] == null || !dscAlarmData[1].matches("[1-4]")) {
- logger.error(
+ logger.warn(
"sendCommand(): Output number must be a single character string from 1 to 4, it was: {}",
dscAlarmData[1]);
break;
case PartitionArmControlStay: /* 031 */
case PartitionArmControlZeroEntryDelay: /* 032 */
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[1-8]")) {
- logger.error(
+ logger.warn(
"sendCommand(): Partition number must be a single character string from 1 to 8, it was: {}",
dscAlarmData[0]);
break;
case PartitionArmControlWithUserCode: /* 033 */
case PartitionDisarmControl: /* 040 */
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[1-8]")) {
- logger.error(
+ logger.warn(
"sendCommand(): Partition number must be a single character string from 1 to 8, it was: {}",
dscAlarmData[0]);
break;
}
if (userCode == null || userCode.length() < 4 || userCode.length() > 6) {
- logger.error("sendCommand(): User Code is invalid, must be between 4 and 6 chars");
+ logger.warn("sendCommand(): User Code is invalid, must be between 4 and 6 chars");
break;
}
case TimeDateBroadcastControl: /* 056 */
case TemperatureBroadcastControl: /* 057 */
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[0-1]")) {
- logger.error("sendCommand(): Value must be a single character string of 0 or 1: {}",
+ logger.warn("sendCommand(): Value must be a single character string of 0 or 1: {}",
dscAlarmData[0]);
break;
}
break;
case TriggerPanicAlarm: /* 060 */
if (dscAlarmData[0] == null || !dscAlarmData[0].matches("[1-3]")) {
- logger.error("sendCommand(): FAPcode must be a single character string from 1 to 3, it was: {}",
+ logger.warn("sendCommand(): FAPcode must be a single character string from 1 to 3, it was: {}",
dscAlarmData[1]);
break;
}
if (dscAlarmProtocol.equals(DSCAlarmProtocol.ENVISALINK_TPI)) {
if (dscAlarmData[0] == null || dscAlarmData[0].length() != 1
|| !dscAlarmData[0].matches("[0-9]|A|#|\\*")) {
- logger.error(
+ logger.warn(
"sendCommand(): \'keystroke\' must be a single character string from 0 to 9, *, #, or A, it was: {}",
dscAlarmData[0]);
break;
} else if (dscAlarmProtocol.equals(DSCAlarmProtocol.IT100_API)) {
if (dscAlarmData[0] == null || dscAlarmData[0].length() != 1
|| !dscAlarmData[0].matches("[0-9]|\\*|#|F|A|P|[a-e]|<|>|=|\\^|L")) {
- logger.error(
+ logger.warn(
"sendCommand(): \'keystroke\' must be a single character string from 0 to 9, *, #, F, A, P, a to e, <, >, =, or ^, it was: {}",
dscAlarmData[0]);
break;
validCommand = true;
break;
} catch (InterruptedException e) {
- logger.error("sendCommand(): \'keystroke\': Error with Long Key Press!");
+ logger.warn("sendCommand(): \'keystroke\': Error with Long Key Press!");
break;
}
}
if (dscAlarmData[0] == null || dscAlarmData[0].length() > 6
|| !dscAlarmData[0].matches("(\\d|#|\\*)+")) {
- logger.error(
+ logger.warn(
"sendCommand(): \'keysequence\' must be a string of up to 6 characters consiting of 0 to 9, *, or #, it was: {}",
dscAlarmData[0]);
break;
break;
case CodeSend: /* 200 */
if (userCode == null || userCode.length() < 4 || userCode.length() > 6) {
- logger.error("sendCommand(): Access Code is invalid, must be between 4 and 6 chars");
+ logger.warn("sendCommand(): Access Code is invalid, must be between 4 and 6 chars");
break;
}
successful = true;
logger.debug("sendCommand(): '{}' Command Sent - {}", dscAlarmCode, confidentialData ? "***" : cmd);
} else {
- logger.error("sendCommand(): Command '{}' Not Sent - Invalid!", dscAlarmCode);
+ logger.warn("sendCommand(): Command '{}' Not Sent - Invalid!", dscAlarmCode);
}
return successful;
setConnected(true);
} catch (UnknownHostException unknownHostException) {
- logger.error("openConnection(): Unknown Host Exception: {}", unknownHostException.getMessage());
+ logger.warn("openConnection(): Unknown Host Exception: {}", unknownHostException.getMessage());
setConnected(false);
} catch (SocketException socketException) {
- logger.error("openConnection(): Socket Exception: {}", socketException.getMessage());
+ logger.warn("openConnection(): Socket Exception: {}", socketException.getMessage());
setConnected(false);
} catch (IOException ioException) {
- logger.error("openConnection(): IO Exception: {}", ioException.getMessage());
+ logger.warn("openConnection(): IO Exception: {}", ioException.getMessage());
setConnected(false);
} catch (Exception exception) {
- logger.error("openConnection(): Unable to open a connection: {} ", exception.getMessage(), exception);
+ logger.warn("openConnection(): Unable to open a connection: {} ", exception.getMessage(), exception);
setConnected(false);
}
}
tcpOutput.write(writeString);
tcpOutput.flush();
} catch (IOException ioException) {
- logger.error("write(): {}", ioException.getMessage());
+ logger.warn("write(): {}", ioException.getMessage());
setConnected(false);
} catch (Exception exception) {
- logger.error("write(): Unable to write to socket: {} ", exception.getMessage(), exception);
+ logger.warn("write(): Unable to write to socket: {} ", exception.getMessage(), exception);
setConnected(false);
}
}
message = tcpInput.readLine();
logger.debug("read(): Message Received: {}", message);
} catch (IOException ioException) {
- logger.error("read(): IO Exception: {}", ioException.getMessage());
+ logger.warn("read(): IO Exception: {}", ioException.getMessage());
setConnected(false);
} catch (Exception exception) {
- logger.error("read(): Exception: {} ", exception.getMessage(), exception);
+ logger.warn("read(): Exception: {} ", exception.getMessage(), exception);
setConnected(false);
}
setConnected(false);
logger.debug("closeConnection(): Closed TCP Connection!");
} catch (IOException ioException) {
- logger.error("closeConnection(): Unable to close connection - {}", ioException.getMessage());
+ logger.warn("closeConnection(): Unable to close connection - {}", ioException.getMessage());
} catch (Exception exception) {
- logger.error("closeConnection(): Error closing connection - {}", exception.getMessage());
+ logger.warn("closeConnection(): Error closing connection - {}", exception.getMessage());
}
}
try {
handleIncomingMessage(messageLine);
} catch (Exception e) {
- logger.error("TCPListener(): Message not handled by bridge: {}", e.getMessage());
+ logger.warn("TCPListener(): Message not handled by bridge: {}", e.getMessage());
}
} else {
setConnected(false);
}
}
} catch (Exception e) {
- logger.error("TCPListener(): Unable to read message: {} ", e.getMessage(), e);
+ logger.warn("TCPListener(): Unable to read message: {} ", e.getMessage(), e);
closeConnection();
}
}
SerialPortIdentifier portIdentifier = serialPortManager.getIdentifier(serialPortName);
if (portIdentifier == null) {
- logger.error("openConnection(): No Such Port: {}", serialPort);
+ logger.warn("openConnection(): No Such Port: {}", serialPort);
setConnected(false);
return;
}
setConnected(true);
} catch (PortInUseException portInUseException) {
- logger.error("openConnection(): Port in Use Exception: {}", portInUseException.getMessage());
+ logger.warn("openConnection(): Port in Use Exception: {}", portInUseException.getMessage());
setConnected(false);
} catch (UnsupportedCommOperationException unsupportedCommOperationException) {
- logger.error("openConnection(): Unsupported Comm Operation Exception: {}",
+ logger.warn("openConnection(): Unsupported Comm Operation Exception: {}",
unsupportedCommOperationException.getMessage());
setConnected(false);
} catch (UnsupportedEncodingException unsupportedEncodingException) {
- logger.error("openConnection(): Unsupported Encoding Exception: {}",
+ logger.warn("openConnection(): Unsupported Encoding Exception: {}",
unsupportedEncodingException.getMessage());
setConnected(false);
} catch (IOException ioException) {
- logger.error("openConnection(): IO Exception: {}", ioException.getMessage());
+ logger.warn("openConnection(): IO Exception: {}", ioException.getMessage());
setConnected(false);
}
}
serialOutput.flush();
logger.debug("write(): Message Sent: {}", doNotLog ? "***" : writeString);
} catch (IOException ioException) {
- logger.error("write(): {}", ioException.getMessage());
+ logger.warn("write(): {}", ioException.getMessage());
setConnected(false);
} catch (Exception exception) {
- logger.error("write(): Unable to write to serial port: {} ", exception.getMessage(), exception);
+ logger.warn("write(): Unable to write to serial port: {} ", exception.getMessage(), exception);
setConnected(false);
}
}
message = readLine();
logger.debug("read(): Message Received: {}", message);
} catch (IOException ioException) {
- logger.error("read(): IO Exception: {} ", ioException.getMessage());
+ logger.warn("read(): IO Exception: {} ", ioException.getMessage());
setConnected(false);
} catch (Exception exception) {
- logger.error("read(): Exception: {} ", exception.getMessage(), exception);
+ logger.warn("read(): Exception: {} ", exception.getMessage(), exception);
setConnected(false);
}
String messageLine = serialInput.readLine();
handleIncomingMessage(messageLine);
} catch (IOException ioException) {
- logger.error("serialEvent(): IO Exception: {}", ioException.getMessage());
+ logger.warn("serialEvent(): IO Exception: {}", ioException.getMessage());
}
}
}
serialPort.addEventListener(serialPortEventListenser);
serialPort.notifyOnDataAvailable(true);
} catch (TooManyListenersException tooManyListenersException) {
- logger.error("setSerialEventHandler(): Too Many Listeners Exception: {}",
+ logger.warn("setSerialEventHandler(): Too Many Listeners Exception: {}",
tooManyListenersException.getMessage());
}
}
setConnected(true);
} catch (UnknownHostException unknownHostException) {
- logger.error("openConnection(): Unknown Host Exception: {}", unknownHostException.getMessage());
+ logger.warn("openConnection(): Unknown Host Exception: {}", unknownHostException.getMessage());
setConnected(false);
} catch (SocketException socketException) {
- logger.error("openConnection(): Socket Exception: {}", socketException.getMessage());
+ logger.warn("openConnection(): Socket Exception: {}", socketException.getMessage());
setConnected(false);
} catch (IOException ioException) {
- logger.error("openConnection(): IO Exception: {}", ioException.getMessage());
+ logger.warn("openConnection(): IO Exception: {}", ioException.getMessage());
setConnected(false);
} catch (Exception exception) {
- logger.error("openConnection(): Unable to open a connection: {} ", exception.getMessage(), exception);
+ logger.warn("openConnection(): Unable to open a connection: {} ", exception.getMessage(), exception);
setConnected(false);
}
}
tcpOutput.flush();
logger.debug("write(): Message Sent: {}", doNotLog ? "***" : writeString);
} catch (IOException ioException) {
- logger.error("write(): {}", ioException.getMessage());
+ logger.warn("write(): {}", ioException.getMessage());
setConnected(false);
} catch (Exception exception) {
- logger.error("write(): Unable to write to socket: {} ", exception.getMessage(), exception);
+ logger.warn("write(): Unable to write to socket: {} ", exception.getMessage(), exception);
setConnected(false);
}
}
message = tcpInput.readLine();
logger.debug("read(): Message Received: {}", message);
} catch (IOException ioException) {
- logger.error("read(): IO Exception: {}", ioException.getMessage());
+ logger.warn("read(): IO Exception: {}", ioException.getMessage());
setConnected(false);
} catch (Exception exception) {
- logger.error("read(): Exception: {} ", exception.getMessage(), exception);
+ logger.warn("read(): Exception: {} ", exception.getMessage(), exception);
setConnected(false);
}
setConnected(false);
logger.debug("closeConnection(): Closed TCP Connection!");
} catch (IOException ioException) {
- logger.error("closeConnection(): Unable to close connection - {}", ioException.getMessage());
+ logger.warn("closeConnection(): Unable to close connection - {}", ioException.getMessage());
} catch (Exception exception) {
- logger.error("closeConnection(): Error closing connection - {}", exception.getMessage());
+ logger.warn("closeConnection(): Error closing connection - {}", exception.getMessage());
}
}
try {
handleIncomingMessage(messageLine);
} catch (Exception e) {
- logger.error("TCPListener(): Message not handled by bridge: {}", e.getMessage());
+ logger.warn("TCPListener(): Message not handled by bridge: {}", e.getMessage());
}
} else {
setConnected(false);
}
}
} catch (Exception e) {
- logger.error("TCPListener(): Unable to read message: {} ", e.getMessage(), e);
+ logger.warn("TCPListener(): Unable to read message: {} ", e.getMessage(), e);
closeConnection();
}
}