Clone wiki

Mobile Bluetooth Adapters / Home

Class Design

Class Diagram

class diagram

Sequence Diagram

listen sequence diagram

Documentation

This is a high level documentation intended to define the purpose of each class.

medicalDevicePlugin.js

medicalDevicePlugin is the Javascript portion of the API, for our intents and purposes it is not the initialization part of the process that happens through Apache Cordova. Instead medicalDevicePlugin is the entry point at which the mobile solution interacts with Bluetooth devices.

BluetoothPlugin

BluetoothPlugin is the natively coded bluetooth adapter that is part of Cordova's plugin architecture. Every javascript action on the medicalDevicePlugin defines the BluetoothPlugin implements. The BluetoothPlugin does this by encapsulating each action into a command, it then allows those commands to be run by the Invoker.

BluetoothServer

BluetoothServer represents the containment of Bluetooth activities, the BluetoothServer should be the only object that directly interacts with the native Bluetooth implementation.

PacketParser

A PacketParser is used to parse information received from Bluetooth devices, it is implemented as a template to account of a variance in parsing process among its implementations.

Implementations

ANDPacketParser is the only current implementation, it exists to accurately parse data from proprietary AND devices.

Invoker

The Invoker is a tool used to manage a work queue of commands. It is the interface in which this driver interacts with delegating its commands to background threads.

WorkQueue

WorkQueue is an implementation of a thread pool manager. This will be replaced with platform specific managers.

Command

Commands are encapsulations of actions, typically these actions will interact with the BluetoothServer and reply to the medicalDevicePlugin with feedback.

Implementations

  1. stopCommand - Action for safely shutting down all driver activity

  2. isSupportedCommand - Action for checking and responding to whether or not Bluetooth is supported

  3. isEnabledCommand - Action for checking and responding to whether or not Bluetooth is enabled

  4. enabledCommand - Action for enabled the Bluetooth interface

  5. disableCommand - Action for turning off the Bluetooth interface

  6. discoverableCommand - Action for starting the Bluetooth discovery process

  7. listenCommand - Action for starting to listen for incoming connections on the Bluetooth interface

  8. stopListenCommand - Action for safely stopping all current listening actions

  9. bondedDevicesCommand - Action for checking and responding with the current Bluetooth bonded devices

Updated