customoptions.proto 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. syntax = "proto3";
  2. import "google/protobuf/descriptor.proto";
  3. import "nanopb.proto";
  4. // Extend the field options
  5. message CustomOptions {
  6. bool init_from_mac = 50001; // Unique identifier for the option
  7. string const_prefix = 50002 [(nanopb).type = FT_POINTER]; // Unique identifier for the option
  8. bool read_only = 50003;
  9. oneof default_value {
  10. string v_string = 50050 [(nanopb).type = FT_POINTER];
  11. uint32 v_uint32 = 50051;
  12. int32 v_int32 = 50052;
  13. uint64 v_uint64 = 50053;
  14. int64 v_int64 = 50054;
  15. double v_double = 50055;
  16. float v_float = 50056;
  17. bool v_bool = 50057;
  18. string v_enum = 50058 [(nanopb).type = FT_POINTER];
  19. bytes v_bytes = 50059 [(nanopb).type = FT_POINTER];
  20. }
  21. string global_name = 50005 [(nanopb).type = FT_POINTER];
  22. }
  23. extend google.protobuf.FileOptions {
  24. optional CustomOptions cust_file = 2010;
  25. }
  26. extend google.protobuf.MessageOptions {
  27. optional CustomOptions cust_msg = 2010;
  28. }
  29. extend google.protobuf.EnumOptions {
  30. optional CustomOptions cust_enum = 2010;
  31. }
  32. extend google.protobuf.FieldOptions {
  33. optional CustomOptions cust_field = 2010;
  34. }