Go Receiver for WxBeacon2(2JCIE-BL01).
- gatt
- modified from bettercap/gatt which is most active repository forked from paypal/gatt in May 2021.
- 2JCIE-BL01 Communication Interface Manual
func main() {
dev := wxbeacon2.NewDevice("ZZ:ZZ:ZZ:ZZ:ZZ:ZZ", process)
err := dev.WaitForReceiveData()
if err != nil {
log.Fatalf("Failed to open device, err: %s\n", err)
return
}
select {}
}
func process(data interface{}){
switch v := data.(type) {
case wxbeacon2.WxIMData:
// process IM Mode Data
case wxbeacon2.WxEPData:
// process EP Mode Data
}
- Currently this code supports
Limited/General Broadcaster
mode(see reference). - You should run this code as
root
user(or CAP_NET_ADMIN capability).