Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing to send data to Garmin devices #4

Merged
merged 2 commits into from
Nov 4, 2022

Conversation

CodyJung
Copy link

@CodyJung CodyJung commented Nov 4, 2022

The fix made in PR #1 wasn't the complete fix for devices that support split header/payload functionality, like Garmin devices. It turns out that once either side has switched to that "separate" mode, both sides need to communicate in that format:

image

To that end, this patch turns on d.SeparateHeader mode (which apparently is already implemented but was unused?) if we think that the device might be in that mode.

In theory ganeshrvel/openmtp#153 should be fixed but despite being able to get go-mtpfs working:
Screen Shot 2022-11-03 at 10 16 31 PM

And go-mtpx unit tests mostly passing (the watch seems to get into a bad state at one point near the end of the tests and doesn't reconnect):
Screen Shot 2022-11-03 at 10 24 42 PM

I haven't been able to get OpenMTP to list files out yet. 😞

Although a previous change fixed how we receive data from devices that split their header and data, the MTP spec indicates that the initiator *also* needs to switch into that mode when sending.

This patch sets the SeparateHeader flag if we suspect that the device is communicating in split header/data mode.
Noticed this while testing - probably unnecessarily verbose otherwise. :)
@ganeshrvel ganeshrvel changed the base branch from master to fix/garmin November 4, 2022 07:44
@ganeshrvel ganeshrvel merged commit 0d40588 into ganeshrvel:fix/garmin Nov 4, 2022
@ganeshrvel
Copy link
Owner

I have merged your pr and the test cases seems to be working fine. The mtp device does in fact go crazy after running the whole bunch of test cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants