private void handleIncomingMessage(SerialMessage incomingMessage){
  logger.debug(incomingMessage.toString());
  try {
switch (incomingMessage.getMessageType()) {
case Request:
      handleIncomingRequestMessage(incomingMessage);
    break;
case Response:
  handleIncomingResponseMessage(incomingMessage);
break;
default :
logger.warn("Unsupported incomingMessageType: {}",incomingMessage.getMessageType());
}
}
 catch (ZWaveSerialMessageException e) {
logger.error("Error processing incoming message: {}",e.getMessage());
}
}

private void handleIncomingMessage ( SerialMessage incomingMessage ) { logger . debug ( incomingMessage . toString ( ) ) ; try { switch ( incomingMessage . getMessageType ( ) ) { case Request : handleIncomingRequestMessage ( incomingMessage ) ; break ; case Response : handleIncomingResponseMessage ( incomingMessage ) ; break ; default : logger . warn ( "Unsupported incomingMessageType: {}" , incomingMessage . getMessageType ( ) ) ; } } catch ( ZWaveSerialMessageException e ) { logger . error ( "Error processing incoming message: {}" , e . getMessage ( ) ) ; } }
handles incoming serial messages . serial messages can either be messages that are a response to our own requests , or the stick asking us information .
