Update App version to 0.1.2

Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
luckfox-eng29
2026-03-16 21:49:37 +08:00
parent 9a4e604c61
commit d5bfaffd86
32 changed files with 4064 additions and 229 deletions

View File

@@ -51,14 +51,15 @@ func (u *UsbGadget) RebindUsb(ignoreUnbindError bool) error {
}
// GetUsbState returns the current state of the USB gadget
func (u *UsbGadget) GetUsbState() (state string) {
// Check the auxiliary disc node first
discFile := "/sys/devices/platform/ff3e0000.usb2-phy/disc"
discBytes, err := os.ReadFile(discFile)
if err == nil {
discState := strings.TrimSpace(string(discBytes))
if discState == "DISCONNECTED" {
return "not attached"
func (u *UsbGadget) GetUsbState(enhancedDetection bool) (state string) {
if enhancedDetection {
discFile := "/sys/devices/platform/ff3e0000.usb2-phy/disc"
discBytes, err := os.ReadFile(discFile)
if err == nil {
discState := strings.TrimSpace(string(discBytes))
if discState == "DISCONNECTED" {
return "not attached"
}
}
}