BlipNet API - PowerPoint PPT Presentation

Loading...

PPT – BlipNet API PowerPoint presentation | free to download - id: 2084e2-ZDc1Z



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

BlipNet API

Description:

Enable Name Lookup to get Friendly Names of Detected devices ... Phone, Laptop, PDA, Peripheral, etc. and/or devices that support specific features ... – PowerPoint PPT presentation

Number of Views:15
Avg rating:3.0/5.0
Slides: 75
Provided by: janjus
Learn more at: http://www.itu.dk
Category:
Tags: api | blipnet | lookup | phone

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: BlipNet API


1
BlipNet API
  • Jan Justesen
  • Software Designer
  • jan.justesen_at_blipsystems.com

2
Agenda
  • BlipNet API features
  • Implementation Details
  • Positioning with BlipNet
  • Building End2End Solutions

3
BlipNet API Features
  • BlipNet API features
  • Implementation Details
  • Positioning with BlipNet
  • Building End2End Solutions

4
BlipNet API Features
  • Dynamic Configuration of BlipNodes
  • Bluetooth Device Discovery
  • Service Discovery on Bluetooth Devices
  • Connection Establishment and Monitoring
  • Interaction with Services on other Devices
  • Monitoring Client Usage of BlipNet provided
    services
  • Serial Port Server Service

5
Dynamic BlipNode Configuration
  • Friendly Name
  • Discoverability and Connectability Settings
  • Security Mode
  • Output Power Control
  • Link Status Measurement Settings
  • Lots of other Advanced Bluetooth Settings
  • AFH Channel Map
  • Inquiry and Page Scan Settings
  • ......
  • See API documentation for more

6
BlipNet API Features
  • Dynamic Configuration of BlipNodes
  • Bluetooth Device Discovery
  • Service Discovery on Bluetooth Devices
  • Connection Establishment and Monitoring
  • Interaction with Services on other Devices
  • Monitoring Client Usage of BlipNet provided
    services
  • Serial Port Server Service

7
Bluetooth Device Discovery
  • Detect other Bluetooth Devices in range of the
    BlipNode
  • Inquiry Events include
  • Bluetooth Address
  • Clock Information for accelerated Paging
  • RSSI Value
  • Enable Name Lookup to get Friendly Names of
    Detected devices
  • Serious impact on frequency of detection in
    continous inquiry

8
BlipNet API Features
  • Dynamic Configuration of BlipNodes
  • Bluetooth Device Discovery
  • Service Discovery on Bluetooth Devices
  • Connection Establishment and Monitoring
  • Interaction with Services on other Devices
  • Monitoring Client Usage of BlipNet provided
    services
  • Serial Port Server Service

9
Service Discovery (SDP)
  • Discover Available Services on a Bluetooth Device
  • Service Browsing
  • List available services on Device
  • Service Discovery
  • Read Entire Service Record
  • Service Name
  • Service Description
  • and much more...
  • It is possible to identify device type in some
    cases

10
BlipNet API Features
  • Dynamic Configuration of BlipNodes
  • Bluetooth Device Discovery
  • Service Discovery on Bluetooth Devices
  • Connection Establishment and Monitoring
  • Interaction with Services on other Devices
  • Monitoring Client Usage of BlipNet provided
    services
  • Serial Port Server Service

11
Connection Establishment - Clock Sync
  • Application can control Connection Establishment
  • Use ConnectData from Inquiry Events to decrease
    Paging Time
  • 200 ms
  • Pseudo Clock synchronization betweenBlipNodes
    enables fast connectionsetup even with shared
    ConnectData

12
Connection Establishment - Power Control
  • Power can be controlled for two phases
  • Paging/Inquiry phase
  • ACL link phase
  • Range can be controlled, via output power, from
    100 to 0 meter.

Zone for active ACL link,


Determined by Link Power


Application

BlipServer

Zone for Inquiry/Paging


Determined by Link Establishment Power

13
Connection Establishment - new Features
  • Monitor Status of Active Links
  • RSSI and BER (and AFH Channel Map)
  • BlipServer automatically manages Connections for
    multiple applications

14
BlipNet API Features
  • Dynamic Configuration of BlipNodes
  • Bluetooth Device Discovery
  • Service Discovery on Bluetooth Devices
  • Connection Establishment and Monitoring
  • Interaction with Services on other Devices
  • Monitoring Client Usage of BlipNet provided
    services
  • Serial Port Server Service

