private void handleMultiChannelEncapResponse ( SerialMessage serialMessage , int offset ) { logger . trace ( "Process Multi-channel Encapsulation" ) ; CommandClass commandClass ; ZWaveCommandClass zwaveCommandClass ; int endpointId = serialMessage . getMessagePayloadByte ( offset ) ; int commandClassCode = serialMessage . getMessagePayloadByte ( offset + 2 ) ; commandClass = CommandClass . getCommandClass ( commandClassCode ) ; if ( commandClass == null ) { logger . error ( String . format ( "Unsupported command class 0x%02x" , commandClassCode ) ) ; return ; } logger . debug ( String . format ( "Node %d Requested Command Class = %s (0x%02x)" , this . getNode ( ) . getNodeId ( ) , commandClass . getLabel ( ) , commandClassCode ) ) ; ZWaveEndpoint endpoint = this . endpoints . get ( endpointId ) ; if ( endpoint == null ) { logger . error ( "Endpoint {} not found on node {}. Cannot set command classes." , endpoint , this . getNode ( ) . getNodeId ( ) ) ; return ; } zwaveCommandClass = endpoint . getCommandClass ( commandClass ) ; if ( zwaveCommandClass == null ) { logger . warn ( String . format ( "CommandClass %s (0x%02x) not implemented by endpoint %d, fallback to main node." , commandClass . getLabel ( ) , commandClassCode , endpointId ) ) ; zwaveCommandClass = this . getNode ( ) . getCommandClass ( commandClass ) ; } if ( zwaveCommandClass == null ) { logger . error ( String . format ( "CommandClass %s (0x%02x) not implemented by node %d." , commandClass . getLabel ( ) , commandClassCode , this . getNode ( ) . getNodeId ( ) ) ) ; return ; } logger . debug ( String . format ( "Node %d, Endpoint = %d, calling handleApplicationCommandRequest." , this . getNode ( ) . getNodeId ( ) , endpointId ) ) ; zwaveCommandClass . handleApplicationCommandRequest ( serialMessage , offset + 3 , endpointId ) ; }
Handles Multi Channel Encapsulation message . Decapsulates an Application Command message and handles it using the right endpoint .