Update App version to 0.1.1

Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
luckfox-eng29
2026-02-05 11:28:14 +08:00
parent 5e17c52afc
commit 9a4e604c61
289 changed files with 23077 additions and 12474 deletions

View File

@@ -52,6 +52,16 @@ 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"
}
}
stateFile := path.Join("/sys/class/udc", u.udc, "state")
stateBytes, err := os.ReadFile(stateFile)
if err != nil {