0

I've not done a lot of Android development and at best I'm a n00b!

I'm looking at using "Android Things" on a RPi3 to connect to a sensor tag via BTLE. The tag is already configured and holds some data, it's running as a GATT Server and is the peripheral. I have a Advertising service UUID I can scan for and connect to then read the characteristics once a bond is in place.

I would like to use the RPi running Android Things O/S to scan for the sensor tag, then connect and read the data from the sensor tag as it passes by. In a similar fashion to a mobile application.

When the sensor passes by for the first time, the user will be required to authorise the connection on the sensor tag by pressing a button. This should create a bond.

I can't see any examples if this scenario is possible or not. Typically, the use case is round the other way and the examples are of Android Things (RPi) running a GATT Server advertising it's services to a GATT Client.

I've been having a look at the documentation here, but not sure how this would work: https://developer.android.com/things/reference/com/google/android/things/bluetooth/package-summary.html

The example here seems to be the opposite of what I'm looking for with the GATT server running on the Android Things end: https://github.com/androidthings/sample-bluetooth-le-gattserver

isa56k
  • 143
  • 1
  • 8

1 Answers1

1

We did not produce a GATT client sample specific to Android Things because the existing Android samples already covered this case pretty well. You can use the standard Android BLE APIs without any changes, so have a look at the existing Android BluetoothLeGatt Sample.

Additionally, if you find it helpful, I personally built an Android BLE GATT sample a few years back that talks specifically to the SensorTag. It was a previous version of the hardware, but the overall concepts should remain the same.

devunwired
  • 62,780
  • 12
  • 127
  • 139
  • Thanks! So Android Things, has all the same API's available as full android on a phone? I wasn't sure if it was a cut down version of Android for more light weight platforms. – isa56k May 25 '17 at 07:31
  • 1
    No changes to the Android API surface. In fact, we even added a few to work specifically with device profiles on Android Things: https://developer.android.com/things/reference/com/google/android/things/bluetooth/package-summary.html – devunwired May 26 '17 at 15:12