SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
2015. 1. 8
HyWAI 3.5 Bluetooth API
Table of Contents
Bluetooth API Sequence Diagram
Bluetooth API Comparison Chart1
3
Bluetooth API Web-IDL2
W3C Web Bluetooth CG HyWAI 3.5 Bluetooth API
BLE Support O O
BR/EDR Support X Android only1
Pairing/Bonding Process Not specified
Not specified
(handled by native OS)
LE Message Reception JavaScript promises Callback functions
LE Message Transmission GATT attribute methods GATT attribute methods
BR/EDR Communication Utilizes BLE interface Socket based communication
Exception Handling Only outlines general guidelines Callback functions
BLE Peripheral Support X iOS only1
BR/EDR Server Support X Android only1
I. Comparison of HyWAI Bluetooth API and W3C Web Bluetooth CG
3
1These operations are defined HyWAI 3.5 API, yet limitations are imposed by respective native
operating systems.
II. Bluetooth IDL – hywai.Bluetooth
Methods
• getDefaultAdapter
• Returns default BluetoothAdapter instance for this device.
• isLeEnabled
• Checks if Bluetooth Low Energy is enabled by current device.
• isBrEdrEnabled
• Checks if BR/EDR is enabled by current device.
• openServer
• Opens Bluetooth BR/EDR Server with given name and UUID. Returns BluetoothServer instance.
• openGattServer
• Opens Bluetooth GATT Server and calls OnGattServerOpenCallback with new BluetoothGattServer
instance. Parameter GattServerCallback object receives remote messages via its callback attributes.
hywai.Bluetooth is HyWAI’s Bluetooth module object which serves as an entry point for all Bluetooth
related operations including Bluetooth availability check, BluetoothAdapter retrieval, and server (BR/EDR
and BLE) operations.
II. Bluetooth IDL – BlutoothAdapter
BluetoothAdapter, returned by hywai.Bluetooth object, is a singleton object responsible for Bluetooth
peripheral discovery with given options and filters.
Methods
• startDiscovery
• Starts to discover Bluetooth peripheral devices in range. Devices are filtered by given uuids, and
OnDeviceFoundCallback is called with BluetoothDevice object whenever a device is discovered.
• stopDiscovery
• Stops discovery. As discovery operations are energy-intensive, this method should be called as
soon as desired device has been discovered.
II. Bluetooth IDL – BluetoothDiscoveryOption
The BluetoothDiscoveryOption enumeration gives users a standardized way to specify types of Bluetooth
devices to discover.
Enumeration Description
BLE Discover only Bluetooth Low Energy devices.
CLASSIC Discover only Bluetooth BR/EDR devices.
ALL Discover both Bluetooth LE and BR/EDR devices.
II. Bluetooth IDL – BluetoothDevice (1/2)
BluetoothDevice represents a peripheral or central Bluetooth Device object. It outlines device-related
operations such as connection (BLE and BR/EDR) and various information access.
Methods
• getType
• Returns a long representing the type of this device. (0 – Unknown, 1 – BR/EDR, 2 – BLE, 3 – DUAL)
• getName
• Returns human-friendly name of this device.
• getDeviceId
• Returns a uniquely assigned id for this device.
• getUuids
• Returns UUIDs advertised by this device. This method only works with devices discovered through
BR/EDR discovery.
II. Bluetooth IDL – BluetoothDevice (2/2)
Methods
• getServices
• If cached is true, gets cached GATT services. Otherwise, fetches GATT services from remote device.
Calls OnServicesGetCallback with BluetoothService objects representing retrieved services.
• readRssi
• Reads RSSI value of this device and calls OnRssiReadCallback with retrieved value.
• getConnectionState
• Calls OnConnectionStateCallback with device’s connection state. (0 – disconnected, 1 – connecting,
2 – connected, 3 – disconnecting)
• createSocket
• Creates a Bluetooth socket with given UUID for BR/EDR communication and calls
OnSocketCreateCallback with BluetoothSocket object. BluetoothSocket, at return, is not connected
and BluetoothSocket#connect should be explicitly called to initiate a connection.
• connectGatt
• Connects to the device using BLE for GATT interaction. Calls OnSuccessCallback upon successful
connection.
• disconnectGatt
• Disconnects from the device’s GATT properties.
II. Bluetooth IDL – BluetoothService (1/2)
BluetoothService represents remote device’s GATT service. It contains methods for retrieving its attributes,
included services, and characteristics. If created by user for GATT peripheral server operation, it can add
characteristics and included services to itself.
Methods
• getId
• Returns this service’s unique identifier.
• getUuid
• Returns this service’s UUID.
• isPrimary
• Returns whether this service is primary.
• getIncludedServices
• Calls OnIncludedServicesGetCallback with this service’s included services filtered by given UUIDs. If
cached is true, returns cached services. Otherwise, fetches services from remote.
II. Bluetooth IDL – BluetoothService (2/2)
Methods
• getCharacteristics
• Calls OnCharacteristicsGetCallback with this service’s characteristics filtered by given UUIDs. If
cached is true, returns cached characteristics. Otherwise, fetches characteristics from remote.
• addCharacteristic
• Adds a GATT characteristic represented as BluetoothCharacteristic object to this service and
returns OnSuccessCallback if successful. Only accessible if object is created by user via constructor.
• addIncludedService
• Adds a GATT service represented as BluetoothService object to this service as included service
and returns OnSuccessCallback if successful. Only accessible if object is created by user via
constructor.
II. Bluetooth IDL – BluetoothCharacteristic (1/2)
BluetoothCharacteristic represents remote device’s GATT characteristic. It contains methods for retrieving its
attributes, reading/writing values and subscribing for notifications. If created by user for GATT peripheral
server operation, it can add descriptors to itself.
II. Bluetooth IDL – BluetoothCharacteristic (2/2)
Methods
• getId
• Returns this characteristic’s unique identifier.
• getUuid
• Returns this characteristic’s UUID.
• setValue
• Set’s this characteristic’s local value.
• getPermissions
• Calls OnGattPermissionsGetCallback with this characteristic’s GATT permissions.
• getProperties
• Calls OnCharacteristicPropertiesGetCallback with this characteristic’s properties.
• getDescriptors
• Calls OnDescriptorsGetCallback with this characteristic’s descriptors filtered by given UUIDs. If
cached is true, returns cached descriptors. Otherwise, fetches descriptors from remote.
• readValue
• Calls OnCharacteristicValueReadCallback with this characteristic’s value. If cached is true, returns
cached value. Otherwise, fetches value from remote.
• writeValue
• Writes given value to remote and calls OnCharacteristicValueWriteCallback with written value.
• startNotification
• Starts to notification for it’s value from remote device. OnCharacteristicvalueNotificationCallback is
called with new value whenever a notification is received from remote.
• stopNotification
• Stops notification for this characteristic’s value.
• getService
• Calls OnServiceGetCallback with this characteristic’s GATT service.
• addDescriptor
• Adds a GATT descriptor represented as BluetoothDescriptor object to this characteristic and
returns OnSuccessCallback if successful. Only accessible if object is created by user via constructor.
II. Bluetooth IDL – BluetoothDescriptor
BluetoothDescriptor represents remote device’s GATT descriptor. It contains methods for retrieving its
attributes and reading/writing values.
Methods
• getId
• Returns this descriptor’s unique identifier.
• getUuid
• Returns this descriptor’s UUID.
• getPermissions
• Calls OnCharacteristicGetCallback with this descriptor’s GATT characteristic.
• setValue
• Set’s this characteristic’s local value.
• readValue
• Calls OnDescriptorValueReadCallback with this descriptor’s value. If cached is true, returns cached
value. Otherwise, fetches value from remote.
• writeValue
• Writes given value to remote and calls OnDescriptorValueWriteCallback with written value.
II. Bluetooth IDL – CharacteristicProperty
The CharacteristicProperty enumeration allows users to use standardized GATT characteristic property by
name instead of using platform-specific bitwise operations.
Enumeration Description
PROPERTY_BROADCAST Characteristic is broadcastable.
PROPERTY_EXTENDED_PROPS Characteristic has extended properties.
PROPERTY_INDICATE Characteristic supports indication.
PROPERTY_INDICATE_ENCRYPTED Characteristic supports encrypted indication.
PROPERTY_NOTIFY Characteristic supports notification.
PROPERTY_NOTIFY_ENCRYPTED Characteristic supports encrypted notification.
PROPERTY_READ Characteristic is readable
PROPERTY_SIGNED_WRITE Characteristic supports write with signature.
PROPERTY_WRITE Characteristic can be written.
PROPERTY_WRITE_NO_RESPONSE Characteristic can be written without response.
II. Bluetooth IDL – GattPermission
The GattPermission enumeration allows users to use standardized GATT permissions by name instead of
using platform-specific bitwise operations.
Enumeration Description
PERMISSION_READ Characteristic read permission.
PERMISSION_READ_ENCRPYTED Allow encrypted read operations.
PERMISSION_READ_ENCRPYTED_MITM Allow reading with man-in-the-middle protection
PERMISSION_WRITE Characteristic write permission.
PERMISSION_WRITE_ENCRPYTED Allow encrypted writes.
PERMISSION_WRITE_ENCRPYTED_MITM Allow encrypted writes with man-in-the-middle protection.
PERMISSION_WRITE_SIGNED Allow signed write operations.
PERMISSION_WRITE_SIGNED_MITM Allow signed writes with man-in-the-middle protection.
II. Bluetooth IDL – BluetoothSocket (1/2)
BluetoothSocket represents a socket connection between two Bluetooth devices. It contains methods for
handling connections, retrieving connection information, and reading/writing data.
Methods
• getSocketId
• Gets the unique identifier associated with this socket.
• connect
• Establishes a connection. Calls OnSocketConnectedCallback with connected socket object (this).
• isConnected
• Calls OnSocketConnectionStateCallback with current connection state. Returns true if connected.
• close
• Closes connection and calls OnSuccessCallback if successful.
• startReadData
• Starts to read data from this socket. OnDataReceiveCallback is called with value whenever data is
received through the socket.
II. Bluetooth IDL – BluetoothSocket (2/2)
Methods
• stopReadData
• Stops reading data from this socket.
• writeData
• Writes given data to the socket. Calls OnSocketWriteDataCallback with length of data written.
• getDevice
• Calls OnDeviceGetCallback with BluetoothDevice object representing the Bluetooth device
associated with this socket.
II. Bluetooth IDL – BluetoothGattServer (1/2)
BluetoothGattServer represents current device as a Bluetooth Peripheral in BLE mode. It contains methods
to modify it’s server internals, advertise, send notifications, and send response to read/write requests.
Methods
• addService
• Adds a GATT service to this server.
• removeService
• Removes a GATT service from this server.
• clearServices
• Removes all GATT services from this server.
• getServices
• Calls OnServicesGetCallback with GATT services added to this server.
II. Bluetooth IDL – BluetoothGattServer (2/2)
Methods
• startAdvertising
• Start advertising this server with given device name and service UUIDs. Calls
OnAdvertisementStartCallback with advertisement data
• stopAdvertising
• Stops advertising this server.
• isAdvertising
• Calls OnAdvertisementStateGetCallback with boolean indicating whether this server is currently
advertising.
• sendCharacteristicNotification
• Sends characteristic notifications to given Bluetooth devices for given characteristic and value.
Calls OnSuccessCallback after sending notification.
• sendResponse
• Sends response to a read/write request for given Bluetooth device and request identifier with
given value.
• close
• Closes this GATT server.
II. Bluetooth IDL – BluetoothGattServerCallback
BluetoothGattServerCallback contains Bluetooth GATT server callback functions as it’s attributes. These
callback function attributes, implemented by user, are called whenever GATT server related events occur.
These events include Characteristic subscription and unsubscription, service addition, and characteristic
read/write request.
Attributes
• onCharacteristicSubscribe
• Callback function called when a central device subscribes to this server’s characteristic.
• onCharacteristicUnsubscribe
• Callback function called when a central device unsubscribes from this server’s characteristic.
• onServiceAdded
• Callback function called when a GATT service is successfully added to this server.
• onCharacteristicReadRequest
• Callback function called when a central device requests to read given characteristic’s value.
• onCharacteristicWriteRequest
• Callback function called when a central device requests to write value to given characteristic.
• onReadyToUpdateSubscribers
• Callback function called when this server is ready to send notifications to subscribed centrals after
previous attempt so send notifications.
II. Bluetooth IDL – BluetoothServer
BluetoothServer represents current device acting as Bluetooth BR/EDR server. It has methods to listen and
stop listening to incoming connections.
Methods
• listen
• Starts to listen to incoming connections. Calls OnDeviceConnectedCallback with a connected
BluetoothSocket object whenever a device is connected to this server.
• close
• Stops listening to incoming connections.
III. Bluetooth API Sequence Diagram – BLE Central Role Overview (1/2)
W3C Web Bluetooth CG Specifications
• W3C Web Bluetooth CG suggests mandating the user to initiate device discovery with a limited
set of target UUIDs, therefore only exposing relevant devices for intended use.
• Each operation is initiated by objects representing respective GATT attributes.
• W3C Web Bluetooth CG only specifies API for BLE operations as a central role.
III. Bluetooth API Sequence Diagram – BLE Central Role Overview (2/2)
HyWAI 3.5 Bluetooth API
• HyWAI 3.5 Bluetooth API imposes same security obligations as W3C Web Bluetooth CG does.
• HyWAI specifically designates BluetoothAdapter object for starting/stopping device discovery.
• Device discovery in HyWAI offers options to choose types (BLE, BR/EDR, or both) of target
devices.
III. Bluetooth API Sequence Diagram – BLE Central Role Discovery
W3C Web Bluetooth CG Specifications
• W3C Web Bluetooth only outlines general procedures for device discovery, where HyWAI 3.5
Bluetooth API specifies that BluetoothAdapter object retrieved from global hywai.Bluetooth
should perform device discovery.
• HyWAI 3.5 Bluetooth API allows users to stop discovery at will.
• HyWAI 3.5 Bluetooth API uses callback functions for retrieving discovered devices.
HyWAI 3.5 Bluetooth API
III. Bluetooth API Sequence Diagram – BLE Central Role Connection
W3C Web Bluetooth CG Specifications
• W3C Web Bluetooth CG primarily uses Promises to handle asynchronous operations where
HyWAI 3.5 Bluetooth API uses user-supplied callback functions.
• Unlike W3C Web Bluetooth CG, HyWAI 3.5 Bluetooth API offers BR/EDR operations, thus
specifying “Gatt” to indicate that the operations are BLE-specific.
HyWAI 3.5 Bluetooth API
III. Bluetooth API Sequence Diagram – BLE Central Role Communication
• HyWAI 3.5 Bluetooth API allows users to decide whether to fetch values and GATT attributes
from remote or to retrieve them from local caches.
W3C Web Bluetooth CG Specifications HyWAI 3.5 Bluetooth API
III. Bluetooth API Sequence Diagram – BLE Peripheral Role
• W3C Web Bluetooth CG does not specify any API for BLE peripheral role.
• HyWAI 3.5 API supports BLE peripheral role using BluetoothGattServer object for server
operations (advertisement, outgoing messages) and GattServerCallback object for incoming
requests and callbacks.
HyWAI 3.5 Bluetooth API
III. Bluetooth API Sequence Diagram – BR/EDR Client Role
• W3C Web Bluetooth CG does not specify any API for BR/EDR related operations.
• HyWAI 3.5 API supports BR/EDR client role operations using socket-based communication.
• HyWAI 3.5 API uses BluetoothSocket objects for any read/write operations with remote server
devices.
HyWAI 3.5 Bluetooth API
III. Bluetooth API Sequence Diagram – BR/EDR Server Role
• W3C Web Bluetooth CG does not specify any API for BR/EDR related operations.
• HyWAI 3.5 API supports BR/EDR server role operations using socket-based communication.
• HyWAI 3.5 API uses BluetoothSocket objects for any read/write operations with remote client
devices.
HyWAI 3.5 Bluetooth API
30
Contact
 HyWAI is Hybrid Web Application Interface Platform
 If you have any questions and suggestions, please contact us.
 Jonghong Jeon (Principal Researcher)
