USB-MIDI 事件数据包中的 Cable Number 字段代表什么?
What does the Cable Number field represents in an USB-MIDI Event packet?
我的 OS 是 Windows 7,我使用 MIDI-OX 作为 MIDI 实用程序,使用 wireshark 作为嗅探器。
目前在STM32上开发一些MIDI应用程序,我很难理解USB-MIDI事件数据包中电缆编号的含义。 USB MIDI Event packet
USB MIDI specification 指出(第 16、4 页):
The Cable Number (CN) is a value ranging from 0x0 to 0xF indicating the number assignment of the Embedded MIDI Jack associated with the endpoint that is transferring the data.
在我的项目中,我有一个 ID 为 3 的嵌入式 Jack OUT。当尝试发送电缆编号设置为 3 的 USB-Midi 事件时,我的 MIDI-OX 无法识别我的 MIDI 消息,尽管它们被 Wireshark 看到了。将电缆编号更改为 0 会使 MIDI OX 识别 MIDI 事件。
但我想了解它为什么会起作用。
我想我混淆了号码分配和 Jack ID,那么这个号码分配是什么?
USB MIDI 规范的第 3.1 节说:
Each Entity within the USB-MIDI function is assigned a unique identification number, the EntityID, contained in the bJackID
or bElementID
field of the descriptor. The value 0x00 is reserved for undefined ID, effectively restricting the total number of addressable Entities in the USB-MIDI function (both Jacks and Elements) to 255.
所以这不能用于 four-bit 电缆编号。
那个"number assignment"指的是下面的算法(大家假装很明显):端点的电缆编号从零到比bNumEmbMIDIJack
少一。
我的 OS 是 Windows 7,我使用 MIDI-OX 作为 MIDI 实用程序,使用 wireshark 作为嗅探器。
目前在STM32上开发一些MIDI应用程序,我很难理解USB-MIDI事件数据包中电缆编号的含义。 USB MIDI Event packet
USB MIDI specification 指出(第 16、4 页):
The Cable Number (CN) is a value ranging from 0x0 to 0xF indicating the number assignment of the Embedded MIDI Jack associated with the endpoint that is transferring the data.
在我的项目中,我有一个 ID 为 3 的嵌入式 Jack OUT。当尝试发送电缆编号设置为 3 的 USB-Midi 事件时,我的 MIDI-OX 无法识别我的 MIDI 消息,尽管它们被 Wireshark 看到了。将电缆编号更改为 0 会使 MIDI OX 识别 MIDI 事件。 但我想了解它为什么会起作用。
我想我混淆了号码分配和 Jack ID,那么这个号码分配是什么?
USB MIDI 规范的第 3.1 节说:
Each Entity within the USB-MIDI function is assigned a unique identification number, the EntityID, contained in the
bJackID
orbElementID
field of the descriptor. The value 0x00 is reserved for undefined ID, effectively restricting the total number of addressable Entities in the USB-MIDI function (both Jacks and Elements) to 255.
所以这不能用于 four-bit 电缆编号。
那个"number assignment"指的是下面的算法(大家假装很明显):端点的电缆编号从零到比bNumEmbMIDIJack
少一。