4.3.6 Interface conventions

OSI messages, enums, field messages, and field enums shall comply with OSI interface conventions. These conventions ensure that message definitions and the corresponding classes are consistently named and easy to read.

Message names shall use PascalCase.

message EnvironmentalConditions
{
}

Message field names shall use snake_case.

message EnvironmentalConditions
{
    optional double atmospheric_pressure = 1;
}

Enum names shall use PascalCase.

message EnvironmentalConditions
{
    optional double atmospheric_pressure = 1;

    enum AmbientIllumination
    {
    }
}

Enum field value names shall use UPPER_SNAKE_CASE. Enum field value names shall always be prefixed with the name of the corresponding enum.

For enum fields that are concerned with ground truth or sensor data, the first two enum values shall always be defined with the following rules: The first enum field value shall always use the suffix UNKNOWN. The second enum field value shall always use the suffix OTHER.

message EnvironmentalConditions
{
    optional double atmospheric_pressure = 1;

    enum AmbientIllumination
    {
        AMBIENT_ILLUMINATION_UNKNOWN = 0;

        AMBIENT_ILLUMINATION_OTHER = 1;

        AMBIENT_ILLUMINATION_LEVEL1 = 2;
    }
}

Other enum fields, especially purely technical fields, can deviate from the rules for the first two field values.