• Tel: +82-42-860-5333
• Email : hollobit@etri.re.kr
 Seungyun Lee (Team Manager)
• Tel:+82-42-860-5508
• Email : syl@etri.re.kr

Contenu connexe

En vedette

Service workers 기초 및 활용 (Korean)
Service workers 기초 및 활용 (Korean)Service workers 기초 및 활용 (Korean)
Service workers 기초 및 활용 (Korean)jungkees
 
Hybrid App Platform - HyWAI 3.5
Hybrid App Platform - HyWAI 3.5Hybrid App Platform - HyWAI 3.5
Hybrid App Platform - HyWAI 3.5Jonathan Jeon
 
WebRTC 전망 최진호_webappscamp
WebRTC 전망 최진호_webappscampWebRTC 전망 최진호_webappscamp
WebRTC 전망 최진호_webappscampBlisson Choi
 
오픈소스와 거버넌스
오픈소스와 거버넌스오픈소스와 거버넌스
오픈소스와 거버넌스Kevin Kim
 
Webrtc 동향과 이슈 2016.08
Webrtc 동향과 이슈 2016.08Webrtc 동향과 이슈 2016.08
Webrtc 동향과 이슈 2016.08sung young son
 
Javascript and Web Performance
Javascript and Web PerformanceJavascript and Web Performance
Javascript and Web PerformanceJonathan Jeon
 
