ScannerLeUtils

public class ScannerLeUtils

Helper class used to pass raw advertising data.

Only some methods that are used by the system are implemented.

Use android.bluetooth.le.ScanRecord for reference.

Methods

get16BitServiceData

public static int[] get16BitServiceData(byte[] scanRecord)

Parses the advertising data in search of the 16 bit service data.

Parameters
  • scanRecord – The raw advertising data.

Returns

A int array with 16 bit service data (complete and incomplete) per index or null.

getManufacturerData

public static byte[] getManufacturerData(byte[] scanRecord, int companyId)

Parses the advertising data in search of the data of the passed company ID.

Parameters
  • scanRecord – The raw advertising data.

  • companyId – The company id

Returns

A byte array with the company data or null.

supportsNonConnectableDiscovery

public static boolean supportsNonConnectableDiscovery(byte[] scanRecord)

Checks if the advertising data reports that the device supports fast discovery.

A device should be using the Advertising Manager of the firmware SDK.

Parameters
  • scanRecord – The raw advertising data.

Returns

true if non-connectable discovery is supported.