Wireshark dissector for Pro DJ Link protocol
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix disconnect / genre collision

Stella cad06167 03bc726b

+28 -16
+28 -16
pro_dj_link.lua
··· 709 709 -- Message Type 710 710 local m_type = 0 711 711 if msg_len - (current - off) >= 3 then 712 - local bytes_read, val, m_type_item = dissect_db_field(buf, current, msg_tree, nil, "Message Type") 713 - m_type = val or 0 714 - local m_type_str = DB_MSG_TYPES[m_type] or string.format("Unknown(0x%04x)", m_type) 715 - 716 - if m_type == 0x0100 and tx_id == 0xfffffffe then 717 - m_type_str = "Device Disconnect" 718 - if m_type_item then 719 - m_type_item:set_text("Message Type: " .. m_type_str .. " (0x" .. string.format("%04x", m_type) .. ")") 720 - end 712 + local bytes_read, val, m_type_item = dissect_db_field(buf, current, msg_tree, nil, "Message Type") 713 + m_type = val or 0 714 + local m_type_str = DB_MSG_TYPES[m_type] or string.format("Unknown(0x%04x)", m_type) 715 + 716 + if m_type == 0x1001 then 717 + if tx_id == 0xffffffff then 718 + m_type_str = "Disconnect Acknowledgment" 719 + else 720 + m_type_str = "Genre Menu" 721 721 end 722 - 723 - table.insert(db_types, m_type_str) 724 - 725 - current = bytes_read 726 - msg_tree:append_text(": " .. m_type_str) 722 + elseif m_type == 0x0100 and tx_id == 0xfffffffe then 723 + m_type_str = "Device Disconnect" 727 724 end 728 - 725 + 726 + if m_type_item then 727 + m_type_item:set_text("Message Type: " .. m_type_str .. " (0x" .. string.format("%04x", m_type) .. ")") 728 + end 729 + 730 + table.insert(db_types, m_type_str) 731 + 732 + current = bytes_read 733 + msg_tree:append_text(": " .. m_type_str) 734 + end 729 735 -- Arg Count 730 736 local arg_count = 0 731 737 if msg_len - (current - off) >= 2 then ··· 763 769 if m_type == 0x4000 then 764 770 if i == 1 and val then 765 771 local ack_type_str = DB_MSG_TYPES[val] or string.format("0x%04x", val) 772 + 773 + -- Resolve collision if it's the Genre menu message type (0x1001) 774 + if val == 0x1001 and tx_id ~= 0xffffffff then 775 + ack_type_str = "Genre Menu" 776 + end 777 + 766 778 msg_tree:append_text(" - " .. ack_type_str) 767 - db_types[#db_types] = "Ack " .. ack_type_str 779 + db_types[#db_types] = "Ack - " .. ack_type_str 768 780 elseif i == 2 and val then 769 781 msg_tree:append_text(": " .. val .. " Items") 770 782 db_types[#db_types] = db_types[#db_types] .. ": " .. val .. " Items"