BTLE (Bluetooth Low Energy) and CoreBluetooth
BTLE (Bluetooth Low Energy) and CoreBluetooth BTLE (Bluetooth Low Energy) and CoreBluetooth
BTLE (Bluetooth Low Energy) and CoreBluetooth Zach Dennis
 
증강현실 기술 및 활용 트렌드(2013년)
증강현실 기술 및 활용 트렌드(2013년)증강현실 기술 및 활용 트렌드(2013년)
증강현실 기술 및 활용 트렌드(2013년)훈주 윤
 

En vedette (8)

Service workers 기초 및 활용 (Korean)
Service workers 기초 및 활용 (Korean)Service workers 기초 및 활용 (Korean)
Service workers 기초 및 활용 (Korean)
 
Hybrid App Platform - HyWAI 3.5
Hybrid App Platform - HyWAI 3.5Hybrid App Platform - HyWAI 3.5
Hybrid App Platform - HyWAI 3.5
 
WebRTC 전망 최진호_webappscamp
WebRTC 전망 최진호_webappscampWebRTC 전망 최진호_webappscamp
WebRTC 전망 최진호_webappscamp
 
오픈소스와 거버넌스
오픈소스와 거버넌스오픈소스와 거버넌스
오픈소스와 거버넌스
 
Webrtc 동향과 이슈 2016.08
Webrtc 동향과 이슈 2016.08Webrtc 동향과 이슈 2016.08
Webrtc 동향과 이슈 2016.08
 
Javascript and Web Performance
Javascript and Web PerformanceJavascript and Web Performance
Javascript and Web Performance
 
