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

Wrong decoding on WPT Messages #26

Open
famnz opened this issue Jan 29, 2025 · 1 comment
Open

Wrong decoding on WPT Messages #26

famnz opened this issue Jan 29, 2025 · 1 comment

Comments

@famnz
Copy link

famnz commented Jan 29, 2025

Hello, for security reasons I can not uplad whole pcap files but I will try to give you as much context as I can, we use the wireshark plugin https://github.com/dspace-group/dsV2Gshark that base their decoding in cbexigen.
I,ve noticed that the message WPT_FinePositioningSetup when there is no SpecificDataContainer or LF_SystemSetupData is being decoded as ServiceSelectionRes

Image

I've traced this issue because while encoding our message since there are no DataContainers after the NaturalOffset element we set the eventCode as 2 which means end element. But while decoding it treats it as EXI_ERROR__UNKNOWN_EVENT_CODE

https://raw.githubusercontent.com/dspace-group/dsV2Gshark/refs/heads/main/V2G_Libraries/Third_Party/cbv2g/iso-20/iso20_WPT_Decoder.c Line 21129

@barsnick
Copy link
Contributor

Too bad GitHub cannot render or inline this large file's link as code:

https://github.com/dspace-group/dsV2Gshark/blob/0914449f0accf229763f8a642f58f625a9e02f70/V2G_Libraries/Third_Party/cbv2g/iso-20/iso20_WPT_Decoder.c#L21129

after the NaturalOffset element we set the eventCode as 2 which means end element

Whom do you mean with "we"? Who encoded this?

From a quick look, this code looks correct: The event code should be either 0 (in presence of a VendorSpecificDataContainer) or 1 (in case of END element).

You can try extracting the offending message and its neighbors from the PCAP using tshark. probably with something like
tshark -r input.pcap -Y "frame.number >= 27 && frame.number <= 29" -w output.pcap

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

No branches or pull requests

2 participants