• No results found

JSR 82 BT APIs Prof. Dr. S. Heiss / 1. Bluetooth. JSR 82 Java APIs for Bluetooth Wireless Technology

N/A
N/A
Protected

Academic year: 2021

Share "JSR 82 BT APIs Prof. Dr. S. Heiss / 1. Bluetooth. JSR 82 Java APIs for Bluetooth Wireless Technology"

Copied!
36
0
0

Loading.... (view fulltext now)

Full text

(1)

Bluetooth

JSR 82

(2)

JSR 82 – Bluetooth APIs

Umfangreiche Spezifikation unter:

JSR 82 definiert optionale Pakete:

javax.bluetooth

javax.obex

(3)

Bluetooth Protokolle

Host Controller Interface Link Manager Protocol

Logical Link Control and Adaption Protocol

RS-232 serial connection over Bluetooth

Object Exchange Protocol Service Discovery Protocol

(4)

Der BT-Transceiver

LocalDevice

(5)

LocalDevice

Instanz einer Repräsentation des BT-Geräts

LocalDevice.getLocalDevice()

Eigenschaften des BT-Geräts

getBluetoothAddress()

getFriendlyName()

getDiscoverable()

getDeviceClass()

getProperty()

(siehe folgende Seite)

[isPowerOn()]

(ab JSR 82, v1.1, Absturz bei N95)

(6)
(7)

DeviceClass

getServiceClasses()

getMajorDeviceClass()

(8)

DeviceClass -

getServiceClasses()

0x002000 Limited Discoverable Mode

0x010000 Positioning (Location identification)

0x020000 Networking (LAN, Ad hoc, ...)

0x040000 Rendering (Printing, Speaker, ...)

0x080000 Capturing (Scanner, Microphone, ...)

0x100000 Object Transfer (v-Inbox, v-Folder, ...)

0x200000 Audio (Speaker, Microphone, Headset, ...)

0x400000 Telephony (Cordless telephony, Modem, ...)

(9)

DeviceClass -

getMajorDeviceClass()

0x0000 Miscellaneous

0x0100 Computer (desktop, notebook, PDA, ...)

0x0200 Phone (cellular, cordless, payphone, ...)

0x0300 LAN/Network Access point

0x0400 Audio/Video (headset, speaker, stereo, ...)

0x0500 Peripheral (mouse, joystick, keyboards, ..)

0x0600 Imaging (printing, scanner, camera, ...)

0x0700 Wearable

(10)

DeviceClass -

getMinorDeviceClass()

- Computer

Major Device Class

0x0100

0x00 Uncategorized

0x04 Desktop workstation

0x08 Server-class computer

0x0C Laptop

0x10 Handheld PC/PDA (clam shell)

0x14 Palm sized PC/PDA

(11)

DeviceClass -

getMinorDeviceClass()

- Phone

Major Device Class

0x0200

0x00 Uncategorized

0x04 Cellular

0x08 Cordless

0x0C Smart phone

0x10 Wired modem or voice gateway

(12)

DeviceClass -

getMinorDeviceClass()

- LAN AP

Major Device Class

0x0300

0x00 Fully available 0x04 1 - 17% utilized 0x08 17 - 33% utilized 0x0C 33 - 50% utilized 0x10 50 - 67% utilized 0x14 67 - 83% utilized 0x18 83 - 99% utilized 0x1C No service available

(13)

DeviceClass -

getMinorDeviceClass()

- Audio/Video

Major Device Class

0x0400

0x00 Uncategorized

0x04 Wearable Headset Device

0x08 Hands-free Device 0x0C Reserved 0x10 Microphone 0x14 Loudspeaker 0x18 Headphones 0x1C Portable Audio

(14)

DeviceClass -

getMinorDeviceClass()

- Audio/Video

Major Device Class

0x0400

0x20 Car audio

0x24 Set-top box

0x28 HiFi Audio Device

0x2C VCR

0x30 Video Camera

0x34 Camcorder

0x38 Video Monitor

(15)

DeviceClass -

getMinorDeviceClass()

- Audio/Video

Major Device Class

0x0400

0x40 Video Conferencing

0x44 Reserved 0x48 Gaming/Toy

(16)

DeviceClass -

getMinorDeviceClass()

- Peripheral

Major Device Class

0x0500

Keyboard/Pointing Device field (may be combined

with lower bit fields in multifunctional devices)

0x00 Not Keyboard / Not Pointing Device

0x40 Keyboard

0x80 Pointing device

(17)

DeviceClass -

getMinorDeviceClass()

- Peripheral

Major Device Class

0x0500

0x00 Uncategorized 0x04 Joystick 0x08 Gamepad 0x0C Remote control 0x10 Sensing device 0x14 Digitizer tablet

0x18 Card Reader (e.g. SIM Card Reader)

(18)

DeviceClass -

getMinorDeviceClass()

- Imaging

Major Device Class

0x0600

0x00 Uncategorized

0x10 Display

0x20 Camera

0x40 Scanner

(19)

DeviceClass -

getMinorDeviceClass()

- Wearable

Major Device Class

0x0700

0x04 Wrist Watch

0x08 Pager