BTLE (Bluetooth Low Energy) and CoreBluetooth
BTLE (Bluetooth Low Energy) and CoreBluetooth BTLE (Bluetooth Low Energy) and CoreBluetooth
BTLE (Bluetooth Low Energy) and CoreBluetooth
 
증강현실 기술 및 활용 트렌드(2013년)
증강현실 기술 및 활용 트렌드(2013년)증강현실 기술 및 활용 트렌드(2013년)
증강현실 기술 및 활용 트렌드(2013년)
 

Similaire à HyWAI Web Bluetooth API

JSR 82 (bluetooth obex)
JSR 82 (bluetooth obex)JSR 82 (bluetooth obex)
JSR 82 (bluetooth obex)SMIJava
 
Android Wi-Fi Manager and Bluetooth Connection
Android Wi-Fi Manager and Bluetooth ConnectionAndroid Wi-Fi Manager and Bluetooth Connection
Android Wi-Fi Manager and Bluetooth ConnectionJussi Pohjolainen
 
Connect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low EnergyConnect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low EnergyGabor Paller
 
A brief overview of BLE on Android
A brief overview of BLE on AndroidA brief overview of BLE on Android
A brief overview of BLE on AndroidLuka Bašek
 
Attacking and Crashing IoT Devices via Bluetooth LE protocol
Attacking and Crashing IoT Devices via Bluetooth LE protocolAttacking and Crashing IoT Devices via Bluetooth LE protocol
Attacking and Crashing IoT Devices via Bluetooth LE protocolCysinfo Cyber Security Community
 
Bw13 session2 app_dev_presenter_final
Bw13 session2 app_dev_presenter_finalBw13 session2 app_dev_presenter_final
Bw13 session2 app_dev_presenter_finalBlair Poloskey
 
挖掘低耗電藍芽的寶藏
挖掘低耗電藍芽的寶藏挖掘低耗電藍芽的寶藏
挖掘低耗電藍芽的寶藏evan3rd
 
A Brief Introduction to Bluetooth Low Energy (BLE) on iOS
A Brief Introduction to Bluetooth Low Energy (BLE) on iOSA Brief Introduction to Bluetooth Low Energy (BLE) on iOS
A Brief Introduction to Bluetooth Low Energy (BLE) on iOSMatt Whitlock
 
Let's Get Physical
Let's Get PhysicalLet's Get Physical
Let's Get PhysicalJoel Lord
 
Can a browser become an IoT Gateway?
Can a browser become an IoT Gateway?Can a browser become an IoT Gateway?
Can a browser become an IoT Gateway?Sooraj Sanker
 
Bluetooth android application For interfacing with arduino
Bluetooth android application For interfacing with arduinoBluetooth android application For interfacing with arduino
Bluetooth android application For interfacing with arduinosumit chakraborty
 
FIWARE Tech Summit - FIWARE IoT Agents
FIWARE Tech Summit - FIWARE IoT AgentsFIWARE Tech Summit - FIWARE IoT Agents
FIWARE Tech Summit - FIWARE IoT AgentsFIWARE
 
Ble overview and_implementation
Ble overview and_implementationBle overview and_implementation
Ble overview and_implementationStanley Chang
 
IoT Seminar (Oct. 2016) Juan Perez - Microsoft
IoT Seminar (Oct. 2016) Juan Perez - MicrosoftIoT Seminar (Oct. 2016) Juan Perez - Microsoft
IoT Seminar (Oct. 2016) Juan Perez - MicrosoftOpen Mobile Alliance
 
Develop a portal to manage your IoT Hub solution
 Develop a portal to manage your IoT Hub solution Develop a portal to manage your IoT Hub solution
Develop a portal to manage your IoT Hub solutionMarco Parenzan
 
Bluetooth low energy final version
Bluetooth low energy final versionBluetooth low energy final version
Bluetooth low energy final versionFrederick Bousson
 
Automated location tracking_using_bluetooth
Automated location tracking_using_bluetoothAutomated location tracking_using_bluetooth
Automated location tracking_using_bluetoothabyaz
 

Similaire à HyWAI Web Bluetooth API (20)

JSR 82 (bluetooth obex)
JSR 82 (bluetooth obex)JSR 82 (bluetooth obex)
JSR 82 (bluetooth obex)
 
Android Wi-Fi Manager and Bluetooth Connection
Android Wi-Fi Manager and Bluetooth ConnectionAndroid Wi-Fi Manager and Bluetooth Connection
Android Wi-Fi Manager and Bluetooth Connection
 
Android & Beacons
Android & Beacons Android & Beacons
Android & Beacons
 
Connect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low EnergyConnect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low Energy
 
A brief overview of BLE on Android
A brief overview of BLE on AndroidA brief overview of BLE on Android
A brief overview of BLE on Android
 
Attacking and Crashing IoT Devices via Bluetooth LE protocol
Attacking and Crashing IoT Devices via Bluetooth LE protocolAttacking and Crashing IoT Devices via Bluetooth LE protocol
Attacking and Crashing IoT Devices via Bluetooth LE protocol
 
Bw13 session2 app_dev_presenter_final
Bw13 session2 app_dev_presenter_finalBw13 session2 app_dev_presenter_final
Bw13 session2 app_dev_presenter_final
 
挖掘低耗電藍芽的寶藏
挖掘低耗電藍芽的寶藏挖掘低耗電藍芽的寶藏
挖掘低耗電藍芽的寶藏
 
Eddystone beacons demo
Eddystone beacons demoEddystone beacons demo
Eddystone beacons demo
 
JAM805 - Beyond the Device
JAM805 -  Beyond the DeviceJAM805 -  Beyond the Device
JAM805 - Beyond the Device
 
A Brief Introduction to Bluetooth Low Energy (BLE) on iOS
A Brief Introduction to Bluetooth Low Energy (BLE) on iOSA Brief Introduction to Bluetooth Low Energy (BLE) on iOS
A Brief Introduction to Bluetooth Low Energy (BLE) on iOS
 
Let's Get Physical
Let's Get PhysicalLet's Get Physical
Let's Get Physical
 
Can a browser become an IoT Gateway?
Can a browser become an IoT Gateway?Can a browser become an IoT Gateway?
Can a browser become an IoT Gateway?
 
Bluetooth android application For interfacing with arduino
Bluetooth android application For interfacing with arduinoBluetooth android application For interfacing with arduino
Bluetooth android application For interfacing with arduino
 
