You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made somewhat of a bad design design a long time ago and choose the bytes type to represent a set of color values. It looks like it's possible (maybe?) to extend ts-proto to change the processing of these fields, but I can't tell how.
I have entries in my protobuf messages that look like this:
bytes color = 4 [(nanopb).max_size = 4, (nanopb).fixed_length = true]; // Color for the led strip in RGBW in brightness value (0-255) in [R, G, B, W] order
What i'd like to do is end up with a type that looks like a tuple [number, number, number, number] and then have encode/decode to turn it back into a Uint8Array and array respectively. is that possible?
I admit to being somewhat unfamiliar here with the best protobuf approaches, since most of the discussions tend to be related to remote services, rather than say dealing with embedded devices.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I made somewhat of a bad design design a long time ago and choose the bytes type to represent a set of color values. It looks like it's possible (maybe?) to extend ts-proto to change the processing of these fields, but I can't tell how.
I have entries in my protobuf messages that look like this:
What i'd like to do is end up with a type that looks like a tuple
[number, number, number, number]
and then haveencode/decode
to turn it back into aUint8Array
andarray
respectively. is that possible?I admit to being somewhat unfamiliar here with the best protobuf approaches, since most of the discussions tend to be related to remote services, rather than say dealing with embedded devices.
Beta Was this translation helpful? Give feedback.
All reactions