diff --git a/ToDo.txt b/ToDo.txt index 762dd55..542335f 100644 --- a/ToDo.txt +++ b/ToDo.txt @@ -28,6 +28,9 @@ impact reasonable) WIFI - implement connection to OPEN-AUTH network as STA - implement nexmon firmware support (not for first release) +- implement failover from STA to AP (if connection fails) +- add Option to reconfigure Wifi Ethernet Interface settings to DHCP client mode, when WiFi mode is station +- fall back to old settings, if deployment of WiFi settings fails BLUETOOTH: - configuration cpabilities for BNEP/NAP on server, keep in mind BLE use cases (idea of stand-alone proxy) diff --git a/proto/gopherjs/grpc.pb.gopherjs.go b/proto/gopherjs/grpc.pb.gopherjs.go index 71c04eb..decdedd 100644 --- a/proto/gopherjs/grpc.pb.gopherjs.go +++ b/proto/gopherjs/grpc.pb.gopherjs.go @@ -2941,6 +2941,7 @@ type P4WNP1Client interface { GetDeployedEthernetInterfaceSettings(ctx context.Context, in *StringMessage, opts ...grpcweb.CallOption) (*EthernetInterfaceSettings, error) // WiFi DeployWifiSettings(ctx context.Context, in *WiFiSettings, opts ...grpcweb.CallOption) (*Empty, error) + GetDeployedWifiSettings(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*WiFiSettings, error) // HIDScript / job management HIDRunScript(ctx context.Context, in *HIDScriptRequest, opts ...grpcweb.CallOption) (*HIDScriptResult, error) HIDRunScriptJob(ctx context.Context, in *HIDScriptRequest, opts ...grpcweb.CallOption) (*HIDScriptJob, error) @@ -3070,6 +3071,15 @@ func (c *p4WNP1Client) DeployWifiSettings(ctx context.Context, in *WiFiSettings, return new(Empty).Unmarshal(resp) } +func (c *p4WNP1Client) GetDeployedWifiSettings(ctx context.Context, in *Empty, opts ...grpcweb.CallOption) (*WiFiSettings, error) { + resp, err := c.client.RPCCall(ctx, "GetDeployedWifiSettings", in.Marshal(), opts...) + if err != nil { + return nil, err + } + + return new(WiFiSettings).Unmarshal(resp) +} + func (c *p4WNP1Client) HIDRunScript(ctx context.Context, in *HIDScriptRequest, opts ...grpcweb.CallOption) (*HIDScriptResult, error) { resp, err := c.client.RPCCall(ctx, "HIDRunScript", in.Marshal(), opts...) if err != nil { diff --git a/proto/grpc.pb.go b/proto/grpc.pb.go index e9d975f..53aa311 100644 --- a/proto/grpc.pb.go +++ b/proto/grpc.pb.go @@ -1252,6 +1252,7 @@ type P4WNP1Client interface { GetDeployedEthernetInterfaceSettings(ctx context.Context, in *StringMessage, opts ...grpc.CallOption) (*EthernetInterfaceSettings, error) // WiFi DeployWifiSettings(ctx context.Context, in *WiFiSettings, opts ...grpc.CallOption) (*Empty, error) + GetDeployedWifiSettings(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*WiFiSettings, error) // HIDScript / job management HIDRunScript(ctx context.Context, in *HIDScriptRequest, opts ...grpc.CallOption) (*HIDScriptResult, error) HIDRunScriptJob(ctx context.Context, in *HIDScriptRequest, opts ...grpc.CallOption) (*HIDScriptJob, error) @@ -1378,6 +1379,15 @@ func (c *p4WNP1Client) DeployWifiSettings(ctx context.Context, in *WiFiSettings, return out, nil } +func (c *p4WNP1Client) GetDeployedWifiSettings(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*WiFiSettings, error) { + out := new(WiFiSettings) + err := grpc.Invoke(ctx, "/P4wnP1_grpc.P4WNP1/GetDeployedWifiSettings", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *p4WNP1Client) HIDRunScript(ctx context.Context, in *HIDScriptRequest, opts ...grpc.CallOption) (*HIDScriptResult, error) { out := new(HIDScriptResult) err := grpc.Invoke(ctx, "/P4wnP1_grpc.P4WNP1/HIDRunScript", in, out, c.cc, opts...) @@ -1535,6 +1545,7 @@ type P4WNP1Server interface { GetDeployedEthernetInterfaceSettings(context.Context, *StringMessage) (*EthernetInterfaceSettings, error) // WiFi DeployWifiSettings(context.Context, *WiFiSettings) (*Empty, error) + GetDeployedWifiSettings(context.Context, *Empty) (*WiFiSettings, error) // HIDScript / job management HIDRunScript(context.Context, *HIDScriptRequest) (*HIDScriptResult, error) HIDRunScriptJob(context.Context, *HIDScriptRequest) (*HIDScriptJob, error) @@ -1756,6 +1767,24 @@ func _P4WNP1_DeployWifiSettings_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _P4WNP1_GetDeployedWifiSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(P4WNP1Server).GetDeployedWifiSettings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/P4wnP1_grpc.P4WNP1/GetDeployedWifiSettings", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(P4WNP1Server).GetDeployedWifiSettings(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + func _P4WNP1_HIDRunScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(HIDScriptRequest) if err := dec(in); err != nil { @@ -2041,6 +2070,10 @@ var _P4WNP1_serviceDesc = grpc.ServiceDesc{ MethodName: "DeployWifiSettings", Handler: _P4WNP1_DeployWifiSettings_Handler, }, + { + MethodName: "GetDeployedWifiSettings", + Handler: _P4WNP1_GetDeployedWifiSettings_Handler, + }, { MethodName: "HIDRunScript", Handler: _P4WNP1_HIDRunScript_Handler, @@ -2103,138 +2136,139 @@ var _P4WNP1_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("grpc.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 2116 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0xdb, 0x72, 0xe3, 0xb8, - 0xd1, 0x96, 0x2d, 0x5b, 0x96, 0x5a, 0x07, 0x6b, 0x31, 0x27, 0x8e, 0x77, 0x8e, 0xf8, 0x67, 0xf6, - 0x77, 0x65, 0xb7, 0xbc, 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6, 0xf7, 0x9f, 0x17, 0x8c, 0xec, - 0xf6, 0x3b, 0xe3, 0xa2, 0x18, 0x59, 0x32, 0x15, 0xbd, 0x82, 0x66, 0x9a, 0x4a, 0x03, 0xef, 0x8c, - 0xd3, 0x64, 0x3b, 0x17, 0x41, 0xdc, 0x81, 0x0d, 0xb9, 0x34, 0x04, 0x50, 0x19, 0xea, 0xa3, 0x33, - 0xfd, 0xb8, 0x5d, 0x42, 0xdb, 0x50, 0x97, 0x3a, 0x26, 0x9d, 0xe3, 0x81, 0x31, 0x3a, 0x6d, 0xaf, - 0x65, 0x80, 0x69, 0x90, 0xf7, 0x06, 0x69, 0xaf, 0xa3, 0x26, 0xd4, 0xce, 0x46, 0x43, 0x7d, 0xa4, - 0x1f, 0x19, 0xdd, 0x76, 0x19, 0xff, 0xbb, 0x0c, 0xe8, 0x53, 0xab, 0xe6, 0xb7, 0xb5, 0xb1, 0x1f, - 0x66, 0x55, 0x71, 0x8e, 0xa0, 0x5d, 0xd8, 0x8e, 0x7b, 0x99, 0xbb, 0x93, 0xdc, 0x59, 0x84, 0xe5, - 0x35, 0xc1, 0xa5, 0x16, 0x57, 0x17, 0x81, 0xc4, 0xe3, 0x73, 0x00, 0xfd, 0x06, 0xda, 0x9e, 0x2f, - 0xf4, 0x48, 0x5c, 0xf9, 0x21, 0x13, 0x96, 0x60, 0xd7, 0xf1, 0x01, 0x5a, 0x25, 0x9f, 0xe0, 0x68, - 0x0f, 0x90, 0xe3, 0x8f, 0x7c, 0x71, 0xc8, 0x3c, 0x67, 0xae, 0x36, 0x8e, 0xc5, 0x92, 0x11, 0x79, - 0x5e, 0xda, 0x96, 0xeb, 0x5e, 0x58, 0xf6, 0x87, 0xf8, 0x0c, 0x49, 0x4a, 0xe6, 0x02, 0x8a, 0x0e, - 0xa0, 0x12, 0x5a, 0xde, 0x94, 0x72, 0x6d, 0x4b, 0x65, 0xf1, 0x93, 0x15, 0x21, 0x23, 0x52, 0x88, - 0x24, 0xb2, 0xa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, 0x13, 0x52, 0x4b, 0xd0, 0xc2, 0x37, 0x1e, 0x2a, - 0xde, 0xee, 0x96, 0x7d, 0x22, 0xee, 0xe0, 0xdb, 0x44, 0x32, 0x0d, 0x3f, 0x41, 0x5d, 0x7d, 0x4c, - 0x1e, 0xab, 0x3b, 0xf7, 0x42, 0x54, 0xf2, 0xbf, 0xaf, 0x8b, 0xee, 0x93, 0x43, 0xb8, 0xf4, 0xdd, - 0x1a, 0x3a, 0x82, 0xba, 0x61, 0x5f, 0x65, 0x5f, 0x65, 0xb7, 0x95, 0x92, 0x5b, 0xc6, 0x70, 0xe9, - 0xa2, 0xa2, 0x7e, 0x89, 0x7f, 0xfb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x06, 0xb2, 0xdb, - 0x33, 0x16, 0x00, 0x00, + // 2129 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0xdd, 0x73, 0xe3, 0xb6, + 0x11, 0x97, 0x2d, 0x7f, 0x48, 0xab, 0x0f, 0xeb, 0x70, 0x5f, 0x3c, 0xe7, 0x3e, 0xd1, 0xbb, 0xd4, + 0xd3, 0x64, 0x9c, 0xc4, 0xf5, 0x34, 0x99, 0x9b, 0xe9, 0x34, 0xb4, 0x44, 0x59, 0xf2, 0x59, 0xb2, + 0x06, 0xb4, 0xcf, 0xd3, 0xf6, 0x41, 0xa1, 0x49, 0x58, 0x46, 0x8f, 0x22, 0x59, 0x02, 0x74, 0xce, + 0x7d, 0xc8, 0x43, 0xff, 0xc1, 0x3e, 0xf7, 0x0f, 0xe8, 0xdf, 0xd1, 0x0e, 0xc0, 0x0f, 0x91, 0x3a, + 0xc9, 0xbe, 0x69, 0xde, 0x80, 0xc5, 0xe2, 0xb7, 0x8b, 0xdd, 0xc5, 0xee, 0x02, 0x00, 0x93, 0x30, + 0xb0, 0x77, 0x83, 0xd0, 0x17, 0x3e, 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fb, 0x76, 0xbb, 0x2d, 0x2d, 0xdd, 0xb2, 0x86, 0x4b, 0x17, 0x1b, 0xea, + 0xc7, 0xf9, 0xf7, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x4d, 0xc0, 0x56, 0x7f, 0x16, 0x00, + 0x00, } diff --git a/proto/grpc.proto b/proto/grpc.proto index 1e5c9c1..e9b5fb9 100644 --- a/proto/grpc.proto +++ b/proto/grpc.proto @@ -19,6 +19,7 @@ service P4WNP1 { // WiFi rpc DeployWifiSettings(WiFiSettings) returns (Empty) {} + rpc GetDeployedWifiSettings(Empty) returns (WiFiSettings) {} //HIDScript / job management rpc HIDRunScript(HIDScriptRequest) returns (HIDScriptResult) {} diff --git a/service/rpc_server.go b/service/rpc_server.go index 4a3ba4e..9d55ebb 100644 --- a/service/rpc_server.go +++ b/service/rpc_server.go @@ -28,6 +28,21 @@ var ( type server struct {} +func (s *server) GetDeployedWifiSettings(ctx context.Context, req *pb.Empty) (resp *pb.WiFiSettings, err error) { + return ServiceState.Wifi.GetDeployWifiSettings() +} + + +func (s *server) DeployWifiSettings(ctx context.Context, ws *pb.WiFiSettings) (empty *pb.Empty, err error) { + log.Printf("Trying to deploy WiFi settings %v", ws) + empty = &pb.Empty{} + err = ServiceState.Wifi.DeployWifiSettings(ws) + if err != nil { + log.Printf("Error deploying WiFi settings settings %v", err) + } + return +} + func (s *server) GetDeployedEthernetInterfaceSettings(ctx context.Context, req *pb.StringMessage) (resp *pb.EthernetInterfaceSettings, err error) { if settings,exist := ServiceState.StoredNetworkSetting[req.Msg]; exist && settings.SettingsInUse { return settings, nil @@ -247,15 +262,6 @@ func (s *server) HIDGetScriptJobResult(ctx context.Context, sJob *pb.HIDScriptJo return } -func (s *server) DeployWifiSettings(ctx context.Context, ws *pb.WiFiSettings) (empty *pb.Empty, err error) { - log.Printf("Trying to deploy WiFi settings %v", ws) - empty = &pb.Empty{} - err = DeployWifiSettings(ws) - if err != nil { - log.Printf("Error deploying WiFi settings settings %v", err) - } - return -} func (s *server) DeployEthernetInterfaceSettings(ctx context.Context, es *pb.EthernetInterfaceSettings) (empty *pb.Empty, err error) { log.Printf("Trying to deploy ethernet interface settings %v", es) diff --git a/service/state.go b/service/state.go index 63573ee..254b46e 100644 --- a/service/state.go +++ b/service/state.go @@ -12,6 +12,7 @@ type GlobalServiceState struct { Led *LedState HidDevPath map[string]string //stores device path for HID devices StoredNetworkSetting map[string]*pb.EthernetInterfaceSettings + Wifi *WifiState } func InitGlobalServiceState() (err error) { @@ -39,6 +40,9 @@ func InitGlobalServiceState() (err error) { IpAddress4: "172.24.0.1", Netmask4: "255.255.255.0", } + state.Wifi = &WifiState{ + Settings: GetDefaultWiFiSettings(), + } state.HidDevPath = make(map[string]string) //should be initialized BEFORE UsbGadgetManager uses it state.EvMgr = NewEventManager(20) diff --git a/service/wifi.go b/service/wifi.go index f0bd246..07e7068 100644 --- a/service/wifi.go +++ b/service/wifi.go @@ -39,6 +39,10 @@ const ( WPA_SUPPLICANT_CONNECT_TIMEOUT = time.Second * 20 ) +type WifiState struct { + Settings *pb.WiFiSettings +} + type BSS struct { SSID string BSSID net.HardwareAddr @@ -48,7 +52,14 @@ type BSS struct { Signal float32 //Signal strength in dBm } -func DeployWifiSettings(ws *pb.WiFiSettings) (err error) { +func (state WifiState) GetDeployWifiSettings() (ws *pb.WiFiSettings,err error) { + return state.Settings, nil +} + + +func (state *WifiState) DeployWifiSettings(ws *pb.WiFiSettings) (err error) { + // ToDo: Lock state while setting up + log.Printf("Trying to deploy WiFi settings:\n%v\n", ws) ifName := wifi_if_name @@ -143,6 +154,10 @@ func DeployWifiSettings(ws *pb.WiFiSettings) (err error) { } log.Printf("... WiFi settings deployed successfully, checking for stored interface configuration...\n") + + // store new state + state.Settings = ws + ReInitNetworkInterface(ifName) return nil } diff --git a/web_client/ToDo.txt b/web_client/ToDo.txt new file mode 100644 index 0000000..ac7d944 --- /dev/null +++ b/web_client/ToDo.txt @@ -0,0 +1,3 @@ +- input validation +- additional modes for WiFi client connections (providing a custom wpa_supplicant.conf -> interferes with failover top AP mode currently) + diff --git a/web_client/hvueComponentWiFi.go b/web_client/hvueComponentWiFi.go index 4a8a2c6..64ab2eb 100644 --- a/web_client/hvueComponentWiFi.go +++ b/web_client/hvueComponentWiFi.go @@ -30,78 +30,199 @@ func InitComponentsWiFi() { }, ), - hvue.Computed("modes", func(vm *hvue.VM) interface{} { + hvue.Computed("wifiAuthModes", func(vm *hvue.VM) interface{} { modes := js.Global.Get("Array").New() - for val,name := range pb.WiFiSettings_Mode_name { + for val,_ := range pb.WiFiSettings_APAuthMode_name { mode := struct { *js.Object - Val int `js:"val"` - Name string `js:"name"` + Label string `js:"label"` + Value int `js:"value"` }{Object:O()} - mode.Val = val - mode.Name = name - + mode.Value = val + switch pb.WiFiSettings_APAuthMode(val) { + case pb.WiFiSettings_WPA2_PSK: + mode.Label = "WPA2" + case pb.WiFiSettings_OPEN: + mode.Label = "Open" + default: + mode.Label = "Unknown" + } modes.Call("push", mode) } return modes }), - hvue.Computed("authModes", func(vm *hvue.VM) interface{} { + hvue.Computed("wifiModes", func(vm *hvue.VM) interface{} { modes := js.Global.Get("Array").New() - for val,name := range pb.WiFiSettings_APAuthMode_name { + for val,_ := range pb.WiFiSettings_Mode_name { mode := struct { *js.Object - Val int `js:"val"` - Name string `js:"name"` + Label string `js:"label"` + Value int `js:"value"` }{Object:O()} - mode.Val = val - mode.Name = name - + mode.Value = val + switch pb.WiFiSettings_Mode(val) { + case pb.WiFiSettings_AP: + mode.Label = "Access Point (AP)" + case pb.WiFiSettings_STA: + mode.Label = "Station (Client)" + case pb.WiFiSettings_STA_FAILOVER_AP: + mode.Label = "Client with Failover to AP" + default: + mode.Label = "Unknown" + } modes.Call("push", mode) } return modes }), + hvue.Method("reset", + func(vm *hvue.VM) { + vm.Get("$store").Call("dispatch", VUEX_ACTION_UPDATE_WIFI_SETTINGS_FROM_DEPLOYED) + }), + hvue.Method("deploy", + func(vm *hvue.VM, wifiSettings *jsWiFiSettings) { + vm.Get("$store").Call("dispatch", VUEX_ACTION_DEPLOY_WIFI_SETTINGS, wifiSettings) + }), ) } const templateWiFi = ` -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Enabled
Enable Nexmon
Regulatory Domain
Mode - -
AP Channel
AP Auth Algo - -
Hide SSID
-{{ settings }} -
+ + + + WiFi settings + + + + + + + + + + Generic + + + + + + Enabled + Enable/Disable WiFi + + + + + + + + Nexmon + Enable/Disable modified nexmon firmware (needed for WiFi covert channel and KARMA) + + + + + Regulatory domain + Regulatory domain according to ISO/IEC 3166-1 alpha2 (example "US") + + + + + + + + Working Mode + Work as Access Point or Client + + + + + + + + + + + + + + + ` \ No newline at end of file diff --git a/web_client/jsDataHandling.go b/web_client/jsDataHandling.go index 82edfdc..3d4de22 100644 --- a/web_client/jsDataHandling.go +++ b/web_client/jsDataHandling.go @@ -389,6 +389,28 @@ func (target *jsWiFiSettings) fromGo(src *pb.WiFiSettings) { } } +func (src *jsWiFiSettings) toGo() (target *pb.WiFiSettings) { + target = &pb.WiFiSettings{ + Disabled: src.Disabled, + Reg: src.Reg, + Mode: pb.WiFiSettings_Mode(src.Mode), + AuthMode: pb.WiFiSettings_APAuthMode(src.AuthMode), + DisableNexmon: src.DisableNexmon, + ApChannel: uint32(src.Channel), + ApHideSsid: src.HideSsid, + BssCfgClient: &pb.BSSCfg{ + SSID: src.STA_SSID, + PSK: src.STA_PSK, + }, + BssCfgAP: &pb.BSSCfg{ + SSID: src.AP_SSID, + PSK: src.AP_PSK, + }, + + } + return target +} + /* Network Settings */ type jsEthernetSettingsList struct { *js.Object diff --git a/web_client/mvuexGlobalState.go b/web_client/mvuexGlobalState.go index 2bca909..b6abe0f 100644 --- a/web_client/mvuexGlobalState.go +++ b/web_client/mvuexGlobalState.go @@ -17,7 +17,12 @@ const ( VUEX_ACTION_DEPLOY_CURRENT_GADGET_SETTINGS = "deployCurrentGadgetSettings" VUEX_ACTION_UPDATE_GADGET_SETTINGS_FROM_DEPLOYED = "updateCurrentGadgetSettingsFromDeployed" VUEX_ACTION_DEPLOY_ETHERNET_INTERFACE_SETTINGS = "deployEthernetInterfaceSettings" + VUEX_ACTION_UPDATE_WIFI_SETTINGS_FROM_DEPLOYED = "updateCurrentWifiSettingsFromDeployed" + VUEX_ACTION_DEPLOY_WIFI_SETTINGS = "deployWifiSettings" + + VUEX_MUTATION_SET_CURRENT_GADGET_SETTINGS_TO = "setCurrentGadgetSettings" + VUEX_MUTATION_SET_CURRENT_WIFI_SETTINGS = "setCurrentWifiSettings" VUEX_MUTATION_SET_CURRENT_HID_SCRIPT_SOURCE_TO = "setCurrentHIDScriptSource" initHIDScript = `layout('us'); // US keyboard layout @@ -78,6 +83,7 @@ func createGlobalStateStruct() GlobalState { state.IsModalEnabled = false state.FailedConnectionAttempts = 0 //Retrieve Interface settings + // ToDo: Replace panics by default values ifSettings,err := RpcClient.GetAllDeployedEthernetInterfaceSettings(time.Second*5) if err != nil { panic("Couldn't retrieve interface settings") } state.InterfaceSettings = ifSettings @@ -109,6 +115,34 @@ func actionUpdateGadgetSettingsFromDeployed(store *mvuex.Store, context *mvuex.A return } +func actionUpdateWifiSettingsFromDeployed(store *mvuex.Store, context *mvuex.ActionContext, state *GlobalState) { + go func() { + //fetch deployed gadget settings + dWS,err := RpcClient.GetDeployedWiFiSettings(time.Second * 5) + if err != nil { + println("Couldn't retrieve deployed WiFi settings") + return + } + + //commit to current + context.Commit(VUEX_MUTATION_SET_CURRENT_WIFI_SETTINGS, dWS) + }() + + return +} + + +func actionDeployWifiSettings(store *mvuex.Store, context *mvuex.ActionContext, state *GlobalState, settings *jsWiFiSettings) { + go func() { + println("Vuex dispatch deploy WiFi settings") + // convert to Go type + goSettings := settings.toGo() + + err := RpcClient.DeployeWifiSettings(time.Second*3, goSettings) + if err != nil {Alert(err)} + }() +} + func actionUpdateRunningHidJobs(store *mvuex.Store, context *mvuex.ActionContext, state *GlobalState) { go func() { //fetch deployed gadget settings @@ -235,6 +269,10 @@ func initMVuex() *mvuex.Store { state.CurrentGadgetSettings = settings return }), + mvuex.Mutation(VUEX_MUTATION_SET_CURRENT_WIFI_SETTINGS, func (store *mvuex.Store, state *GlobalState, settings *jsWiFiSettings) { + state.WiFiSettings = settings + return + }), /* mvuex.Mutation("startLogListening", func (store *mvuex.Store, state *GlobalState) { state.EventReceiver.StartListening() @@ -249,6 +287,8 @@ func initMVuex() *mvuex.Store { mvuex.Action(VUEX_ACTION_DEPLOY_CURRENT_GADGET_SETTINGS, actionDeployCurrentGadgetSettings), mvuex.Action(VUEX_ACTION_UPDATE_RUNNING_HID_JOBS, actionUpdateRunningHidJobs), mvuex.Action(VUEX_ACTION_DEPLOY_ETHERNET_INTERFACE_SETTINGS, actionDeployEthernetInterfaceSettings), + mvuex.Action(VUEX_ACTION_UPDATE_WIFI_SETTINGS_FROM_DEPLOYED, actionUpdateWifiSettingsFromDeployed), + mvuex.Action(VUEX_ACTION_DEPLOY_WIFI_SETTINGS, actionDeployWifiSettings), ) // fetch deployed gadget settings diff --git a/web_client/rpcClient.go b/web_client/rpcClient.go index 4852372..2b6f6fa 100644 --- a/web_client/rpcClient.go +++ b/web_client/rpcClient.go @@ -15,9 +15,9 @@ import ( type Rpc struct { *sync.Mutex - Client pb.P4WNP1Client - eventListeningOn bool - eventListeningCtx *context.Context + Client pb.P4WNP1Client + eventListeningOn bool + eventListeningCtx *context.Context eventListeningCancel context.CancelFunc } @@ -32,49 +32,71 @@ func NewRpcClient(addr string) Rpc { func (rpc *Rpc) DeployedEthernetInterfaceSettings(timeout time.Duration, settings *pb.EthernetInterfaceSettings) (err error) { // ToDo: The RPC call has to return an error in case deployment fails - ctx,cancel := context.WithTimeout(context.Background(), timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() - _,err = rpc.Client.DeployEthernetInterfaceSettings(ctx, settings) + _, err = rpc.Client.DeployEthernetInterfaceSettings(ctx, settings) + return +} + +func (rpc *Rpc) DeployeWifiSettings(timeout time.Duration, settings *pb.WiFiSettings) (err error) { + // ToDo: The RPC call has to return an error in case deployment fails + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + + _, err = rpc.Client.DeployWifiSettings(ctx, settings) return } func (rpc *Rpc) GetDeployedWiFiSettings(timeout time.Duration) (settingsList *jsWiFiSettings, err error) { - //ToDo: Only placeholde, replace with real "get deployed" RPC - ws := &pb.WiFiSettings{ - BssCfgAP: &pb.BSSCfg{ - PSK: "somesecretPSK", - SSID: "TheAP-SSID", - }, - BssCfgClient: &pb.BSSCfg{ - PSK: "somesecretPSKForExistingAP", - SSID: "ExistingSSID", - }, - Mode: pb.WiFiSettings_STA_FAILOVER_AP, - DisableNexmon: false, - ApHideSsid: false, - ApChannel: 13, - AuthMode: pb.WiFiSettings_WPA2_PSK, - Reg: "DE", - Disabled: false, - } - jsWs := &jsWiFiSettings{Object: O()} - jsWs.fromGo(ws) - return jsWs, nil + /* + //ToDo: Only placeholder, replace with real "get deployed" RPC + ws := &pb.WiFiSettings{ + BssCfgAP: &pb.BSSCfg{ + PSK: "somesecretPSK", + SSID: "TheAP-SSID", + }, + BssCfgClient: &pb.BSSCfg{ + PSK: "somesecretPSKForExistingAP", + SSID: "ExistingSSID", + }, + Mode: pb.WiFiSettings_STA_FAILOVER_AP, + DisableNexmon: false, + ApHideSsid: false, + ApChannel: 13, + AuthMode: pb.WiFiSettings_WPA2_PSK, + Reg: "DE", + Disabled: false, + } + */ + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + + ws,err := rpc.Client.GetDeployedWifiSettings(ctx, &pb.Empty{}) + if err != nil { + println("Error GetDeployedWifiSettings", err) + return nil, err + } + + jsWs := &jsWiFiSettings{Object: O()} + jsWs.fromGo(ws) + return jsWs, nil + + + } func (rpc *Rpc) GetAllDeployedEthernetInterfaceSettings(timeout time.Duration) (settingsList *jsEthernetSettingsList, err error) { - ctx,cancel := context.WithTimeout(context.Background(), timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() - deployedSettings,err := rpc.Client.GetAllDeployedEthernetInterfaceSettings(ctx,&pb.Empty{}) + deployedSettings, err := rpc.Client.GetAllDeployedEthernetInterfaceSettings(ctx, &pb.Empty{}) if err != nil { println("Error GetAllDeployedEthernetInterfaceSettings", err) return nil, err } - - settingsList = &jsEthernetSettingsList{Object:O()} + settingsList = &jsEthernetSettingsList{Object: O()} settingsList.fromGo(deployedSettings) return settingsList, nil @@ -95,45 +117,45 @@ func (rpc *Rpc) GetAllDeployedEthernetInterfaceSettings(timeout time.Duration) ( func (rpc *Rpc) RpcGetRunningHidJobStates(timeout time.Duration) (states []*pb.HIDRunningJobStateResult, err error) { println("RpcGetRunningHidJobStates called") - - ctx,cancel := context.WithTimeout(context.Background(), timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() // get running job IDs - joblist, err := rpc.Client.HIDGetRunningScriptJobs(ctx,&pb.Empty{}) - if err != nil { return nil, err } + joblist, err := rpc.Client.HIDGetRunningScriptJobs(ctx, &pb.Empty{}) + if err != nil { + return nil, err + } states = make([]*pb.HIDRunningJobStateResult, len(joblist.Ids)) - for idx,jobid := range joblist.Ids { - jobstate, err := rpc.Client.HIDGetRunningJobState(ctx, &pb.HIDScriptJob{Id:jobid}) - if err != nil { return nil, err } + for idx, jobid := range joblist.Ids { + jobstate, err := rpc.Client.HIDGetRunningJobState(ctx, &pb.HIDScriptJob{Id: jobid}) + if err != nil { + return nil, err + } states[idx] = jobstate } - return states,nil + return states, nil } func (rpc *Rpc) RpcGetDeployedGadgetSettings(timeout time.Duration) (*pb.GadgetSettings, error) { //gs := vue.GetVM(c).Get("gadgetSettings") println("RpcGetDeployedGadgetSettings called") - ctx,cancel := context.WithTimeout(context.Background(), timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() - return rpc.Client.GetDeployedGadgetSetting(ctx, &pb.Empty{}) } - func (rpc *Rpc) RpcSetRemoteGadgetSettings(targetGS *pb.GadgetSettings, timeout time.Duration) (err error) { //gs := vue.GetVM(c).Get("gadgetSettings") println("RpcSetRemoteGadgetSettings called") - ctx,cancel := context.WithTimeout(context.Background(), timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() - //Set gadget settings _, err = rpc.Client.SetGadgetSettings(ctx, targetGS) if err != nil { @@ -150,26 +172,28 @@ func (rpc *Rpc) RpcDeployRemoteGadgetSettings(timeout time.Duration) (*pb.Gadget //gs := vue.GetVM(c).Get("gadgetSettings") println("RpcDeployRemoteGadgetSettings called") - ctx,cancel := context.WithTimeout(context.Background(), timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() - return rpc.Client.DeployGadgetSetting(ctx, &pb.Empty{}) } - func (rpc *Rpc) ConnectionTest(timeout time.Duration) (err error) { //gs := vue.GetVM(c).Get("gadgetSettings") println("RpcDeployRemoteGadgetSettings called") - ctx,cancel := context.WithTimeout(context.Background(), timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() - req := &pb.StringMessage{Msg:"ping"} - resp,err := rpc.Client.EchoRequest(ctx, req) - if err != nil { return err } - if resp.Msg != req.Msg { errors.New("Unexpected response")} + req := &pb.StringMessage{Msg: "ping"} + resp, err := rpc.Client.EchoRequest(ctx, req) + if err != nil { + return err + } + if resp.Msg != req.Msg { + errors.New("Unexpected response") + } return nil } @@ -177,7 +201,6 @@ func (rpc *Rpc) StartListening() { println("Start listening called", globalState.EventReceiver) - //Note: This method is responsible for handling server streaming of events // It isn't possible to use the stream for connection watching (heartbeat), for the following reasons // 1) A connection loss can be detected in case `evStream.Recv()` fails with an error, but a successful websocket @@ -192,7 +215,7 @@ func (rpc *Rpc) StartListening() { go func() { for { println("Try to connect server ...") - for RpcClient.ConnectionTest(time.Second * 3) != nil { + for RpcClient.ConnectionTest(time.Second*3) != nil { println("... failed, retry for 3 seconds") globalState.FailedConnectionAttempts++ } @@ -200,7 +223,7 @@ func (rpc *Rpc) StartListening() { globalState.IsConnected = true globalState.FailedConnectionAttempts = 0 - ctx,cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(context.Background()) rpc.eventListeningCancel = cancel // try RPC call @@ -236,16 +259,13 @@ func (rpc *Rpc) StartListening() { println("Connection to server lost, reconnecting ...") globalState.IsConnected = false - //retry to connect (outer loop) } - return }() } - func (rpc *Rpc) StopListening() { rpc.eventListeningCancel() -} \ No newline at end of file +}