Network.proto 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. syntax = "proto3";
  2. import "google/protobuf/timestamp.proto";
  3. package sys;
  4. import "customoptions.proto";
  5. import "nanopb.proto";
  6. enum WifiAuthTypeEnum{
  7. AUTH_UNKNOWN = 0;
  8. AUTH_OPEN = 1;
  9. AUTH_WEP = 2;
  10. AUTH_WPA_PSK = 3;
  11. AUTH_WPA2_PSK = 4;
  12. AUTH_WPA_WPA2_PSK = 5;
  13. AUTH_WPA2_ENTERPRISE = 6;
  14. AUTH_WPA3_PSK = 7;
  15. AUTH_WPA2_WPA3_PSK = 8;
  16. AUTH_WAPI_PSK = 9;
  17. }
  18. enum WifiRadioTypesEnum {
  19. PHY_UNKNOWN = 0;
  20. PHY_11B = 1;
  21. PHY_11G = 2;
  22. PHY_11N = 3;
  23. PHY_LR = 4;
  24. PHY_WPS = 5;
  25. PHY_FTM_RESPONDER = 6;
  26. PHY_FTM_INITIATOR = 7;
  27. }
  28. message IP {
  29. option (nanopb_msgopt).msgid = 10051;
  30. string ip = 14 [(nanopb).max_length = 15];
  31. string netmask = 15 [(nanopb).max_length = 15];
  32. string gw = 16 [(nanopb).max_length = 15];
  33. }
  34. message WifiSTAEntry {
  35. string ssid = 1 [(nanopb).max_length = 32];
  36. string bssid = 2 [(nanopb).max_length = 32];
  37. uint32 channel = 3 [(nanopb).int_size = IS_8]; /**< channel of target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. If the channel of AP is unknown, set it to 0.*/
  38. WifiAuthTypeEnum auth_type = 4;
  39. WifiRadioTypesEnum radio_type = 5;
  40. google.protobuf.Timestamp last_try = 6;
  41. google.protobuf.Timestamp last_seen = 7;
  42. bool connected = 8;
  43. string password = 9 [(nanopb).max_length = 64];
  44. uint32 rssi = 10 [(nanopb).max_length = 8];
  45. }
  46. message WifiAP {
  47. IP ip = 1;
  48. string password = 2 [(nanopb).max_length = 64];
  49. uint32 channel = 3 [(nanopb).int_size = IS_8]; /**< channel of Access point AP. */
  50. WifiAuthTypeEnum auth_mode = 4 [(cust_field).v_enum = "AUTH_WPA2_PSK"];
  51. bool hidden = 5;
  52. // Max allowed connections. 4 is recommended
  53. uint32 max_connection = 6 [(nanopb).int_size = IS_8];
  54. // Recommended value: 100
  55. uint32 beacon_interval = 7 [(nanopb).int_size = IS_16];
  56. }
  57. message Server {
  58. option (nanopb_msgopt).msgid = 10050;
  59. int32 cport = 1;
  60. int32 port = 2;
  61. string ip = 3 [(nanopb).max_length = 15];
  62. }
  63. message NetworkConfig {
  64. bool disable_dhcp = 1;
  65. IP manual_ip = 2;
  66. // Wifi Credentials
  67. repeated WifiSTAEntry credentials = 3 [ (nanopb).max_count = 5 ];
  68. WifiAP ap = 4;
  69. WifiSTAEntry last_connected = 5 ;
  70. }