This library allows easy WebUSB communication with the MCH2022 badge, and possibly more badges in the future.
interface BadgeAPI {
connect()
disconnect(reset)
syncConnection()
assertConnected()
set onConnectionLost
get hasConnectedBadge
transaction(cmd, payload, timeout)
fileSystem: {
state()
list(path)
mkdir(path)
exists(path)
delete(path)
readFile(path)
writeFile(path, bin)
closeFile()
}
appFS: {
list()
run(name)
read(name)
write(name, title, version, bin)
delete(name)
}
nvs: {
list(ns)
read(ns, key, type)
write(ns, key, type, value)
delete(ns, key)
}
}
TODO: auto generated docs :)
- Nicolai Electronics: initial WebUSB implementation (firmware + JS client)
- Reinier van der Leer (@Pwuts): TypeScript conversion, documentation, improvements etc.
- WebUSB implementation in the MCH2022 badge firmware
- MDN WebUSB API spec