15
Interaction with Services on other Devices
  • Profile Package for each of the BlipNode Client
    Profiles
  • ProfileHandler
  • EventListener interface
  • Event interface
  • Any Additional Profile Specific Classes
  • Supported Profiles
  • OBEX Object Push
  • OBEX File Transfer
  • Serial Port
  • NAP Invoked PAN Sessions

16
BlipNet API Features
  • Dynamic Configuration of BlipNodes
  • Bluetooth Device Discovery
  • Service Discovery on Bluetooth Devices
  • Connection Establishment and Monitoring
  • Interaction with Services on other Devices
  • Monitoring Client Usage of BlipNet provided
    services
  • Serial Port Server Service

17
Monitoring BlipNet Services
  • Event Based Monitoring
  • Client Connections and Service usage
  • Sesssion Statistics for each Session
  • Start and End Time
  • Bytes Sent and Received
  • BlipNet Provides
  • Object Push Server
  • File Transfer Server
  • Serial Port Server
  • PAN Server
  • LAP Server (deprecated profile)
  • Add eventlisteners to BlipServerConnection for
    BlipNet wide monitoring

18
BlipNet API Features
  • Dynamic Configuration of BlipNodes
  • Bluetooth Device Discovery
  • Service Discovery on Bluetooth Devices
  • Connection Establishment and Monitoring
  • Interaction with Services on other Devices
  • Monitoring Client Usage of BlipNet provided
    services
  • Serial Port Server Service

19
Serial Port Server Service
  • Application Registers Service on BlipNode
  • SerialPort API same as SPP Client

20
Implementation Details
  • BlipNet API features
  • Implementation Details
  • Positioning with BlipNet
  • Building End2End Solutions

21
Implementation Details
  • BlipServer Architecture
  • Event Model
  • BlipNet API Structure
  • Inquiry
  • Connection Management and Monitoring
  • Client Profile APIs

22
BlipServer Architecture
RMI
MAL / TCP
BlipNodeHandle (Stub)
ConnectionHandler
BlipNodeHandle (Implementation)
BlipNode Components
InquiryHandler
...
ProfileHandlers
Model
EventListener (Implementation)
EventListener (Stub)
Event Dispatcher
BlipServerConnection (Stub)
BlipServerConnection (Implementation)
DB
23
Implementation Details
  • BlipServer Architecture
  • Event Model
  • BlipNet API Structure
  • Inquiry
  • Connection Management and Monitoring
  • Client Profile APIs

24
Event Model
  • Generic Event Interface
  • Defines Event Classes
  • Extended Event Interface for each event class
  • Defines Event Types
  • Getter methods for event related data
  • Note! Not all data included in all event types
  • EventHandler interface for each event class
  • Defines handleXxxxEvent() method
  • Filtering
  • BlipNode Bluetooth Address
  • Terminal Bluetooth Address
  • EventID

25
Event Dispatch Implementation
  • On the Server Side
  • Single Threaded Event Dispatcher
  • Dispatches events sequentially to all registered
    listeners
  • Separate Dispatcher for Inquiry Events
  • On the Client Side
  • Single Threaded Event Queue for each Listener
  • Multiple Listeners on client side may be called
    concurrently

26
Implementation Details
  • BlipServer Architecture
  • Event Model
  • BlipNet API Structure
  • Inquiry
  • Connection Management and Monitoring
  • Client Profile APIs

27
BlipNet API Structure
OPP
FTP
PAN
FTP
ConnectionHandler
InquiryHandler
ProfileHandler
BlipNodeHandle
BlipNodeHandle
BlipNodeHandle
BlipServerConnection
28
BlipNet API Packages
  • com.blipsystems.blipnet.api.blipserver
  • Static factory class for getting connections to
    the server
  • BlipServerConnection interface
  • com.blipsystems.blipnet.api.blipnode
  • Classes and Interfaces for interacting with
    BlipNodes
  • com.blipsystems.blipnet.api.event
  • General Event definitions and handlers
  • com.blipsystems.blipnet.api.profile
  • Sub-package for each profile
  • Profile Specific events and eventlisteners
  • Profile Specific classes and interfaces
  • com.blipsystems.blipnet.api.bluetooth
  • Bluetooth related support classes

29
The BlipServerConnection
  • The applications entry-point to the BlipServer
  • Restricted Access
  • Username / Password / Hostname
  • Functionality
  • Add remove global event listeners
  • Get status information from server
  • Get access to BlipNodes

