Browse Source
Access point fixes (#137)
Access point fixes (#137)
* add lingering mode to access point fix bug which prevents active access point from being re-configuredmaster
rjwats
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 81 additions and 30 deletions
-
4interface/src/ap/APModes.ts
-
8interface/src/ap/APSettingsForm.tsx
-
28interface/src/ap/APStatus.ts
-
12interface/src/ap/types.ts
-
23lib/framework/APSettingsService.cpp
-
24lib/framework/APSettingsService.h
-
6lib/framework/APStatus.cpp
-
4lib/framework/APStatus.h
-
2lib/framework/ESP8266React.cpp
@ -1,5 +1,5 @@ |
|||
import { APSettings, ApProvisionMode } from "./types"; |
|||
import { APSettings, APProvisionMode } from "./types"; |
|||
|
|||
export const isAPEnabled = ({ provision_mode }: APSettings) => { |
|||
return provision_mode === ApProvisionMode.AP_MODE_ALWAYS || provision_mode === ApProvisionMode.AP_MODE_DISCONNECTED; |
|||
return provision_mode === APProvisionMode.AP_MODE_ALWAYS || provision_mode === APProvisionMode.AP_MODE_DISCONNECTED; |
|||
} |
@ -1,10 +1,28 @@ |
|||
import { Theme } from "@material-ui/core"; |
|||
import { APStatus } from "./types"; |
|||
import { APStatus, APNetworkStatus } from "./types"; |
|||
|
|||
export const apStatusHighlight = ({ active }: APStatus, theme: Theme) => { |
|||
return active ? theme.palette.success.main : theme.palette.info.main; |
|||
export const apStatusHighlight = ({ status }: APStatus, theme: Theme) => { |
|||
switch (status) { |
|||
case APNetworkStatus.ACTIVE: |
|||
return theme.palette.success.main; |
|||
case APNetworkStatus.INACTIVE: |
|||
return theme.palette.info.main; |
|||
case APNetworkStatus.LINGERING: |
|||
return theme.palette.warning.main; |
|||
default: |
|||
return theme.palette.warning.main; |
|||
} |
|||
} |
|||
|
|||
export const apStatus = ({ active }: APStatus) => { |
|||
return active ? "Active" : "Inactive"; |
|||
export const apStatus = ({ status }: APStatus) => { |
|||
switch (status) { |
|||
case APNetworkStatus.ACTIVE: |
|||
return "Active"; |
|||
case APNetworkStatus.INACTIVE: |
|||
return "Inactive"; |
|||
case APNetworkStatus.LINGERING: |
|||
return "Lingering until idle"; |
|||
default: |
|||
return "Unknown"; |
|||
} |
|||
}; |
@ -1,18 +1,24 @@ |
|||
export enum ApProvisionMode { |
|||
export enum APProvisionMode { |
|||
AP_MODE_ALWAYS = 0, |
|||
AP_MODE_DISCONNECTED = 1, |
|||
AP_NEVER = 2 |
|||
} |
|||
|
|||
export enum APNetworkStatus { |
|||
ACTIVE = 0, |
|||
INACTIVE = 1, |
|||
LINGERING = 2 |
|||
} |
|||
|
|||
export interface APStatus { |
|||
active: boolean; |
|||
status: APNetworkStatus; |
|||
ip_address: string; |
|||
mac_address: string; |
|||
station_num: number; |
|||
} |
|||
|
|||
export interface APSettings { |
|||
provision_mode: ApProvisionMode; |
|||
provision_mode: APProvisionMode; |
|||
ssid: string; |
|||
password: string; |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue