paypal / gatt

Gatt is a Go package for building Bluetooth Low Energy peripherals
BSD 3-Clause "New" or "Revised" License
1.13k stars 284 forks source link

Accessing raw connection. #47

Open james-lawrence opened 9 years ago

james-lawrence commented 9 years ago

How do I, with a server, listen for connections and then read in the stream of data from the client?

closest I see is on the conn struct and the HCI object for the Stream IO. But there is not way to listen for new connections and handle them, the HCI object is hidden within the device struct. Maybe I'm just not seeing what this library was designed for?

roylee17 commented 9 years ago

I'm not sure I'm following your question. Can you elaborate a bit?

This GATT library intends to provides BLE at GATT level. On linux, we do export some options for user to specify, but it's minimal.

Take a look at the examples/server.go or examples/server_lnx.go, which implement a very battery service and a custom counter service.