30
The BlipNodeHandle
  • One to One mapping to physical BlipNodes
  • Locking mechanism for exclusive access to
    BlipNode Settings and Inquiry
  • Create ShutdownHook to ensure release! -
    Runtime.addShutdownHook(Thread hook)
  • Functionality
  • Reading status information for the BlipNode
  • Managing dynamic configuration settings
  • Adding/Removing event listeners
  • Access to Handlers for Logical groupings of
    functionality
  • InquiryHandler
  • ConnectionHandler
  • WirelessHandler
  • ProfileHandlers SDP(c), OPP(c), FTP(c), SPP(c),
    SPP(s), PAN(s)

31
Getting the BlipNodeHandles
  • import com.blipsystems.blipnet.blipserver.
  • import com.blipsystems.blipnet.blipnode.
  • try
  • BlipServerConnection server
    BlipServer.getConnection(user,pass,host)
  • BlipNodeHandle handles server.getBlipNodeHa
    ndles(blipnode_group,

  • config_group,

  • incl_reserved,

  • incl_disconnected)
  • catch (BlipServerConnectionException e)
  • // Communication problems
  • catch (BlipServerAccessException e)
  • // Invalid username/password

32
Implementation Details
  • BlipServer Architecture
  • Event Model
  • BlipNet API Structure
  • Inquiry
  • Connection Management and Monitoring
  • Client Profile APIs

33
Inquiry
  • InquiryHandler
  • Setting Inquiry Filters
  • Starting and Stopping Inquiry
  • InquiryData
  • Inquiry Period, Inquiry Interval
  • (Note! 90 hit-rate within 5-6 seconds)
  • Enable RSSI measurement
  • Enable Name Lookup
  • Enable Continuous Inquiry
  • InquiryEvent
  • Bluetooth Address of Device
  • RSSI value
  • ConnectData with Clock Information

34
Inquiry Filtering
  • Filtering on Class Of Device
  • Enables search for certain types of devices
  • Phone, Laptop, PDA, Peripheral, etc.
  • and/or devices that support specific features
  • Networking, Rendering, Object Transfer, Audio,
    etc.
  • Filtering on Bluetooth Address
  • Ignore detections of a certain BluetoothAddress
  • Possible to specify timeout
  • Useful for automated periodic actions towards
    detected devices

35
Inquiry Procedure
  • Inquiry Result Events for all detected terminals
  • Inquiry Complete Event (when Inquiry Period is
    over)
  • If name lookup is enabled
  • Friendly Name Detected events for detected
    terminals on which name lookup succeeds
  • Name Lookup Complete event when name lookup is
    done
  • If Continous Inquiry Enabled
  • Start next Inquiry Period

36
Application Steps
  • Register InquiryEventListener
  • On Server or on BlipNode
  • Start Inquiry on BlipNode
  • Configure Inquiry Period length and interval
  • Measure RSSI?
  • Lookup friendly-names?
  • EventListener will get an event each time a
    terminal is detected
  • Multiple detections in one inquiry period
    (especially 1.2 devices)

37
Setting Inquiry Filter
  • InquiryHandler inquiry blipnodeHandle.getInquiry
    Handler()
  • PhoneClassOfDevice phoneCOD
  • new PhoneClassOfDevice(
  • PhoneClassOfDevice.MINOR_CLASS_
    SMART_PHONE)
  • phoneCOD.setObjectTransfer(true)
  • ComputerClassOfDevice compCOD
  • new ComputerClassOfDevice(
  • ComputerClassOfDevice.MINOR_CLA
    SS_PALM_SIZED_PC_OR_PDA)
  • inquiry.setInquiryFilter(new GenericClassOfDevice
    phoneCOD, compCOD)

38
Starting Inquiry
  • InquiryHandler inquiry blipnodeHandle.getInquiry
    Handler()
  • // ...
  • inquiry.setInquiryFilter(new GenericClassOfDevice
    phoneCOD, compCOD)
  • InquiryData inquiryData new InquiryData(5, 0)
  • inquiryData.setContinousInquiryEnabled(true)
  • inquiryData.setRssiMeasurementEnabled(true)
  • inquiry.startInquiry(inquiryData)

