feat: implement BLE provisioning protocol, rudimentary UI
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
syntax = "proto3";
|
||||
|
||||
enum Status {
|
||||
Success = 0;
|
||||
InvalidSecScheme = 1;
|
||||
InvalidProto = 2;
|
||||
TooManySessions = 3;
|
||||
InvalidArgument = 4;
|
||||
InternalError = 5;
|
||||
CryptoError = 6;
|
||||
InvalidSession = 7;
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "constants.proto";
|
||||
import "network_constants.proto";
|
||||
|
||||
message CmdGetWifiStatus {
|
||||
}
|
||||
|
||||
message RespGetWifiStatus {
|
||||
Status status = 1;
|
||||
WifiStationState wifi_sta_state = 2;
|
||||
oneof state {
|
||||
WifiConnectFailedReason wifi_fail_reason = 10;
|
||||
WifiConnectedState wifi_connected = 11;
|
||||
WifiAttemptFailed attempt_failed = 12;
|
||||
}
|
||||
}
|
||||
|
||||
message CmdGetThreadStatus {
|
||||
}
|
||||
|
||||
message RespGetThreadStatus {
|
||||
Status status = 1;
|
||||
ThreadNetworkState thread_state = 2;
|
||||
oneof state {
|
||||
ThreadAttachFailedReason thread_fail_reason = 10;
|
||||
ThreadAttachState thread_attached = 11;
|
||||
}
|
||||
}
|
||||
|
||||
message CmdSetWifiConfig {
|
||||
bytes ssid = 1;
|
||||
bytes passphrase = 2;
|
||||
bytes bssid = 3;
|
||||
int32 channel = 4;
|
||||
}
|
||||
|
||||
message CmdSetThreadConfig {
|
||||
bytes dataset = 1;
|
||||
}
|
||||
|
||||
message RespSetWifiConfig {
|
||||
Status status = 1;
|
||||
}
|
||||
|
||||
message RespSetThreadConfig {
|
||||
Status status = 1;
|
||||
}
|
||||
|
||||
message CmdApplyWifiConfig {
|
||||
}
|
||||
|
||||
message CmdApplyThreadConfig {
|
||||
}
|
||||
|
||||
message RespApplyWifiConfig {
|
||||
Status status = 1;
|
||||
}
|
||||
|
||||
message RespApplyThreadConfig {
|
||||
Status status = 1;
|
||||
}
|
||||
|
||||
enum NetworkConfigMsgType {
|
||||
TypeCmdGetWifiStatus = 0;
|
||||
TypeRespGetWifiStatus = 1;
|
||||
TypeCmdSetWifiConfig = 2;
|
||||
TypeRespSetWifiConfig = 3;
|
||||
TypeCmdApplyWifiConfig = 4;
|
||||
TypeRespApplyWifiConfig = 5;
|
||||
TypeCmdGetThreadStatus = 6;
|
||||
TypeRespGetThreadStatus = 7;
|
||||
TypeCmdSetThreadConfig = 8;
|
||||
TypeRespSetThreadConfig = 9;
|
||||
TypeCmdApplyThreadConfig = 10;
|
||||
TypeRespApplyThreadConfig = 11;
|
||||
|
||||
}
|
||||
|
||||
message NetworkConfigPayload {
|
||||
NetworkConfigMsgType msg = 1;
|
||||
oneof payload {
|
||||
CmdGetWifiStatus cmd_get_wifi_status = 10;
|
||||
RespGetWifiStatus resp_get_wifi_status = 11;
|
||||
CmdSetWifiConfig cmd_set_wifi_config = 12;
|
||||
RespSetWifiConfig resp_set_wifi_config = 13;
|
||||
CmdApplyWifiConfig cmd_apply_wifi_config = 14;
|
||||
RespApplyWifiConfig resp_apply_wifi_config = 15;
|
||||
CmdGetThreadStatus cmd_get_thread_status = 16;
|
||||
RespGetThreadStatus resp_get_thread_status = 17;
|
||||
CmdSetThreadConfig cmd_set_thread_config = 18;
|
||||
RespSetThreadConfig resp_set_thread_config = 19;
|
||||
CmdApplyThreadConfig cmd_apply_thread_config = 20;
|
||||
RespApplyThreadConfig resp_apply_thread_config = 21;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
syntax = "proto3";
|
||||
|
||||
enum WifiStationState {
|
||||
Connected = 0;
|
||||
Connecting = 1;
|
||||
Disconnected = 2;
|
||||
ConnectionFailed = 3;
|
||||
}
|
||||
|
||||
enum WifiConnectFailedReason {
|
||||
AuthError = 0;
|
||||
WifiNetworkNotFound = 1;
|
||||
}
|
||||
|
||||
enum WifiAuthMode {
|
||||
Open = 0;
|
||||
WEP = 1;
|
||||
WPA_PSK = 2;
|
||||
WPA2_PSK = 3;
|
||||
WPA_WPA2_PSK = 4;
|
||||
WPA2_ENTERPRISE = 5;
|
||||
WPA3_PSK = 6;
|
||||
WPA2_WPA3_PSK = 7;
|
||||
}
|
||||
|
||||
message WifiConnectedState {
|
||||
string ip4_addr = 1;
|
||||
WifiAuthMode auth_mode = 2;
|
||||
bytes ssid = 3;
|
||||
bytes bssid = 4;
|
||||
int32 channel = 5;
|
||||
}
|
||||
|
||||
message WifiAttemptFailed {
|
||||
uint32 attempts_remaining = 1;
|
||||
}
|
||||
|
||||
enum ThreadNetworkState {
|
||||
Attached = 0;
|
||||
Attaching = 1;
|
||||
Dettached = 2;
|
||||
AttachingFailed = 3;
|
||||
}
|
||||
|
||||
enum ThreadAttachFailedReason {
|
||||
DatasetInvalid = 0;
|
||||
ThreadNetworkNotFound = 1;
|
||||
}
|
||||
|
||||
message ThreadAttachState {
|
||||
uint32 pan_id = 1;
|
||||
bytes ext_pan_id = 2;
|
||||
uint32 channel = 3;
|
||||
string name = 4;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "constants.proto";
|
||||
|
||||
message S0SessionCmd {
|
||||
|
||||
}
|
||||
|
||||
message S0SessionResp {
|
||||
Status status = 1;
|
||||
}
|
||||
|
||||
enum Sec0MsgType {
|
||||
S0_Session_Command = 0;
|
||||
S0_Session_Response = 1;
|
||||
}
|
||||
|
||||
message Sec0Payload {
|
||||
Sec0MsgType msg = 1;
|
||||
oneof payload {
|
||||
S0SessionCmd sc = 20;
|
||||
S0SessionResp sr = 21;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "sec0.proto";
|
||||
|
||||
enum SecSchemeVersion {
|
||||
SecScheme0 = 0;
|
||||
SecScheme1 = 1;
|
||||
SecScheme2 = 2;
|
||||
}
|
||||
|
||||
message SessionData {
|
||||
SecSchemeVersion sec_ver = 2;
|
||||
oneof proto {
|
||||
Sec0Payload sec0 = 10;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user