[protobuf] Re: Trying to rewrite a protobuf message but changing a couple of values

2023-09-20 Thread Florian Enner
ion I could think of, but I'm doing > something wrong. > > Not sure if you can help me a bit more to solve this. > > Anyways thanks. > > Joan. > > > > > > On Wednesday, September 20, 2023 at 11:56:19 AM UTC+2 Florian Enner wrote: > >> Messages ar

[protobuf] Re: Trying to rewrite a protobuf message but changing a couple of values

2023-09-20 Thread Florian Enner
of the timespan (in units of the selected > scale) > TimeSpanScale scale = 2; // the scale of the timespan [default = DAYS] > enum TimeSpanScale { > DAYS = 0; > HOURS = 1; > MINUTES = 2; > SECONDS = 3; > MILLISECONDS = 4; > TICKS = 5; > > MIN

[protobuf] Re: Trying to rewrite a protobuf message but changing a couple of values

2023-09-20 Thread Florian Enner
1) A "varint" is a "variable length integer". When you replace a large number with a small one, it's entirely possible to lose some bytes and still be valid. You need to check the actual output. 2) Can you provide the proto definition of the field you want to modify? Scalar fields get set to th

[protobuf] Re: Benchmarks for protoc buffer?

2023-06-06 Thread Florian Enner
There are many community benchmarks that include protobuf and/or grpc, but whether they are representative of your use case is a different question. Most comparisons I've seen are either basic, use suboptimal message definitions, or have been specifically designed to make Protobuf look bad (e.g

[protobuf] Re: Streaming protobuf

2023-05-09 Thread Florian Enner
You could manually iterate through the data and only check for that field, e.g., in Java (untested): import com.google.protobuf.CodedInputStream; import com.google.protobuf.WireFormat; private static boolean containsHotels(byte[] data) throws IOException { return containsField(CodedInputStream.n

[protobuf] Re: Protobuf usage from TwinCAT C++

2023-04-17 Thread Florian Enner
Protobuf has no system API dependencies. I haven't worked with TwinCAT before, but I've used Protobuf C++ on some embedded systems w/ RTOS. There are also a few 3rd party implementations that specifically focus on embed

[protobuf] Re: Tips for debugging custom Java Protobuf plugin

2023-02-19 Thread Florian Enner
I created a second plugin that creates a binary file containing the raw request message. The generated files can then easily be loaded in unit tests. The code is in ParserPlugin