/** * Display an RDM Frame. */ void RDMSniffer::DisplayRDMFrame() { unsigned int slot_count = m_frame.Size() - 1; cout << "RDM " << std::dec << slot_count << ": " << std::hex; if (slot_count < 21) { DisplayRawData(1, slot_count); return; } switch (m_frame[20]) { case RDMCommand::GET_COMMAND: case RDMCommand::SET_COMMAND: DisplayRDMRequest(1, slot_count); break; case RDMCommand::GET_COMMAND_RESPONSE: case RDMCommand::SET_COMMAND_RESPONSE: DisplayRDMResponse(1, slot_count); return; case RDMCommand::DISCOVER_COMMAND: DisplayDiscoveryCommand(1, slot_count); break; /* case RDMCommand::DISCOVER_COMMAND_RESPONSE: DumpDiscover(length - 1, data + 1); return; */ default: DisplayRawData(1, slot_count); } }
/** * Display a non (DMX/RDM) frame */ void RDMSniffer::DisplayAlternateFrame() { unsigned int slot_count = m_frame.Size() - 1; cout << "SC 0x" << std::hex << std::setw(2) << static_cast<int>(m_frame[0]) << " " << std::dec << slot_count << ":" << std::hex; unsigned int slots_to_display = std::min( slot_count, static_cast<unsigned int>(m_options.dmx_slot_limit)); DisplayRawData(1, 1 + slots_to_display); }
/** * Display a non (DMX/RDM) frame */ void RDMSniffer::DisplayAlternateFrame() { unsigned int slot_count = m_frame.Size() - 1; MaybePrintTimestamp(); cout << "SC " << ToHex(m_frame[0]) << " " << slot_count << ":"; unsigned int slots_to_display = std::min( slot_count, static_cast<unsigned int>(m_options.dmx_slot_limit)); DisplayRawData(1, slots_to_display); }
/** * Display a DMX Frame */ void RDMSniffer::DisplayDmxFrame() { unsigned int dmx_slot_count = m_frame.Size() - 1; cout << "DMX " << std::dec; if (m_options.dmx_slot_limit < dmx_slot_count) cout << m_options.dmx_slot_limit << "/"; cout << dmx_slot_count << ":" << std::hex; unsigned int slots_to_display = std::min( dmx_slot_count, static_cast<unsigned int>(m_options.dmx_slot_limit)); DisplayRawData(1, 1 + slots_to_display); }
/** * Display an RDM Frame. */ void RDMSniffer::DisplayRDMFrame() { unsigned int slot_count = m_frame.Size() - 1; auto_ptr<RDMCommand> command( RDMCommand::Inflate(reinterpret_cast<const uint8_t*>(&m_frame[1]), slot_count)); if (command.get()) { if (!m_options.summarize_rdm_frames) { cout << "---------------------------------------" << endl; } if (!m_options.summarize_rdm_frames && m_options.timestamp) { cout << endl; } MaybePrintTimestamp(); command->Print(&m_command_printer, m_options.summarize_rdm_frames, m_options.unpack_param_data); } else { MaybePrintTimestamp(); DisplayRawData(1, slot_count); } }