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

Question: numeric value conversion ambiguity #453

Open
1 task done
malessainray opened this issue May 10, 2023 · 6 comments
Open
1 task done

Question: numeric value conversion ambiguity #453

malessainray opened this issue May 10, 2023 · 6 comments
Labels
question Further information is requested

Comments

@malessainray
Copy link

What do you want to know?

I'm struggling with transmitting values of types other than the directly used protobuf types.
For example, to send an int8 I was unable to find any hint in the specification how I should convert the possibly negative int8 value to a uint32 for encoding through protobuf. Could you please point me towards the proper definition of how values must be converted to ensure cross implementation compatibility? As it's ambiguous how values must be converted between datatypes and the specification requires implementations to convert numeric values for transmission I beliebe that the specification shall provide at the very least guidance, or at best specify how values must be converted. Otherwise, cross implementation compatibility cannot be guaranteed, even if all implementations perfectly adhere to the specification.

Is this related to a Sparkplug Listing request? If so, link the issue from https://github.com/eclipse-sparkplug/sparkplug.listings here.

No response

Version

None

Accept EFTL Terms

  • I agree to the terms of EFTL
@malessainray malessainray added the question Further information is requested label May 10, 2023
@bryce-nakatani
Copy link

bryce-nakatani commented May 11, 2023 via email

@malessainray
Copy link
Author

Thanks for your reply! What you describe is what I initially assumed and was successful with for initial tests.
But when using C#, simply casting a negative value to an unsigned integer will result in an exception, and since the Sparkplug spec specifies that signed integers must be converted to unsigned protobuf values for the transport layer, and the spec doesn't declare how the conversion must be performed both from a signed value to an unsigned one and vice versa, it is at best a guess to implement a conversion. One might conclude that the spec is missing a section when relying on all implementations behaving identically when casting a negative value to an unsigned integer and back.
I suggest that the next iteration of the spec includes such section on value conversion to ensure compatibility across applications. I'd appreciate it if it were possible to get a draft of the above section.

@bryce-nakatani
Copy link

bryce-nakatani commented May 17, 2023 via email

@SeppPenner
Copy link

@bryce-nakatani Is there and ETA when v4 will be available?

@bryce-nakatani
Copy link

bryce-nakatani commented Dec 7, 2023 via email

@SeppPenner
Copy link

Based on time and resources, perhaps late 2024. We could always use the help.

On Thu, Dec 7, 2023 at 8:28 AM HansM @.> wrote: @bryce-nakatani https://github.com/bryce-nakatani Is there and ETA when v4 will be available? — Reply to this email directly, view it on GitHub <#453 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEF6AZRBF667ER2J6VP3NWLYIHVCXAVCNFSM6AAAAAAX4LFTW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBVGY2TINRYGA . You are receiving this because you were mentioned.Message ID: @.>

Well yeah... I'm already quite busy with keeping my Sparkplug library for C# up-to-date at the moment :D

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

No branches or pull requests

3 participants