0x0C Jacket

0x10 Helmet

(20)

DeviceClass -

getMinorDeviceClass()

- Toy

Major Device Class

0x0800

0x04 Robot

0x08 Vehicle

0x0C Doll/Action Figure

0x10 Controller

(21)

Device Discovery und

Service Search

RemoteDevice

DiscoveryAgent

(22)

DiscoveryAgent und DiscoveryListener

Instanz eines DiscoveryAgents

LocalDevice.getLocalDevice().getDiscoveryAgent()

Device Discovery

startInquiry(), cancelInquiry()

Service Search

searchServices(), cancelServiceSearch(), selectService()

Cached und Preknown Remote Devices

retrieveDevices()

DiscoveryListener

(23)

Device Discovery

DiscoveryAgent

startInquiry(int accessCode, DiscoveryListener listener)

cancelInquiry( DiscoveryListener listener )

DiscoveryListener

deviceDiscovered( RemoteDevice btDevice, DeviceClass cod )

(24)

Device Discovery - DiscoveryAgent

startInquiry(

int accessCode, DiscoveryListener listener )

Access Codes

DiscoveryAgent.GIAC

(25)

Device Discovery - DiscoveryListener

deviceDiscovered( RemoteDevice rd, DeviceClass cod )

inquiryCompleted( int discType )

RemoteDevice DeviceClass

(26)

Service Search (Service Discovery Protocol - SDP)

DiscoveryAgent

searchServices( int[] attrSet, UUID[] uuidSet, RemoteDevice dev, DiscoveryListener listener )

cancelServiceSearch( int transID )

selectService( UUID uuid, int security, boolean master )

DiscoveryListener

servicesDiscovered( int transID, ServiceRecord[] records )

(27)

Service Search - DiscoveryAgent

searchServices( int[] attrSet, UUID[] uuidSet, RemoteDevice dev, DiscoveryListener listener )

Abfrage aller vom RemoteDevice

dev

zur Verfügung

gestellten Services, die alle in

uuidSet

vorhandene

UUIDs in dem entsprechenden SDDB-Eintrag enthält.

attrSet

: Attribute, die zusätzlich zu den

Default-Attributen in den aufgrund des

searchServices()

Requests in den Aufrufen der Method

servicesDiscovered()

des

listener

Objekts in den

(28)

Default-Attribute

Service Search – BT Service Attributes

Wichtige Service-Attribute (BT Assigned Numbers)

Quelle: JSR 82 JavaDoc für das Interface ServiceRecord der Forum Nokia Library (http://library.forum.nokia.com/)

Base attribute ID value for the primary language is 0x0100

(29)

UUIDs – Universally Unique Identifier

Wichtige UUIDs für Protokolle und Serviceklassen

(BT Assigned Numbers)

Quelle: JSR 82 JavaDoc für die Klasse UUID der

(30)

Service Search - DiscoveryAgent

searchServices( int[] attrSet, UUID[] uuidSet, RemoteDevice dev, DiscoveryListener listener )

(31)

Service Search – DiscoveryListener

servicesDiscovered(

int transID, ServiceRecord[] records )

serviceSearchCompleted( int transID, int code )

(32)

ServiceRecord und DataElement

ServiceRecord

getAttributeIDs()getAttributeValue( int attrID )getConnectionURL( int requiredSecurity, boolean mustBeMaster ) DataElement

DataElement

(33)

BT-Verbindungen

(Server und Client)

Generic Connection Framework

DiscoveryAgent

(34)

BT-Server – Generic Connection Framework (GCF)

Server Loop

javax.microedition.io.Connector

open( String url )

acceptAndOpen() StreamConnection StreamConnectionNotifier

(35)

BT-Server – Generic Connection Framework (GCF)

(36)

BT-Client – Generic Connection Framework (GCF)

Verbindungsaufbau mit der URL, die vom entsp.

ServiceRecord der Servicesuche bekannt ist

javax.microedition.io.Connector

References

Related documents

Here, we initially examined 2D:4D in relation to self-reported religious affiliation and questionnaire measures of general religiosity, spirituality, religious

„ If a store files bankruptcy and you haven’t received the merchandise you have paid for, you are a creditor of the store and ordinarily can file a claim with the bankruptcy court..

Given N (either 1, 2, 3 or 4), the context of a form occurrence is N forms preceding this occurrence and N forms following this occurrence (ignore sentence boundaries, use empty

No difference was found in either the inhaled corticosteroid dose or the exacerbation frequency between children with moderate-severe asthma randomised to either standard or

Dari hasil permasalahan inilah fisioterapi mengambil peran yang cukup penting pada kasus cerebral palsy spastic quadriplegi ec microcephalus yang disebabkan oleh

• In view of the approximation of the sinq-function by the characteristic poly- nomials of the matrix Laplacians, it would certainly be worth studying the spectral asymptotics

A master can create two types of logical channel with a slave device: Asynchronous Connection Less (ACL): Packet Switched System provides a reliable data connection with a best

Public land surveying system, a surveyed east-west (i.e. latitudinal) reference line, often hundreds of miles in length, from which tiers of.. townships are are surveyed to the