-
Notifications
You must be signed in to change notification settings - Fork 191
Rewrite PKSM Bridge protocol to support dynamic file size. #1327
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
base: master
Are you sure you want to change the base?
Conversation
This commit introduces the PKSM Bridge Protocol (v1), which is a simple protocol on top of the TCP connection to allow for future changes through versioning and transmitting dynamic file sizes. NOTE: This commit adds new strings. I just put them all in english for now. I'll need assistance from the community to translate them all into the respective languages.
Finally revived this after the long disruption that as COVID. Please let me know what feedback and thoughts people have. I'm open to changes and suggestions. Thanks! |
Hi! I really like the way this seems to work, abstracting all of that away. I have one major follow-up question: would you happen to have a way to make this interruptible from the receiving end? The way it currently works is by completely blocking on the PKSM side, which isn't very user-friendly. If not, this is still a great upgrade from the previous version, and thank you so much for it. Also, don't worry about the conflicts, I should be able to handle that myself |
I haven't looked into it, but I don't see why it wouldn't be possible. (I think a nice progress bar would also go a long way. Right now you're just locked up until it either fails or completes after some time.) I'm still fairly new to 3DS programming, but I'm happy to look into it. Would you prefer to roll that up in to this PR? Or to handle that as a subsequent improvement? |
The 3DS side can be easily handled; I'm thinking providing a "should cancel" and a "report progress" callback should be sufficient? I just have no idea how to do non-blocking socket reads |
If I understand correctly, select allows for checking if there's data to read and setting a timeout. I haven't tried it, so I might be wrong in that it can't do that or that it's not available on 3DS. |
How's the state of this PR? I'd gladly merge it if there's no change on Checkpoint's side and the feature here still works |
It's been a while. I'd have to rebase and test this again. It would require changes to checkpoint as well, though. Which would need to be proposed in its own PR. IIRC I was testing this with local changes to Checkpoint to build a switch nro with this new protocol included. |
We're open to integrate the new protocol in Checkpoint as well |
This commit introduces the PKSM Bridge Protocol (v1), which is a simple protocol on top of the TCP connection to allow for future changes through versioning and transmitting dynamic file sizes.
NOTE: This commit adds new strings. I just put them all in english for now. I'll need assistance from the community to translate them all into the respective languages.
This logic will also need to be brought to Checkpoint, which will be proposed separately.
The
pksmbridge_api
andpksmbridge_tcp
files are generic and could benefit from being pulled into their own dependency repo. Otherwise similar logic needs to be implemented across any clients that want to send/receive files using the same protocol.TESTED: Tested using this build of PKSM and a build of Checkpoint (for Switch) using the same protocol files. Sent across Pokemon Sword, modified the boxes and sent it back. Then I confirmed that the pokemon were updated at both ends of the round-trip.