Questions tagged [protobuf-c]

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data

in this context, protobuf-c is strong related to c because the automatically generated code is C headers and implementation.

From the official site:

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.

205 questions
0
votes
1 answer

Find unused protobuf messages

We have a large project with many proto-files. Many of those contain messages that are no longer used anywhere, and hence I'd like to delete them. However, due to the size of the project, it's non-trivial to see, which of those messages are still…
0
votes
1 answer

sigsegv Using MessageDifferencer on proto messages

I am a novice trying to use google protobuf for work project. I want to find out difference between protobuf messages and hence trying to use the MessageDifferencer APIs. I get the SEGV while running the code below. Commenting the line…
maddypj
  • 1
  • 1
0
votes
1 answer

Protobuf exception when allocating memory for string in dll

I am using protobuf 3 to serialize a simple message. I get a bad alloc when i set a string value for one of the memebers of my protobuf message like so. std::string a("eeee"); hello_in.set_name(a); The bad alloc exception happens in the…
ariia
  • 63
  • 1
  • 7
0
votes
1 answer

Why does the following CMakeLists.txt cannot generate the output file of series of *.proto(protobuf)

I am not familiar with cmake and protobuf. I want to write a CMakeLists.txt to help me generate all protobuf file in a specified directory into another specified directory. The following is the CMakeLists.txt I writen, but it cannot generate any…
JYP2011
  • 23
  • 5
0
votes
1 answer

how to inherit C++ classes generated by protobuf

I have created one message mesage 1 { member1, } after compilation it generates c++ code, How can we inherit generated classes. after inheriting, getting below error cannot derive from ‘final’ base
Virus
  • 1
  • 1
0
votes
1 answer

How to set repeated of repeated elements in proto3

I'm having these two definitions in my .proto: // all the shards on a server message ConfigEntry { repeated Shard shards = 2; string server = 3; } // information on all the groups message QueryResponse { repeated ConfigEntry config =…
Alrasheed
  • 11
  • 3
0
votes
0 answers

Protobuf (C++) throws "missing required parameter" error for optional field

I'm communicating between embedded device that uses nanopb and desktop PC that uses protobuf-c, but get an error when parsing encoded message. Embedded device sends a message, "Response" with an optional field that is of a different message type…
dimipage
  • 1
  • 2
0
votes
0 answers

protobuf: Difference between new Prototype() and Prototype.Clear()

for two pieces of codes for (loop) { ProtoType instance; // do something with instance; } /* --------------- */ ProtoType instance; for (loop) { // do something with instance; instance.Clear(); } I got core dump with the latter…
artour
  • 1
0
votes
1 answer

Problems with repeated field in Protobuf. What is a better way to use the repeated field for serialization/deserialization?

Consider the following sensor.proto file that makes use of the repeated field to initialize multiple messages. syntax = "proto3"; package HUBSensors; message Device { string name = 1; int32 id = 2; message Sensor { string name…
bad_locality
  • 135
  • 2
  • 12
0
votes
2 answers

Using protoc inside CMakeLists from a non-standard directory gives "cannot open shared object file: No such file or directory" error

I have a C application using CMake to generate Makefiles on Linux. The application contains .c as well as .proto files. Now I need to genearte .pb-c.c and .pb-c.h using protoc command in the CMakeLists.txt so that when I do cmake . the cmake…
Yug Singh
  • 3,112
  • 5
  • 27
  • 52
0
votes
1 answer

Different predictions from pb and h5 file

I have followed the implementation of this medium post to deploy my Keras model to Android. I have used Dense layers having 9 nodes along with softmax activation in the output layer, as opposed to the Global Average Pooling used in the post. My h5…
Preetom Saha Arko
  • 2,588
  • 4
  • 21
  • 37
0
votes
2 answers

How do I know what the json for a protobuff should be formatted like?

I'm new to protobuf's, and I'd like to save some protobuf's to json format, and know what the full format for the protobuf is. I've tried just creating an empty instance of the protobuf, and saving it to json, but that only gives me an empty json…
Brad Parks
  • 66,836
  • 64
  • 257
  • 336
0
votes
1 answer

sending protobufs file to an API endpoint

so i have an API endpoint, which is supposed to get protobufs bin files. it is written in C# and use the protobufs-net. when i try to send the file to this endpoint, i get the following error: RUnexpected end-group in source data; this usually means…
0
votes
1 answer

pod spec lint error: could not build module 'Protobuf', file not found: #import "google/protobuf/Any.pbobjc.h"

I want push some code into master pod, this code depend on Protobuf. s.dependency 'Protobuf', '3.3.0' I had tried the follow three method to resolve it. But I failed. # method 1 s.xcconfig = { # we have a math.h which conflicts with the…
0
votes
1 answer

How to access protoc compiler in own Yocto package and reference to gRPC libs

I have some problems to build my own package "grpcSandbox", which depends on gRPC and protobuf. There already exists recipes for gRPC and protobuf which builds well. The problem is: cmake project of grpcSandbox requires the directory of gRPC…
ThomasD13
  • 3
  • 1
  • 2