FIWARE Tech Summit - FIWARE IoT Agents
FIWARE Tech Summit - FIWARE IoT AgentsFIWARE Tech Summit - FIWARE IoT Agents
FIWARE Tech Summit - FIWARE IoT Agents
 
Ble overview and_implementation
Ble overview and_implementationBle overview and_implementation
Ble overview and_implementation
 
IoT Seminar (Oct. 2016) Juan Perez - Microsoft
IoT Seminar (Oct. 2016) Juan Perez - MicrosoftIoT Seminar (Oct. 2016) Juan Perez - Microsoft
IoT Seminar (Oct. 2016) Juan Perez - Microsoft
 
Develop a portal to manage your IoT Hub solution
 Develop a portal to manage your IoT Hub solution Develop a portal to manage your IoT Hub solution
Develop a portal to manage your IoT Hub solution
 
Bluetooth low energy final version
Bluetooth low energy final versionBluetooth low energy final version
Bluetooth low energy final version
 
Automated location tracking_using_bluetooth
Automated location tracking_using_bluetoothAutomated location tracking_using_bluetooth
Automated location tracking_using_bluetooth
 

Plus de Jonathan Jeon

Standardization for Artificial Intelligence in Medicine
Standardization for Artificial Intelligence in MedicineStandardization for Artificial Intelligence in Medicine
Standardization for Artificial Intelligence in MedicineJonathan Jeon
 
IoT 및 인공지능을 활용한 헬스케어 제품․서비스 개발 동향 및 주요 과제
IoT 및 인공지능을 활용한  헬스케어 제품․서비스  개발 동향 및 주요 과제IoT 및 인공지능을 활용한  헬스케어 제품․서비스  개발 동향 및 주요 과제
IoT 및 인공지능을 활용한 헬스케어 제품․서비스 개발 동향 및 주요 과제Jonathan Jeon
 
헬스케어 웨어러블 : 주요 동향과 이슈
헬스케어 웨어러블 : 주요 동향과 이슈헬스케어 웨어러블 : 주요 동향과 이슈
헬스케어 웨어러블 : 주요 동향과 이슈Jonathan Jeon
 
4차 산업혁명 시대, 의료기기 표준화 이슈
4차 산업혁명 시대, 의료기기 표준화 이슈4차 산업혁명 시대, 의료기기 표준화 이슈
4차 산업혁명 시대, 의료기기 표준화 이슈Jonathan Jeon
 