39
The InquiryEventListener
  • public class Foo implements InquiryEventListener
  • public void handleInquiryEvent(InquiryEvent
    evt)
  • int eventID evt.getEventID()
  • BluetoothAddress terminalID
  • switch (eventID)
  • case InquiryEvent.TERMINAL_DETECTED
  • terminalID evt.getTerminalID()
  • ConnectData connectData
    evt.getConnectData()
  • int rssi evt.getRssiResult()0
  • // Do something
  • break
  • case InquiryEvent.FRIENDLY_NAME_DETECTED
  • terminalID evt.getTerminalID()
  • String friendlyName
    evt.getFriendlyName()
  • // Do something
  • break
  • case InquiryEvent.INQUIRY_COMPLETE
  • case InquiryEvent.NAME_LOOKUP_COMPLETE

40
Implementation Details
  • BlipServer Architecture
  • Event Model
  • BlipNet API Structure
  • Inquiry
  • Connection Management and Monitoring
  • Client Profile APIs

41
Connection Management
  • Bluetooth Connections can be managed manually by
    application or automatically by BlipServer
  • Use ConnectionHandler to manually control
    Bluetooth Links
  • Use ProfileHandlers directly, and let BlipServer
    manage links and sessions
  • BlipServer Managed Links are kept active as long
    as there are sessions running on the Connection
  • Manually established links become Managed when
    link owner requests disconnect

42
Connection Status Monitoring
  • Read RSSI and BER on active Links
  • RSSI affected by Golden Receiver Range
  • BER should be lt 0.1 for a workable link
  • Configurable Measurement interval
  • gt 100 ms
  • Status Readings are sent to ConnectionEventListene
    rs
  • CONNECTION_STATUS event

43
Connection Status Monitoring
  • public class StatusMonitor implements
    ConnectionEventListener
  • public static void main(String args)
  • new StatusMonitor()
  • public StatusMonitor()
  • try
  • // ...
  • blipNodeHandle.getConnectionHandler().
    addEventListener(this)
  • catch (BlipServerConnectionException e)
  • public void handleConnectionEvent(ConnectionEv
    ent evt)
  • int eventID evt.getEventID()
  • BluetoothAddress terminalID
    evt.getTerminalID()
  • if (eventID ConnectionEvent.CONNECTION_
    STATUS)
  • int rssi evt.getRssiResult()0

44
Implementation Details
  • BlipServer Architecture
  • Event Model
  • BlipNet API Structure
  • Inquiry
  • Connection Management and Monitoring
  • Client Profile APIs

45
Object Push Profile (OPP)
  • OBEX Based
  • Defines Three Operations
  • Push
  • Send any kind of object to OPP Server Device
  • Server may reject certain object types
  • Business Card Pull
  • Pull default business card from OPP server device
  • No other objects can be pulled
  • Business Card Exchange
  • Exchange Business Cards with OPP Server Device
  • Combined PullnPush

46
OPP Client Classes
47
OPP Client Sample
  • Connect to OPP Server Device
  • Push a .jpg file
  • Disconnect
  • public class OppSample implements
    OppClientEventListener
  • // Initiate operation
  • public void connect()
  • // Implement Event Listeners
  • public void handleOppClientEvent(OppClientEvent
    evt)

48
OPP Client Sample
49
OPP Client Sample
50
File Transfer Profile (FTP)
  • OBEX Based
  • Defines Six Operations
  • Push
  • Push any kind of object to server device
  • Pull
  • Pull any kind of object from server device
  • Delete
  • Delete object from server device
  • Set Path
  • Change the current folder on server device
  • Folder Listing
  • List files and sub-folders in current folder on
    server device
  • Create Folder
  • Create a new folder on server device

51
File Transfer Profile
  • NOTE!
  • On connect, current folder is alway root folder
    on the device
  • All operations are performed in the current
    folder on the server device
  • Must use manual session control if using Set Path
    operation

52
File Transfer Classes
53
Serial Port Profile (SPP)
  • Serial Cable Replacement
  • Transfer Serial data over Bluetooth
  • Supported by Bluetooth Enabled phones, PDAs,
    Computers, and Industrial Devices
  • BlipNet API provides BluetoothSerialPort

54
Bluetooth Serial Port
  • BluetoothSerialPort
  • Contains input and output streams
  • Set / Remove SerialPortEventListener
  • SerialPortEventListener
  • Single method serialEvent
  • SerialPortEvent
  • DATA_AVAILABLE
  • OUTPUT_BUFFER_EMPTY
  • SppInputStream and SppOutputStream
  • Extends java.io.InputStream and
    java.io.OutputStream

