mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-05 15:33:42 +00:00
wifinina: fix getMACAddress and getTime
Tested against Adafruit AirLift (compatibile variant of wifinina)
This commit is contained in:
@@ -557,8 +557,9 @@ func (d *Device) GetReasonCode() (uint8, error) {
|
||||
return d.getUint8(d.req0(CmdGetReasonCode))
|
||||
}
|
||||
|
||||
func (d *Device) GetTime() (string, error) {
|
||||
return d.getString(d.req0(CmdGetTime))
|
||||
// GetTime is the time as a Unix timestamp
|
||||
func (d *Device) GetTime() (uint32, error) {
|
||||
return d.getUint32(d.req0(CmdGetTime))
|
||||
}
|
||||
|
||||
func (d *Device) GetTemperature() (float32, error) {
|
||||
@@ -734,7 +735,7 @@ func (d *Device) getMACAddress(l uint8, err error) (MACAddress, error) {
|
||||
if l != 6 {
|
||||
return 0, ErrUnexpectedLength
|
||||
}
|
||||
return MACAddress(binary.LittleEndian.Uint64(d.buf[0:8]) >> 16), err
|
||||
return MACAddress(binary.LittleEndian.Uint64(d.buf[0:8]) & 0xFFFFFFFFFFFF), err
|
||||
}
|
||||
|
||||
// req0 sends a command to the device with no request parameters
|
||||
|
||||
Reference in New Issue
Block a user