prototooth/examples/nusserver/nrf.go
Ayke van Laethem b568c93250
all: add support for sending notifications
This is done by enabling the Notify permission and writing to the
characteristics: writes will automatically notify connected centrals.
2020-06-03 19:42:21 +02:00

39 lines
461 B
Go

// +build nrf
package main
import (
"machine"
"time"
)
var (
serial = machine.UART0
stdout = machine.UART0
)
func getchar() byte {
for {
// TODO: let ReadByte block instead of polling here.
time.Sleep(1 * time.Millisecond)
if stdout.Buffered() <= 0 {
continue
}
ch, _ := stdout.ReadByte()
if ch == 0 {
continue
}
return ch
}
}
func putchar(ch byte) {
stdout.WriteByte(ch)
}
func initTerminal() {
}
func restoreTerminal() {
}