#summary BlueCove supported stacks.

= BlueCove supported stacks =

   On Windows WIDCOMM and BlueSoleil stacks are added in BlueCove version 2.0.0.

   Support for Mac OS X added in BlueCove version 2.0.2.

   To determine which Bluetooth stack is installed on your Windows XP [http://bluecove.sourceforge.net/bluecove-examples/bluetooth-stack.html see this page]

   [http://code.google.com/p/bluecove/wiki/WindowsMobile Windows Mobile]

   If automatic Bluetooth Stack detection is not enough Java System property "bluecove.stack" can be used to force desired Stack Initialization.
   Values "widcomm", "bluesoleil" or "winsock". By default winsock is selected if available.

   Another property "bluecove.stack.first" is used optimize stack detection.
   If -Dbluecove.stack.first=widcomm then widcomm (bluecove.dll) stack is loaded first and if not available then !BlueCove will switch to winsock.
   By default intelbth.dll is loaded first.

   If multiple stacks are detected they are selected in following order: "winsock", "widcomm", "bluesoleil".
   Since !BlueCove v2.0.1 "bluecove.stack.first" will alter the order of stack selection.

   If System property is not an option (e.g. when running in Webstart) create text file "bluecove.stack" or "bluecove.stack.first" containing stack name and add this file to BlueCove or Application jar. (Since v2.0.1)

   Use `LocalDevice.getProperty("bluecove.stack")` to find out what stack is used.

== WIDCOMM (Broadcom) ==

    This stack is most stable stack from one supported by !BlueCove
    Supported RFCOMM and L2CAP (since !BlueCove v2.0.1)

=== Requirements ===

    * BTW Stack software version 1.4.2.10 SP5 or above on Windows32
    * For AMD64 systems you need to build dll yourself
    * Broadcom wbtapi.dll required. It is installed with WIDCOMM drivers.

=== JSR-82 Limitations ===

    * `LocalDevice.setDiscoverable(...)` not supported.
    * `ServiceRecord.setDeviceServiceClasses(..)` not supported.
    * `ServiceRecord` attributes of `DataElement` types URL are discovered as STRING
    * The discovery database is cumulative. It contains the results of all previous discoveries of the application or any other applications that are running or that have run.
      So ServiceSearch *may* return service even when it is down.
    * L2CAP unable to send and receive empty L2CAP packet

    * `ServiceRecord` attributes of `DataElement` types U_INT_8, INT_8, INT_16 and UINT_16 are not properly discovered (fixed in BTW-6_1_0_1501-SDK, you should make your binaries)

== Winsock (Microsoft) ==

=== Requirements ===

    * Microsoft Bluetooth stack (currently this means Windows XP SP2 or newer and Windows Mobile 2003 or newer)
    * A Bluetooth [http://support.microsoft.com/default.aspx?kbid=841803 device supported] by the Microsoft Bluetooth stack.
    * [http://bluecove.wiki.sourceforge.net/ms-usb-dongles List of Bluetooth USB dongles working with Microsoft Bluetooth stack]
    * [http://code.google.com/p/bluecove/wiki/WindowsMobile Windows Mobile Devices]

=== Limitations ===

    * Microsoft Bluetooth stack only support RFCOMM connections
    * L2CAP not supported
    * `DiscoveryListener.deviceDiscovered()` would be called for devices that a _paired_ with your Microsoft BT stack regardless if device ON or OFF
    * `LocalDevice.setDiscoverable(NOT_DISCOVERABLE)` will not change the state if discoverable is enabled system wide in "Bluetooth Devices" "Options"
    * setDeviceServiceClasses not supported on Windows Mobile

== BlueSoleil (IVT Corporation) ==

=== Requirements ===

    * BlueSoleil version 1.6.0, 2.3 or 3.2.2.8. BlueSoleil version 5.0.5 not supported.

=== JSR-82 Limitations ===

    SDK provided by IVT is very limited. We just implemented what we can on top of it.

    * BlueSoleil Bluetooth stack only supporting RFCOMM connections
    * L2CAP not supported
    * Service attributes are not supported in Service search of when creating Server, `LocalDevice.getProperty("bluetooth.sd.attr.retrievable.max") == "0"`
    * `DiscoveryAgent.searchServices()` can only find 128bits-GUID service with specific UUID. You can't list all service on remote device.
    * `DiscoveryAgent.searchServices(.. UUID[] uuidSet, ..)`  only ONE UUID is used during search, the last one in array.
    * You need to run `DiscoveryAgent.searchServices()` with UUID of your service before you can make connection to it using `Connector.open(url);`
    * Client `Connector.open()` use GUID of the discovered service. Only one would be selected
    * Server can't close incoming connection. It will wait until connection is closed remotely. (Our implementation should be changed to restart Service(Server) each time connection is closed to fix this)
    * `searchServices` can't distinguish the service type (RFCOMM or OBEX). To solve this following UUIDs are always discoved as obex (btgoep://) connections
        * IR_MC_SYNC (0x1104), OBEX_OBJECT_PUSH (0x1105), OBEX_FILE_TRANSFER (0x1106), IR_MC_SYNC_COMMAND (0x1107), IMG_RESPONDER (0x111B)
    * setDeviceServiceClasses not supported


*N.B.* In our test lab when using fake ES-388 Bluetooth USB Adapter we can only make from 180 to 250 max connections in sequence. After this !BlueSoleil.exe needs to restart or Windows needs to be rebooted.
This does not happen when we used dongle bought from [http://bluesoleil.com bluesoleil.com]


== OS X ==

=== Requirements ===

    *  PowerPC- or Intel-based Mac OS X 10.4 (Bluetooth v1.2) or late

=== JSR-82 Limitations ===

    * `LocalDevice.setDiscoverable(...)` not supported.
    * Dynamic assignment of PSM for L2CAP service does not work. PSM 1001 is assigned all the time. Use btl2cap://localhost:uuid;name=test;bluecovepsm=1003
    * `ServiceRecord` attributes of `DataElement` types U_INT_8, INT_8 are not properly publshed by service on OS X 10.4
    * `ServiceRecord` attributes of `DataElement` type BOOL published as U_INT_1
    * `ServiceRecord` attributes of `DataElement` type URL published as STRING