Update App version to 0.1.3

Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
luckfox-eng29
2026-05-15 18:49:50 +08:00
parent 2a2890e7b3
commit ec0581c1f4
12 changed files with 465 additions and 230 deletions

View File

@@ -167,3 +167,16 @@ func rpcRenewDHCPLease() error {
func rpcRequestDHCPAddress(ip string) error {
return networkState.RpcRequestDHCPAddress(ip)
}
const ethernetMacAddressPath = "/userdata/ethaddr.txt"
func rpcSetEthernetMacAddress(macAddress string) (interface{}, error) {
normalized, err := networkState.SetMACAddress(macAddress)
if err != nil {
return nil, err
}
if err := os.WriteFile(ethernetMacAddressPath, []byte(normalized+"\n"), 0644); err != nil {
return nil, fmt.Errorf("failed to write %s: %w", ethernetMacAddressPath, err)
}
return networkState.RpcGetNetworkState(), nil
}