55
Serial Port Profile Classes
56
SPP Client Sample
  • Connect to SPP Server Device
  • Read up to 200 bytes data
  • Echo the data back to the Server
  • Disconnect
  • public class SppSample implements
    SppClientEventListener, SessionEventListener
  • // Request serial port
  • public void connect(BlipNodeHandle handle)
  • // Implement Event Listeners
  • public void handleSppClientEvent(SppClientEvent
    evt)
  • public void handleSessionEvent(SessionEvent
    evt)

57
SPP Client Sample
58
SPP Client Sample
59
SPP Client Sample
60
SPP Server Classes
61
SPP Server Sample
  • Register service on BlipNodeHandle
  • Listen for incoming connections, and say Hello
  • public class SppServerSample implements
    SppServerEventListener
  • // Request serial port
  • public void start(BlipNodeHandle handle)
  • // Implement Event Listener
  • public void handleSppClientEvent(SppClientEvent
    evt)

62
SPP Server Sample
63
SPP Server Sample
64
Personal Area Network (PAN)
  • Ethernet Cable Replacement
  • Bridge Ethernet traffic over Bluetooth
  • Supported by Bluetooth Enabled PDAs and
    Computers
  • NAP invoked PAN sessions
  • BlipNode is PAN Server
  • Detect IP Address of Connected Devices

65
Personal Area Network (PAN)
66
Positioning with BlipNet
  • BlipNet API features
  • Implementation Details
  • Positioning with BlipNet
  • Building End2End Solutions

67
Positioning methods
  • ACL Based
  • Using RSSI and BER on active ACL connections
  • Inquiry Based
  • Using RSSI from Inquiry Events

68
RSSI and BER on ACL links
  • RSSI
  • Value between 20 and -10 (0 is best)
  • Affected by Golden Receiver Range
  • Adaptive power control widens deadband
  • RSSI on ACL doesnt say much about distance
  • BER
  • Value reported in percent by BlipNet API
  • A link with a BER between 0 and 0.1 is workable
  • A link with a BER above 1 will give very poor
    results

GRR
69
RSSI and BER on ACL links (2)
  • Measurement Frequency
  • Configurable through LinkMeasurementSettings
  • blipNodeSettings.setLinkMeasurementSettings(...)
  • public interface LinkMeasurementSettings
  • public void setEnabled(boolean enabled)
  • public void setMeasurementInterval(int
    interval)
  • public void setRssiZones(byte
    rssiZones)
  • public void setLinkQualityZones(double
    qualZones)
  • Measurement Zones
  • Measurement data only sent when RSSI or BER
    changes from one zone to another

70
RSSI and BER on ACL Links (3)
  • Measurement Zones example
  • RSSI Zones -10, -5, 0, 5 defines the
    following zones
  • Zone1 RSSI lt -10
  • Zone2 -10 lt RSSI lt -5
  • Zone3 -5 lt RSSI lt 0
  • Zone4 0 lt RSSI lt 5
  • Zone5 RSSI gt 5
  • Measurement Sequence
  • RSSI 0 -gt Zone3 -gt Status event sent (first
    measurement)
  • RSSI -2 -gt Zone3 -gt No Status event
  • RSSI -8 -gt Zone2 -gt Status Event sent
  • RSSI -9 -gt Zone2 -gt No Status event
  • RSSI -10 -gt Zone1 -gt Status Event sent

71
Positioning using ACL
  • Fast triangulation is possible with clock sync
    feature
  • Positioning solutions has been made in real life
    based on this method


X,Y

Sequence

Application


BlipServer
1. Inquiry event

2. Page command

3. RSSI info


4. Position of PDA is estimated.
72
RSSI on Inquiry
  • RSSI Value between -20 and -90
  • Incoming Signal Strength (dBm)
  • Better for range detection
  • Not affected by Golden Receiver Range

73
Link
  • Master Thesis on Positioning using Bluetooth
    (BlipNet)
  • http//kom.aau.dk/jf/documents.htm

74
Building End2End Solutions
  • BlipNet API features
  • Implementation Details
  • Positioning with BlipNet
  • Building End2End Solutions

75
Using BlipNet with MIDP
  • Java API for Bluetooth (JSR-82)
  • Supported by most new phones with Java and
    Bluetooth
  • Enables stream-based communication over Bluetooth
  • Supported Profiles
  • OBEX
  • SPP

SPP/OBEX Application
JSR-82 enabled device
BlipNet
76
Questions?
About PowerShow.com