fmckeogh / usb-pd-rs

USB-PD and associated hardware driver libraries in Rust
MIT License
19 stars 4 forks source link

Add some structured VDO's and the capability to send a response to a discover identity VDM #5

Open bentwire opened 8 months ago

bentwire commented 8 months ago

Working on a patch to add some VDOs and a way to reply to discover identity from upstream.

bentwire commented 8 months ago

Some of the messages are already in the pdo.rs file from the last stuff I added. Should I move this to a vdo.rs file?

fmckeogh commented 8 months ago

@bentwire Go for it, unless you think it makes sense to have a shared module, with sibling vdo and pdo modules?

bentwire commented 8 months ago

I guess it would depend on the use case. What would the shared module be named?

BTW I get some activity when I send an ack back to the DiscoverIdentity my laptop sends, so I think at least that works.

I can't send a discover identity to the laptop and get a response however... Maybe its not supposed to work that way... Still kinda fuzzy on who SOP' SOP'' SOP''' are... I get good CRC back though so maybe my laptop just does not support the command...

fmckeogh commented 8 months ago
messages/
    mod.rs
    vdo.rs
    pdo.rs

Hmm, I assumed that would always have a response from the other side. Also not sure about the start of packet tokens, I'll need to re-read the spec.

bentwire commented 4 months ago

@fmckeogh Finally had a chance to do the merge and test your embassy branch. It seems to work really well if you want to make the change official.

Also let me know where you want the message refactoring I did to go.

fmckeogh commented 4 months ago

@bentwire Yeah for sure, glad it works for you, I burnt out the dev setup so going to try build a new one haha

Does your PR include the merge of the embassy branch? Or would you prefer I merge that in first, then you can rebase your message refactoring on top? I'm happy either way, thanks so much for your work:)

bentwire commented 4 months ago

@fmckeogh The PR I just created is to merge the vdo changes I made with your embassy branch.

I've not rebased anything to main yet. Was not sure what order you wanted to do.

Hey no problem, its been fun :)