We use cookies on this site to enhance your user experience. By using this site, you are giving your consent for us to set cookies.


You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Information related to translation or use of Protocol Buffers (a.k.a. protobuf), together with the common data or service model.


Purpose:

  • As a means to define an efficient binary serialization format
  • As a means to reuse code-generators for skeleton-code to work with VSS data in various languages.

Alternatives:

  • AVRO?

Useful links:


Concerns

  • How to decide on groups of parts
  • You have to provide all sub-branches even if only interested in one leaf - especially where a branch has both sub-branches and leaves, this is unexpected.
  • Some groups make sense always, e.g. GPS.{Lat,Long}
  • optionality is supported in Protobuf.  Should all branches/leaves even be optional in the message definition?

One translation proposal encodes each branch as its own type (protobuf: message) .  Leaves are, but branches (message types) containing branches (other message types) are also shown:

Example translation VSS -> Protobuf
message VehicleBodyWindshieldFrontHeating {
  bool Status = 1;
}

message VehicleBodyWindshieldFrontWasherFluid {
  bool LevelLow = 1;
  uint32 Level = 2;
}

message VehicleBodyWindshieldFront {
  VehicleBodyWindshieldFrontWiping Wiping = 1;
  VehicleBodyWindshieldFrontHeating Heating = 2;
  VehicleBodyWindshieldFrontWasherFluid WasherFluid = 3;
}

message VehicleBodyWindshieldRearWiping {
  string Status = 1;
}

message VehicleBodyWindshieldRearHeating {
  bool Status = 1;
}

message VehicleBodyWindshieldRearWasherFluid {
  bool LevelLow = 1;
  uint32 Level = 2;
}

message VehicleBodyWindshieldRear {
  VehicleBodyWindshieldRearWiping Wiping = 1;
  VehicleBodyWindshieldRearHeating Heating = 2;
  VehicleBodyWindshieldRearWasherFluid WasherFluid = 3;
}

message VehicleBodyWindshield {
  VehicleBodyWindshieldFront Front = 1;
  VehicleBodyWindshieldRear Rear = 2;
}

message VehicleBodyLights {
  bool IsHighBeamOn = 1;
  bool IsLowBeamOn = 2;
  bool IsRunningOn = 3;
  bool IsBackupOn = 4;
  bool IsParkingOn = 5;
  bool IsBrakeOn = 6;
  bool IsRearFogOn = 7;
  bool IsFrontFogOn = 8;
  bool IsHazardOn = 9;
  bool IsLeftIndicatorOn = 10;
  bool IsRightIndicatorOn = 11;
}

  • No labels