You are on page 1of 4
rorsor2017 () PunchThroug Services About Whitepapers obs. Bean Store Contact Toggle navigation * Getting Started © Welcome to Bean! Technical Spees Regulatory Info Bean Loader for OS X Bean Loader for Android ean Loader for iOS Bean Loader for Linux CLLLoader + Feature Walkthroughs Grove Modules HID iBeacon MIDI PIN Code Securit Power Management Scratch Characteristics Temperature Sensor ‘Virtual Serial + Node,js SDK/CLI © Overview Install on OS X Install on Windo Install on Linux Install on Raspberry BLE Dongle Setup CLI Reference + Node-RED © What is Node-RED? © Installation Using Bean Nodes © Tweeting from Bean * Building an App How GAP and GATT Work - Punch Through Toggle navigation Bean Loader for Wi s rorsor2017 How GAP and GATT Work - Punch Through © vl: Build the App Interface © v2: Integrate the Bean SDK + Everything Else © Downloads and SDKs © Prototype to Production © Hardware Files © Hackathons and Meetups Resources for Educators LightBlue Demo Sketch © How GAP and GATT Work + Having Problems? © Support © Troubleshooting Guide © Reprogram Malicious Sketch How GAP and GATT Work How do GAP and GATT differ? © Generic Access Profile (GAP) © Getting Connected © Once You're Connecte © Generic Attribute Profile (GATT) © Rol © Client-Server Relationships + Learn More The LightBlue Bean runs on BLE, or Bluetooth Low Energy. BLE is a protocol developed by Bluetooth SIG that builds on the lessons learned from building lots of Bluetooth Classic devices. Compared to Bluetooth Classic, BLE consumes less power, requires less time and effort to pair devices, and provides lower connection speeds. The Bluetooth Protocol Stack is divided into two categories: the controller and the host. Each category has sub-categories, which perform specific roles. The two subcategories we are going to look at is the Generie Access Profile (GAP) and the Generic Attribute Profile (GATT). How do GAP and GATT differ? Itis important to differentiate between GAP and GATT. * GAP defines the general topology of the BLE network stack. * GATT describes in detail how attributes (data) are transferred once devices have a dedicated connection GATT specifically focuses on how data is formatted, packaged, and sent according to its described rules. In the BLE network stack, the Attribute Protocol (ATT) is closely aligned with GATT, where GATT sits directly on top of ATT. GATT actually uses ATT to describe how data is exchanged from two connected devices. Generic Access Profile (GAP) There are two mechanisms a BLE device can use to communicate to the outside world: broadcasting or connecting. These mechanisms are subjected to the Generic Access Profile (GAP) guidelines. GAP defines how BLE-enabled devices can make themselves available and how two devices can communicate directly with each other. rorsor2017 How GAP and GATT Work - Punch Through Getting Connected A device can join a BLE network by adopting these roles specified in GAP: Broadcasting: These roles don’t have to explicitly connect to one another to transfer data. + Broadeaster: A device that broadcasts public advertising data packets, such as how long a button has been pressed. * Observer: A devices that listens to the data in the advertising packets sent by the broadcaster. No connection happens between the broadcaster and observer. Connecting: These roles must explicitly connect and handshake to transfer data, These roles are more commonly used than the broadcasting roles. + Peripheral: A device that advertises its presence so central devices can establish a connection, After connecting, peripherals no longer broadcast data to other central devices and stay connected to the device that accepted connection request. © Peripherals are low-power because they only have to send beacons periodically. Central devices are responsible for starting communication with peripherals. © Bean is an example of a BLE peripheral. * Central: A device that initiates a connection with a peripheral device by first listening to the advertising packets. A central device can connect to many other peripheral devices. ‘© When the central device wants to connect, it sends a request connection data packet to the peripheral device. If the peripheral device accepts the request from the central device, a connection is established. © Your computer is an cxample of a BLE Central device when it connects to Bean. Once You're Connected Central Devices Can Update Connection Parameters: The central device typically establishes the connecting parameters between the peripheral device and itself, The central device can only modify the connecting parameters. However, the peripheral device can ask the central device to change the connection parameters Peripheral or Central Devices Can Terminate Connections: Connections might end for a variety of reasons: a device's battery might die or network interference might cause the connection to fail. Devices can also intentionally disconnect from their peers, Generic Attribute Profile (GATT) Roles Similar to GAP, there are certain roles that interacting devices can adopt: * Client: Typically sends a request to the GATT server. The client can read and/or write attributes found in the server, + Server: One of the main roles of the server is to store attributes. Once the client makes a request, the server must make the attributes available. Client-Server Relationships ‘One example of a client-server relationship is as follows: I push a button on Bean and I want the computer to read that information, Bean acts as a server and provides information. The computer acts as a client, reading rorsor2017 How GAP and GATT Work - Punch Through that information. GAP and GATT roles are essentially independent of one another. Peripheral or central devie: can BOTH act, asa server or client, depending on how data is flowing. In contrast to the above example, if I wanted to send an update from from the computer to Bean, the computer acts as a server and Bean acts as a client. Learn More Our guide focuses primarily on how GAP and GATT work, If you're interested on learning more about BLE in general, check out some of the resources below: Getting Started with Bluetooth Low Energy Bluetooth Low Energy Core Specification 4.0 Punch Through Services About Whitepapers Downloads Reference Projects Beantalk Community Connect facebook ‘Twitter GitHub ie Contact info@punchthrough.com San Francisco 483 Broadway San Francisco, CA 94133 Minneapolis 201 6th St SE, Suite 4 Minneapolis, MN 55414 1017 Punch Through Design, LLC. All rights reserved, Read our privacy policy.

You might also like