Trends on standardization for smart wearable devices & services (ITU-T, OCF, ...
Trends on standardization for smart wearable devices & services (ITU-T, OCF, ...Trends on standardization for smart wearable devices & services (ITU-T, OCF, ...
Trends on standardization for smart wearable devices & services (ITU-T, OCF, ...Jonathan Jeon
 
AI and IoT : How do IoT and AI change the world?
AI and IoT : How do IoT and AI change the world?AI and IoT : How do IoT and AI change the world?
AI and IoT : How do IoT and AI change the world?Jonathan Jeon
 
Web Browser as Universal client for IoT
Web Browser as Universal client for IoTWeb Browser as Universal client for IoT
Web Browser as Universal client for IoTJonathan Jeon
 
OCF/IoTivity for Healthcare/Fitness/Wearable
OCF/IoTivity for Healthcare/Fitness/WearableOCF/IoTivity for Healthcare/Fitness/Wearable
OCF/IoTivity for Healthcare/Fitness/WearableJonathan Jeon
 
#3 Quantified Self Seoul Meetup
#3 Quantified Self Seoul Meetup #3 Quantified Self Seoul Meetup
#3 Quantified Self Seoul Meetup Jonathan Jeon
 
Trends on Smart Wearable Application Standardization
Trends on Smart Wearable Application StandardizationTrends on Smart Wearable Application Standardization
Trends on Smart Wearable Application StandardizationJonathan Jeon
 
New ICT Trends in CES 2016
New ICT Trends in CES 2016New ICT Trends in CES 2016
New ICT Trends in CES 2016Jonathan Jeon
 
The Web, After HTML5
The Web, After HTML5The Web, After HTML5
The Web, After HTML5Jonathan Jeon
 
Open Source and Open Standards
Open Source and Open StandardsOpen Source and Open Standards
Open Source and Open StandardsJonathan Jeon
 
Open Source and Open Standards
Open Source and Open StandardsOpen Source and Open Standards
Open Source and Open StandardsJonathan Jeon
 
WoT.js - WoT App. Framework for Open Source Hardware
WoT.js - WoT App. Framework for Open Source HardwareWoT.js - WoT App. Framework for Open Source Hardware
WoT.js - WoT App. Framework for Open Source HardwareJonathan Jeon
 
IoT and WoT (Internet of Things and Web of Things)
IoT and WoT (Internet of Things and Web of Things)IoT and WoT (Internet of Things and Web of Things)
IoT and WoT (Internet of Things and Web of Things)Jonathan Jeon
 
Web Technology and Standards Tutorial
Web Technology and Standards Tutorial Web Technology and Standards Tutorial
Web Technology and Standards Tutorial Jonathan Jeon
 
W3C 국제표준화 대응 전략
W3C 국제표준화 대응 전략W3C 국제표준화 대응 전략
W3C 국제표준화 대응 전략Jonathan Jeon
 
W3C TPAC 2014 Review
W3C TPAC 2014 Review W3C TPAC 2014 Review
W3C TPAC 2014 Review Jonathan Jeon
 

Plus de Jonathan Jeon (20)

Standardization for Artificial Intelligence in Medicine
Standardization for Artificial Intelligence in MedicineStandardization for Artificial Intelligence in Medicine
Standardization for Artificial Intelligence in Medicine
 
IoT 및 인공지능을 활용한 헬스케어 제품․서비스 개발 동향 및 주요 과제
IoT 및 인공지능을 활용한  헬스케어 제품․서비스  개발 동향 및 주요 과제IoT 및 인공지능을 활용한  헬스케어 제품․서비스  개발 동향 및 주요 과제
IoT 및 인공지능을 활용한 헬스케어 제품․서비스 개발 동향 및 주요 과제
 
헬스케어 웨어러블 : 주요 동향과 이슈
헬스케어 웨어러블 : 주요 동향과 이슈헬스케어 웨어러블 : 주요 동향과 이슈
헬스케어 웨어러블 : 주요 동향과 이슈
 
4차 산업혁명 시대, 의료기기 표준화 이슈
4차 산업혁명 시대, 의료기기 표준화 이슈4차 산업혁명 시대, 의료기기 표준화 이슈
4차 산업혁명 시대, 의료기기 표준화 이슈
 
Trends on standardization for smart wearable devices & services (ITU-T, OCF, ...
Trends on standardization for smart wearable devices & services (ITU-T, OCF, ...Trends on standardization for smart wearable devices & services (ITU-T, OCF, ...
Trends on standardization for smart wearable devices & services (ITU-T, OCF, ...
 
AI and IoT : How do IoT and AI change the world?
AI and IoT : How do IoT and AI change the world?AI and IoT : How do IoT and AI change the world?
AI and IoT : How do IoT and AI change the world?
 
Web Browser as Universal client for IoT
Web Browser as Universal client for IoTWeb Browser as Universal client for IoT
Web Browser as Universal client for IoT
 
OCF/IoTivity for Healthcare/Fitness/Wearable
OCF/IoTivity for Healthcare/Fitness/WearableOCF/IoTivity for Healthcare/Fitness/Wearable
OCF/IoTivity for Healthcare/Fitness/Wearable
 
#3 Quantified Self Seoul Meetup
#3 Quantified Self Seoul Meetup #3 Quantified Self Seoul Meetup
#3 Quantified Self Seoul Meetup
 
Trends on Smart Wearable Application Standardization
Trends on Smart Wearable Application StandardizationTrends on Smart Wearable Application Standardization
Trends on Smart Wearable Application Standardization
 
New ICT Trends in CES 2016
New ICT Trends in CES 2016New ICT Trends in CES 2016
New ICT Trends in CES 2016
 
The Web, After HTML5
The Web, After HTML5The Web, After HTML5
The Web, After HTML5
 
Open Source and Open Standards
Open Source and Open StandardsOpen Source and Open Standards
Open Source and Open Standards
 
Open Source and Open Standards
Open Source and Open StandardsOpen Source and Open Standards
Open Source and Open Standards
 
WoT.js - WoT App. Framework for Open Source Hardware
WoT.js - WoT App. Framework for Open Source HardwareWoT.js - WoT App. Framework for Open Source Hardware
WoT.js - WoT App. Framework for Open Source Hardware
 
IoT and WoT (Internet of Things and Web of Things)
IoT and WoT (Internet of Things and Web of Things)IoT and WoT (Internet of Things and Web of Things)
IoT and WoT (Internet of Things and Web of Things)
 
Web Technology and Standards Tutorial
Web Technology and Standards Tutorial Web Technology and Standards Tutorial
Web Technology and Standards Tutorial
 
Mobile, IoT and Web
Mobile, IoT and WebMobile, IoT and Web
Mobile, IoT and Web
 
W3C 국제표준화 대응 전략
W3C 국제표준화 대응 전략W3C 국제표준화 대응 전략
W3C 국제표준화 대응 전략
 
W3C TPAC 2014 Review
W3C TPAC 2014 Review W3C TPAC 2014 Review
W3C TPAC 2014 Review
 

Dernier

『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxmibuzondetrabajo
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxMario
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxAndrieCagasanAkio
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119APNIC
 
ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxNIMMANAGANTI RAMAKRISHNA
 

Dernier (11)

『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptx
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptx
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptx
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119
 
ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptx
 

HyWAI Web Bluetooth API

  • 1. 2015. 1. 8 HyWAI 3.5 Bluetooth API
  • 2. Table of Contents Bluetooth API Sequence Diagram Bluetooth API Comparison Chart1 3 Bluetooth API Web-IDL2
  • 3. W3C Web Bluetooth CG HyWAI 3.5 Bluetooth API BLE Support O O BR/EDR Support X Android only1 Pairing/Bonding Process Not specified Not specified (handled by native OS) LE Message Reception JavaScript promises Callback functions LE Message Transmission GATT attribute methods GATT attribute methods BR/EDR Communication Utilizes BLE interface Socket based communication Exception Handling Only outlines general guidelines Callback functions BLE Peripheral Support X iOS only1 BR/EDR Server Support X Android only1 I. Comparison of HyWAI Bluetooth API and W3C Web Bluetooth CG 3 1These operations are defined HyWAI 3.5 API, yet limitations are imposed by respective native operating systems.
  • 4. II. Bluetooth IDL – hywai.Bluetooth Methods • getDefaultAdapter • Returns default BluetoothAdapter instance for this device. • isLeEnabled • Checks if Bluetooth Low Energy is enabled by current device. • isBrEdrEnabled • Checks if BR/EDR is enabled by current device. • openServer • Opens Bluetooth BR/EDR Server with given name and UUID. Returns BluetoothServer instance. • openGattServer • Opens Bluetooth GATT Server and calls OnGattServerOpenCallback with new BluetoothGattServer instance. Parameter GattServerCallback object receives remote messages via its callback attributes. hywai.Bluetooth is HyWAI’s Bluetooth module object which serves as an entry point for all Bluetooth related operations including Bluetooth availability check, BluetoothAdapter retrieval, and server (BR/EDR and BLE) operations.
  • 5. II. Bluetooth IDL – BlutoothAdapter BluetoothAdapter, returned by hywai.Bluetooth object, is a singleton object responsible for Bluetooth peripheral discovery with given options and filters. Methods • startDiscovery • Starts to discover Bluetooth peripheral devices in range. Devices are filtered by given uuids, and OnDeviceFoundCallback is called with BluetoothDevice object whenever a device is discovered. • stopDiscovery • Stops discovery. As discovery operations are energy-intensive, this method should be called as soon as desired device has been discovered.
  • 6. II. Bluetooth IDL – BluetoothDiscoveryOption The BluetoothDiscoveryOption enumeration gives users a standardized way to specify types of Bluetooth devices to discover. Enumeration Description BLE Discover only Bluetooth Low Energy devices. CLASSIC Discover only Bluetooth BR/EDR devices. ALL Discover both Bluetooth LE and BR/EDR devices.
  • 7. II. Bluetooth IDL – BluetoothDevice (1/2) BluetoothDevice represents a peripheral or central Bluetooth Device object. It outlines device-related operations such as connection (BLE and BR/EDR) and various information access. Methods • getType • Returns a long representing the type of this device. (0 – Unknown, 1 – BR/EDR, 2 – BLE, 3 – DUAL) • getName • Returns human-friendly name of this device. • getDeviceId • Returns a uniquely assigned id for this device. • getUuids • Returns UUIDs advertised by this device. This method only works with devices discovered through BR/EDR discovery.
  • 8. II. Bluetooth IDL – BluetoothDevice (2/2) Methods • getServices • If cached is true, gets cached GATT services. Otherwise, fetches GATT services from remote device. Calls OnServicesGetCallback with BluetoothService objects representing retrieved services. • readRssi • Reads RSSI value of this device and calls OnRssiReadCallback with retrieved value. • getConnectionState • Calls OnConnectionStateCallback with device’s connection state. (0 – disconnected, 1 – connecting, 2 – connected, 3 – disconnecting) • createSocket • Creates a Bluetooth socket with given UUID for BR/EDR communication and calls OnSocketCreateCallback with BluetoothSocket object. BluetoothSocket, at return, is not connected and BluetoothSocket#connect should be explicitly called to initiate a connection. • connectGatt • Connects to the device using BLE for GATT interaction. Calls OnSuccessCallback upon successful connection. • disconnectGatt • Disconnects from the device’s GATT properties.
  • 9. II. Bluetooth IDL – BluetoothService (1/2) BluetoothService represents remote device’s GATT service. It contains methods for retrieving its attributes, included services, and characteristics. If created by user for GATT peripheral server operation, it can add characteristics and included services to itself. Methods • getId • Returns this service’s unique identifier. • getUuid • Returns this service’s UUID. • isPrimary • Returns whether this service is primary. • getIncludedServices • Calls OnIncludedServicesGetCallback with this service’s included services filtered by given UUIDs. If cached is true, returns cached services. Otherwise, fetches services from remote.
  • 10. II. Bluetooth IDL – BluetoothService (2/2) Methods • getCharacteristics • Calls OnCharacteristicsGetCallback with this service’s characteristics filtered by given UUIDs. If cached is true, returns cached characteristics. Otherwise, fetches characteristics from remote. • addCharacteristic • Adds a GATT characteristic represented as BluetoothCharacteristic object to this service and returns OnSuccessCallback if successful. Only accessible if object is created by user via constructor. • addIncludedService • Adds a GATT service represented as BluetoothService object to this service as included service and returns OnSuccessCallback if successful. Only accessible if object is created by user via constructor.
  • 11. II. Bluetooth IDL – BluetoothCharacteristic (1/2) BluetoothCharacteristic represents remote device’s GATT characteristic. It contains methods for retrieving its attributes, reading/writing values and subscribing for notifications. If created by user for GATT peripheral server operation, it can add descriptors to itself.
  • 12. II. Bluetooth IDL – BluetoothCharacteristic (2/2) Methods • getId • Returns this characteristic’s unique identifier. • getUuid • Returns this characteristic’s UUID. • setValue • Set’s this characteristic’s local value. • getPermissions • Calls OnGattPermissionsGetCallback with this characteristic’s GATT permissions. • getProperties • Calls OnCharacteristicPropertiesGetCallback with this characteristic’s properties. • getDescriptors • Calls OnDescriptorsGetCallback with this characteristic’s descriptors filtered by given UUIDs. If cached is true, returns cached descriptors. Otherwise, fetches descriptors from remote. • readValue • Calls OnCharacteristicValueReadCallback with this characteristic’s value. If cached is true, returns cached value. Otherwise, fetches value from remote. • writeValue • Writes given value to remote and calls OnCharacteristicValueWriteCallback with written value. • startNotification • Starts to notification for it’s value from remote device. OnCharacteristicvalueNotificationCallback is called with new value whenever a notification is received from remote. • stopNotification • Stops notification for this characteristic’s value. • getService • Calls OnServiceGetCallback with this characteristic’s GATT service. • addDescriptor • Adds a GATT descriptor represented as BluetoothDescriptor object to this characteristic and returns OnSuccessCallback if successful. Only accessible if object is created by user via constructor.
  • 13. II. Bluetooth IDL – BluetoothDescriptor BluetoothDescriptor represents remote device’s GATT descriptor. It contains methods for retrieving its attributes and reading/writing values. Methods • getId • Returns this descriptor’s unique identifier. • getUuid • Returns this descriptor’s UUID. • getPermissions • Calls OnCharacteristicGetCallback with this descriptor’s GATT characteristic. • setValue • Set’s this characteristic’s local value. • readValue • Calls OnDescriptorValueReadCallback with this descriptor’s value. If cached is true, returns cached value. Otherwise, fetches value from remote. • writeValue • Writes given value to remote and calls OnDescriptorValueWriteCallback with written value.
  • 14. II. Bluetooth IDL – CharacteristicProperty The CharacteristicProperty enumeration allows users to use standardized GATT characteristic property by name instead of using platform-specific bitwise operations. Enumeration Description PROPERTY_BROADCAST Characteristic is broadcastable. PROPERTY_EXTENDED_PROPS Characteristic has extended properties. PROPERTY_INDICATE Characteristic supports indication. PROPERTY_INDICATE_ENCRYPTED Characteristic supports encrypted indication. PROPERTY_NOTIFY Characteristic supports notification. PROPERTY_NOTIFY_ENCRYPTED Characteristic supports encrypted notification. PROPERTY_READ Characteristic is readable PROPERTY_SIGNED_WRITE Characteristic supports write with signature. PROPERTY_WRITE Characteristic can be written. PROPERTY_WRITE_NO_RESPONSE Characteristic can be written without response.
  • 15. II. Bluetooth IDL – GattPermission The GattPermission enumeration allows users to use standardized GATT permissions by name instead of using platform-specific bitwise operations. Enumeration Description PERMISSION_READ Characteristic read permission. PERMISSION_READ_ENCRPYTED Allow encrypted read operations. PERMISSION_READ_ENCRPYTED_MITM Allow reading with man-in-the-middle protection PERMISSION_WRITE Characteristic write permission. PERMISSION_WRITE_ENCRPYTED Allow encrypted writes. PERMISSION_WRITE_ENCRPYTED_MITM Allow encrypted writes with man-in-the-middle protection. PERMISSION_WRITE_SIGNED Allow signed write operations. PERMISSION_WRITE_SIGNED_MITM Allow signed writes with man-in-the-middle protection.
  • 16. II. Bluetooth IDL – BluetoothSocket (1/2) BluetoothSocket represents a socket connection between two Bluetooth devices. It contains methods for handling connections, retrieving connection information, and reading/writing data. Methods • getSocketId • Gets the unique identifier associated with this socket. • connect • Establishes a connection. Calls OnSocketConnectedCallback with connected socket object (this). • isConnected • Calls OnSocketConnectionStateCallback with current connection state. Returns true if connected. • close • Closes connection and calls OnSuccessCallback if successful. • startReadData • Starts to read data from this socket. OnDataReceiveCallback is called with value whenever data is received through the socket.
  • 17. II. Bluetooth IDL – BluetoothSocket (2/2) Methods • stopReadData • Stops reading data from this socket. • writeData • Writes given data to the socket. Calls OnSocketWriteDataCallback with length of data written. • getDevice • Calls OnDeviceGetCallback with BluetoothDevice object representing the Bluetooth device associated with this socket.
  • 18. II. Bluetooth IDL – BluetoothGattServer (1/2) BluetoothGattServer represents current device as a Bluetooth Peripheral in BLE mode. It contains methods to modify it’s server internals, advertise, send notifications, and send response to read/write requests. Methods • addService • Adds a GATT service to this server. • removeService • Removes a GATT service from this server. • clearServices • Removes all GATT services from this server. • getServices • Calls OnServicesGetCallback with GATT services added to this server.
  • 19. II. Bluetooth IDL – BluetoothGattServer (2/2) Methods • startAdvertising • Start advertising this server with given device name and service UUIDs. Calls OnAdvertisementStartCallback with advertisement data • stopAdvertising • Stops advertising this server. • isAdvertising • Calls OnAdvertisementStateGetCallback with boolean indicating whether this server is currently advertising. • sendCharacteristicNotification • Sends characteristic notifications to given Bluetooth devices for given characteristic and value. Calls OnSuccessCallback after sending notification. • sendResponse • Sends response to a read/write request for given Bluetooth device and request identifier with given value. • close • Closes this GATT server.
  • 20. II. Bluetooth IDL – BluetoothGattServerCallback BluetoothGattServerCallback contains Bluetooth GATT server callback functions as it’s attributes. These callback function attributes, implemented by user, are called whenever GATT server related events occur. These events include Characteristic subscription and unsubscription, service addition, and characteristic read/write request. Attributes • onCharacteristicSubscribe • Callback function called when a central device subscribes to this server’s characteristic. • onCharacteristicUnsubscribe • Callback function called when a central device unsubscribes from this server’s characteristic. • onServiceAdded • Callback function called when a GATT service is successfully added to this server. • onCharacteristicReadRequest • Callback function called when a central device requests to read given characteristic’s value. • onCharacteristicWriteRequest • Callback function called when a central device requests to write value to given characteristic. • onReadyToUpdateSubscribers • Callback function called when this server is ready to send notifications to subscribed centrals after previous attempt so send notifications.
  • 21. II. Bluetooth IDL – BluetoothServer BluetoothServer represents current device acting as Bluetooth BR/EDR server. It has methods to listen and stop listening to incoming connections. Methods • listen • Starts to listen to incoming connections. Calls OnDeviceConnectedCallback with a connected BluetoothSocket object whenever a device is connected to this server. • close • Stops listening to incoming connections.
  • 22. III. Bluetooth API Sequence Diagram – BLE Central Role Overview (1/2) W3C Web Bluetooth CG Specifications • W3C Web Bluetooth CG suggests mandating the user to initiate device discovery with a limited set of target UUIDs, therefore only exposing relevant devices for intended use. • Each operation is initiated by objects representing respective GATT attributes. • W3C Web Bluetooth CG only specifies API for BLE operations as a central role.
  • 23. III. Bluetooth API Sequence Diagram – BLE Central Role Overview (2/2) HyWAI 3.5 Bluetooth API • HyWAI 3.5 Bluetooth API imposes same security obligations as W3C Web Bluetooth CG does. • HyWAI specifically designates BluetoothAdapter object for starting/stopping device discovery. • Device discovery in HyWAI offers options to choose types (BLE, BR/EDR, or both) of target devices.
  • 24. III. Bluetooth API Sequence Diagram – BLE Central Role Discovery W3C Web Bluetooth CG Specifications • W3C Web Bluetooth only outlines general procedures for device discovery, where HyWAI 3.5 Bluetooth API specifies that BluetoothAdapter object retrieved from global hywai.Bluetooth should perform device discovery. • HyWAI 3.5 Bluetooth API allows users to stop discovery at will. • HyWAI 3.5 Bluetooth API uses callback functions for retrieving discovered devices. HyWAI 3.5 Bluetooth API
  • 25. III. Bluetooth API Sequence Diagram – BLE Central Role Connection W3C Web Bluetooth CG Specifications • W3C Web Bluetooth CG primarily uses Promises to handle asynchronous operations where HyWAI 3.5 Bluetooth API uses user-supplied callback functions. • Unlike W3C Web Bluetooth CG, HyWAI 3.5 Bluetooth API offers BR/EDR operations, thus specifying “Gatt” to indicate that the operations are BLE-specific. HyWAI 3.5 Bluetooth API
  • 26. III. Bluetooth API Sequence Diagram – BLE Central Role Communication • HyWAI 3.5 Bluetooth API allows users to decide whether to fetch values and GATT attributes from remote or to retrieve them from local caches. W3C Web Bluetooth CG Specifications HyWAI 3.5 Bluetooth API
  • 27. III. Bluetooth API Sequence Diagram – BLE Peripheral Role • W3C Web Bluetooth CG does not specify any API for BLE peripheral role. • HyWAI 3.5 API supports BLE peripheral role using BluetoothGattServer object for server operations (advertisement, outgoing messages) and GattServerCallback object for incoming requests and callbacks. HyWAI 3.5 Bluetooth API
  • 28. III. Bluetooth API Sequence Diagram – BR/EDR Client Role • W3C Web Bluetooth CG does not specify any API for BR/EDR related operations. • HyWAI 3.5 API supports BR/EDR client role operations using socket-based communication. • HyWAI 3.5 API uses BluetoothSocket objects for any read/write operations with remote server devices. HyWAI 3.5 Bluetooth API
  • 29. III. Bluetooth API Sequence Diagram – BR/EDR Server Role • W3C Web Bluetooth CG does not specify any API for BR/EDR related operations. • HyWAI 3.5 API supports BR/EDR server role operations using socket-based communication. • HyWAI 3.5 API uses BluetoothSocket objects for any read/write operations with remote client devices. HyWAI 3.5 Bluetooth API
  • 30. 30 Contact  HyWAI is Hybrid Web Application Interface Platform  If you have any questions and suggestions, please contact us.  Jonghong Jeon (Principal Researcher) • Tel: +82-42-860-5333 • Email : hollobit@etri.re.kr  Seungyun Lee (Team Manager) • Tel:+82-42-860-5508 • Email : syl@etri.re.kr