Client driver for WiFiNINA firmware (#98)

* wifinina: implementation of WiFiNINA driver, including:
   - TCP client example is working
   - reading sockets and mqtt working
   - switched over to common net package also used by espat package
   - smoke tests and updated README for wifinina
This commit is contained in:
BCG
2019-12-22 04:25:10 -05:00
committed by Ron Evans
parent cc5ecafacf
commit e80a22d0ba
10 changed files with 1888 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package wifinina
import "time"
func wait(duration time.Duration) {
newTimer(duration).WaitUntilExpired()
}
type timer struct {
start int64
interval int64
}
func newTimer(interval time.Duration) timer {
return timer{
start: time.Now().UnixNano(),
interval: int64(interval),
}
}
func (t timer) Expired() bool {
return time.Now().UnixNano() > (t.start + t.interval)
}
func (t timer) WaitUntilExpired() {
for !t.Expired() {
}
}