Fix MUID serialization regression by changing 7-bit to 8-bit shifts #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix MUID serialization regression by changing 7-bit to 8-bit shifts
Problem
PR #22 introduced a regression in MUID (MIDI Unique Identifier) serialization where deserialization incorrectly used 7-bit shifts (
<< 7,<< 14,<< 21) instead of proper 8-bit shifts (<< 8,<< 16,<< 24). This caused MUID values to be treated as packed 28-bit values instead of proper 32-bit values.Solution
Fixed all MUID deserialization in
src/midi-ci/messages/Messenger.cppby changing:source_muidanddest_muidparsing (lines 236-237)target_muidparsing in INVALIDATE_MUID messages (line 269)max_sysexparsing in DISCOVERY_REPLY and DISCOVERY_INQUIRY messages (lines 258, 376)Changes Made
<< 7,<< 14,<< 21to<< 8,<< 16,<< 24for MUID fieldsserialize_muid_32()function which uses 8-bit shifts for serializationtest_message_serialization.cppTesting
The changes ensure MUID serialization and deserialization are consistent:
serialize_muid_32()uses>> 8,>> 16,>> 24<< 8,<< 16,<< 24InvalidateMUIDSerializetest expects 8-bit shift patternLink to Devin run
https://app.devin.ai/sessions/309658372ab54a69ab1a3d7dce83412f
Requested by: Atsushi Eno (atsushieno@gmail.com)