diff --git a/commonLibs/livoxProto1/udpCommandDemuxer.cpp b/commonLibs/livoxProto1/udpCommandDemuxer.cpp index 453e47d..2f6fb2e 100644 --- a/commonLibs/livoxProto1/udpCommandDemuxer.cpp +++ b/commonLibs/livoxProto1/udpCommandDemuxer.cpp @@ -304,26 +304,33 @@ void UdpCommandDemuxer::processIncomingData() { // Extract command set and command ID from the datagram if (bytesReceived >= static_cast( - sizeof(livoxProto1::comms::Header) + sizeof(livoxProto1::comms::Command))) + sizeof(livoxProto1::comms::Header) + + sizeof(livoxProto1::comms::Command))) { - uint8_t cmd_set = receiveBuffer[sizeof(livoxProto1::comms::Header)]; - uint8_t cmd_id = receiveBuffer[sizeof(livoxProto1::comms::Header) + 1]; + uint8_t cmd_set = receiveBuffer[ + sizeof(livoxProto1::comms::Header)]; + uint8_t cmd_id = receiveBuffer[ + sizeof(livoxProto1::comms::Header) + 1]; - // Found matching device in temporary collection, invoke matching handlers + // Found matching dev in temp collection, invoke matching handlers for (const auto& cmdHandler : tempIt->second) { - if (cmdHandler.cmd_set != cmd_set || cmdHandler.cmd_id != cmd_id) - { continue; } + if (cmdHandler.cmd_set != cmd_set + || cmdHandler.cmd_id != cmd_id) + { + continue; + } try { - cmdHandler.handler(receiveBuffer, bytesReceived, senderAddr); + cmdHandler.handler( + receiveBuffer, bytesReceived, senderAddr); } catch (const std::exception &e) { - std::cerr - << __func__ << ": Temporary device handler exception for IP " - << sourceIP << ": " << e.what() << std::endl; + std::cerr << __func__ << ": Temporary device handler " + "exception for IP " << sourceIP << ": " << e.what() + << std::endl; } } }