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

Init Packet Dissection on iOS #472

Open
Crudough opened this issue Mar 1, 2022 · 6 comments
Open

Init Packet Dissection on iOS #472

Crudough opened this issue Mar 1, 2022 · 6 comments

Comments

@Crudough
Copy link

Crudough commented Mar 1, 2022

DFU Bootloader version (please complete the following information):

  • SDK version: N/A
  • Bonding used: N/A
  • Library version: 4.11.1

Device information (please complete the following information):

  • Device: N/A
  • OS: N/A

Your question
Waiting on PR#396 to expose the initPacket as public through the DFUFirmware class. In the meantime, I have forked the repo, made the change locally and continued my testing and development. I am unsure as to how best to dissect the information stored in the initPacket with my current interest being the type field.

I have been utilizing the protobuf message definitions listed in Nordic's nrfutil repo here. The current workflow I'm attempting is as follows, select my DFU Package -> create my DFUFirmware object in code through the DFUManager-> if successful then deserialize the initPacket into the InitCommand to find the packet type (**) -> continue with the rest of the DFU as normal.

(**) This deserialization into the protobuf structure is successful however I cannot seem to extract the type out of the initPacket which I have confirmed as .externalApplication through nrfutil pkg display command.

@Crudough Crudough changed the title Init Packet Disection on iOS Init Packet Dissection on iOS Mar 1, 2022
@philips77
Copy link
Member

Why do you want to get the type, if I may ask?

Also, why do you need #396 exactly? For sending the firmware to Flutter? Serializing to protobuf?

@Crudough
Copy link
Author

Crudough commented Mar 2, 2022

Hi @philips77,

Thank you for responding here!
I need a way to programmatically detect the application type from the initPacket data to direct internal behaviour and sequencing. We use this in other ways but not through the iOS DFU Manager (ex. by using nrfutil pkg display as mentioned above).

As far as I'm aware #396 is the only way of accessing the initPacket from an incoming DFU package. After accessing the initPackage I am hoping to deserialize the data to protobuf using InitComand(serializedData: stream.initPacket from the Swift code generated from dfu_cc.proto. If there is an alternate way to access the type that does not drive a change please do let me know. Forking and manipulating the class to test has proven problematic with the Swift Package Manager.

@philips77
Copy link
Member

So you'll be more interested in getting the fw type than the data, right?

@Crudough
Copy link
Author

Crudough commented Mar 7, 2022

Correct, apologies for the slow response!

@philips77
Copy link
Member

I can see what can be done. Thank you for opening the issue.

@Crudough
Copy link
Author

Appreciate that @philips77! Looking forward to hearing back from you!

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

No branches or pull requests

2 participants