wireless personal area network technology aimed for novel applications in the healthcare, fitness, beacons, security, and home entertainment industries
max.) 100 m (330 ft) >100 m (>330 ft) Over the air data rate 1–3 Mbit/s 1 Mbit/s Active slaves 7 Not defined; implementation dependent Minimum total time to send data 100 ms 3 ms Power consumption 1 W as the reference 0.01 to 0.5 W (depending on use case)
initiates GATT commands and requests, and accepts responses, for example a computer or smartphone • Server - A device that receives GATT commands and requests, and returns responses, for example a temperature sensor. • Characteristic - A data value transferred between client and server, for example the current battery voltage.
together to perform a particular function. For instance, the Health Thermometer service includes characteristics for a temperature measurement value, and a time interval between measurements. • Descriptor - A descriptor provides additional information about a characteristic. For instance, a temperature value characteristic may have an indication of its units (e.g. Celsius), and the maximum and minimum values which the sensor can measure. Descriptors are optional - each characteristic can have any number of descriptors.
Find a service with a given UUID • Find secondary services for a given primary service • Discover all characteristics for a given service • Find characteristics matching a given UUID • Read all descriptors for a particular characteristic
length AD Type Manufacturer ID Beacon prefix 27 Manufacturer specific 224 (Google) Ad Structure 2 0x0C […] 0xBB 0x00 0x09 0x00 0x06 0xBA UUID (16 bytes) Major Minor TX Power 9 6 -70
mManufacturerData = ByteBuffer.allocate(24); byte[] uuid = getIdAsByte(UUID.fromString("0CF052C297CA407C84F8B62AAC4E9020")); mManufacturerData.put(0, (byte)0xBE); // Beacon Identifier mManufacturerData.put(1, (byte)0xAC); // Beacon Identifier for (int i=2; i<=17; i++) { mManufacturerData.put(i, uuid[i-2]); // adding the UUID } mManufacturerData.put(18, (byte)0x00); // first byte of Major mManufacturerData.put(19, (byte)0x09); // second byte of Major mManufacturerData.put(20, (byte)0x00); // first minor mManufacturerData.put(21, (byte)0x06); // second minor mManufacturerData.put(22, (byte)0xB5); // txPower mBuilder.addManufacturerData(224, mManufacturerData.array()); mAdvertiseData = mBuilder.build(); } 1. Set Advertise data