Duh, the solution was simple, I was confused with the repeated entry
fields.

On Aug 11, 5:25 pm, Jun8 <[email protected]> wrote:
>         myevents::Event e;
>         e.set_task_id( taskID );
>         e.set_module_name( moduleName );
>
>         // Create a status event
>         myevents::StatusEvent* se = e.AddExtension( myevents::status_event );

Should be

    myevents::StatusEvent* se =
e.MutableExtension(diva::events::status_event);

Now, I can send the event. To test my reception I do

    myevents::Event e;
    e.ParseFromString(text);
    std::cout << "Received event: " << std::endl << e.DebugString() <<
std::endl;

However, this produces

libprotobuf ERROR google/protobuf/message_lite.cc:123] Can't parse
message of type "myevents.Event" because it is missing required
fields: task_id, module_name
Received event:

Received event:
task_id: 1
module_name: "face_detector"
[diva.events.status_event] {
  type: MODULE_START
  data {
    key: "keyframe_width"
    value: "360"
  }
}

I couldn't figure out the error message, the fields are clearly there.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to