The History Of Sensor Connector Api

Print   

02 Nov 2017

Disclaimer:
This essay has been written and submitted by students and is not an example of our work. Please click this link to view samples of our professional work witten by our professional essay writers. Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of EssayCompany.

The SensorART Bluetooth HDP implementation attempts to define a communication method within the context of the ISO/IEEE 11073 family of standards for device communication the 11073-20601that is part of the ISO/IEEE 11073 family of standards for device communication. The API defines & implements a common framework for making an abstract model of personal health data available in a transport-independent transfer syntax. The API provides presentation capabilities and services needed to perform communication tasks between HDP devices and Android devices.

Communication is achieved through using Abstract Syntax Notation One (ASN.1) ASN.1 notation which is a standard and flexible notation that describes rules and structures for representing, encoding, transmitting, and decoding data in telecommunications and computer networking. The formal rules enable representation of objects that are independent of machine-specific encoding techniques. Formal notation makes it possible to automate the task of validating whether a specific instance of data representation abides by the specifications.

ASN.1 is a joint standard of the International Organization for Standardization (ISO), International Electrotechnical Commission (IEC), and International Telecommunication Union Telecommunication Standardization Sector ITU-T, originally defined in 1984 as part of CCITT X.409:1984. ASN.1 moved to its own standard, X.208, in 1988 due to wide applicability. The substantially revised 1995 version is covered by the X.680 series. The latest available version is dated 2008, and is backward compatible with the 1995 version.

ASN.1 together with specific ASN.1 encoding rules facilitates the exchange of structured data, especially between application programs over networks by describing data structures in a way that is independent of machine architecture and implementation language.

The developer does not need to know the IEEE 11073-20601 standard (from now on

referred as "IEEE 11073") to use productively.

On the other hand, it is highly desirable to have at least a basic understanding of the

11073 standard, in order to visualize how SensorArt Manager works and see the reasoning behind SensorArt Manager’s architectural and design decisions.

This section is not an exhaustive guide about 11073; the authoritative sources are the

standard documents, and Continua Alliance makes excellent tutorials available.

4.1.1 Agents and Managers

There are two device types: agents and managers. Agents are data producers, typically

sensor devices. Managers are the data collectors. Connection may happen in either direction, but the agent normally takes the initiative because it "knows" when new data is available e.g. when a patient takes a blood pressure measurement. IEEE 11073 is based upon the idea that agents, being sensor devices, are low powered and have few (if any) processing resources, while the manager is typically a powerful device connected on mains power or with long battery life (i.e. a smartphone). So, most of the burden of 11073 logical implementation is put on managers.

SensorArt Manager has complete support for Manager applications and basic support for Agent applications. This is due to the fact that SensorArt Manager most common use case is the Manager role.

4.1.2 Communication model

IEEE 11073 is transport-agnostic, meaning that it can be carried by almost any packet based technology, such as TCP/IP, Bluetooth,etc. There are some formal requirements on the transport layer, but they are fulfilled by most transport technology (i.e. Bluetooth, TCP/IP, USB) in current use.

IEEE 11073 fills the top three layers of OSI model for networking: presentation,

session and application. Presentation is provided by MDER (see next item). Session is

provided by communication model. Application is where useful data finally flows from

agent to manager.

http://upload.wikimedia.org/wikipedia/commons/2/2b/Osi-model.png

(wikipedia image, possibly not safe, though free with creative commons)

The IEEE 11073 session layer supports session persistence even upon disconnection

at transport level. Transport may disconnect due to a temporary failure or to save power

on inactivity. At IEEE 11073 level, an agent and a manager with a session established

among them are said to be associated.

Since session persistence is optional, in practice many devices choose to terminate

the session as soon as transport disconnects, a behavior that is much simpler to

implement.

4.1.3 ASN.1 and MDER

The IEEE 11073 protocol specification is written using the ASN.1 language. Actual encoding of an ASN.1 message to a stream of bytes is dictated by a set of rules, like BER, XER or MDER.

In case of health devices, MDER is the most usual choice, that every health

agent and manager is expected to implement as MDER is heavily optimized in order to accommodate low-end (low processing) devices. This is because MDER implementations allow for easy to storage of message templates pre-encoded on firmware, on which the device just replaces the variable octets and transmits it when necessary.

MDER supports a specific subset of ASN.1 primitive variable types, which are combined to form a well-defined set of Personal Health Device (PHD) types. Every 11073 message is thus composed of a set of PHD type elements, which in turn are based on the ASN.1primitive types.

2.4 APDUs

APDUs (Application Protocol Data Units) are the "packets" of IEEE 11073 communication. They can be as big as 65535 octets, even though they are typically much smaller, and maximum size (MTU) is further restricted by device specializations.

APDUs are analogous to network packets but an APDU can be much bigger (e.g.

Ethernet has MTU of just 1500 octets). The transport layer must support someway to

fragment and reassemble APDUs. Bluetooth’s L2CAP can do that. TCP does not preserve message boundaries, but reassembly is possible by interpreting APDU length (third and fourth octets in header) and waiting for that amount of data before sending it to IEEE 11073 stack.

Note that Android 4 makes APDU handling automatic since HDP is mostly integrated in the OS.

2.5 Boxes inside boxes inside boxes

IEEE 11073 defines numerous PHD types. Each type is quite simple by itself, but it may

contain a list of children elements, which in turn contain their own children, and so on.

From APDU level to the actual "interesting" data, there may be half dozen encapsulations, and an 80-byte APDU is employed to send a mere 8-byte measurement. APDU decoding is heavily based on length/type value pair followed by a sequence of octets, more or less like the classic Type / Length / Value (TLV) series.

Unknown choices may simply be ignore, because the length is known even if the series is not transparent to the receiver. Note that the SensorArt Manager by default attempts to decode even unknown types treating them as Numeric information (the most common type). This allows for greater flexibility and future proofing as new devices may be added since the important numeric data can be transferred even if it is unknown (and the Agent/Manager can decode the information ad-hoc).

Another frequent pattern is the attribute list. Each attribute is a pair of object

identifier code (OID) and an octet string, whose format is defined by the OID. There are

hundreds of possible OIDs defined but fortunately each particular usage of

AttributeList restricts the set of permissible OIDs to a handful.

Attributes with unexpected OIDs for the situation may simply be ignored, allowing graceful degradation. SensorArt Manager however can still try to decode possibly unknown attributes (again based on the most common Numeric type). This allows for greater flexibility and future proofing as new devices may be added since the important numeric data can be transferred even if it is unknown (and the Agent/Manager can decode the information ad-hoc).

This characteristic of 11073 is also due to the fact that it borrows heavily from other standards (some of them quite old). In SensorArt Manager, the developer only needs to have contact with these details if he is going to write new specializations or transcoding plug-ins. Otherwise, it should be sufficient to use the provided client example.

2.6 State machine

SensorArt Manager's session layer is implemented by a Finite State Machine (FSM). The basic states for the manager are:

Note that the Manager FSM states can be as defined below -

DISCONNECTED

CONNECTED_UNASSOCIATED

CONNECTED_ASSOCIATING

CONNECTED_ASSOCIATED_CONFIGURING_SENDING_CONFIG

CONNECTED_ASSOCIATED_CONFIGURING_WAITING_APPROVAL

CONNECTED_ASSOCIATED_CONFIGURING_WAITING

CONNECTED_ASSOCIATED_CONFIGURING_CHECKING_CONFIG

CONNECTED_ASSOCIATED_OPERATING

CONNECTED_DISASSOCIATING

Which are similar to the IEEE 11073 defined session layer -

• Disconnected

• Connected

o Associating

o Associated

§ Waiting for configuration

§ Checking configuration

§ Operating

o Disassociating

o Unassociated

As the indentation suggests, some states imply others. A device must be associated

in order to be operational. The hierarchy is more didactical than true because, as

mentioned before, associations may persist even upon transport disconnection.

This association and hierarchy is better displayed in the SensorArt Manager options.

The FSM may change by the following events -

A/A

Event Name

Description

1

Transport Connection

Event received by the Manager when a client attempts to connect.

2

Transport Disconnection

Event received by the Manager when a client/ Agent has disconnected.

3

Timeout

Event created by Manager internally upon a client/agent disconnection

4

Association release request

Event created by Manager when attempting to release a client/agent.

5

Association abort request

Event created by Manager upon abort. This event is also sent towards client/agent upon a timeout to ensure smooth disconnection.

Table 1- Connection level events

A/A

Event Name

Description

1

agentConnected

Agent connected to Manager.

2

agentDisconnected

Agent Disconnected from Manager.

3

agentChangeStatus

Agent has changed status (Connecting, Connected, Disconnecting... ) etc.

4

receivedMeasure

Manager sends this event to Agent upon successfully receiving a measurement.

Table 2 - Connected Events

2.7 APDU types

Considering the top-level APDU types the below list has been implemented -

• AARQ: Association Request

• AARE: Association Response

• RLRQ: Association Release Request

• RLRE: Association Release Response

• ABRT: Association abort

• PRST: Presentation APDU

o ROIV: Remote Invoke

o RORS: Remote Invoke Response

o ROER: Remote Invoke Error

o RORJ: Remote Invoke Reject

Most types are concerned with association maintenance, creation or disconnection.

ROIV is the workhorse that carries device configurations and actual medical data.

In SensorArt Manager, the developer normally does not need to know or care about APDU types and their internal structure unless he wishes to extend device transcodings.

2.8 Service model

ROIV APDUs can carry a few basic commands: Get, Set, Action and Event Reports.

Each command admits confirmed and non-confirmed variants.

Confirmed requests, as the name suggests, expect the target to send a confirmation APDU. If it does not happen in time, the request APDU is resent a number of times, and if a confirmation still does not arrive, the association is aborted. Note that requests are usually configuration requests or command requests (i.e. start / stop measure).

Each request is labeled by an internal unique invoke-id, an integer that is used to correlate requests with responses internally in the manager. The id is also important in possible request retransmissions: the target is expected to handle same-id requests as idempotent (i.e. the same request). For example if two requests with id 1234 (during the same session) ask a blood pressure monitor to start measuring blood pressure blood pressure should only be measured once.

All communication between two associated devices is an exchange of requests, responses, events and confirmations.

2.9 Domain Information Model

The Domain Information Model (DIM) defines an idealized structure of data inside the agent device, which is mirrored at manager level to describe it.

It is in effect an object-oriented structure, with classes that define it - and these classes may be extended leading to a graceful implementation in Java.

Each class has a set of allowed attributes. Depending on class, some attributes will be mandatory, others optional, and others forbidden from use (for instance a Blood Pressure Monitor may not have attributes concerning weight). A real, physical agent device has a number of objects that effectively instantiate such objects with a set, pre-defined, number of attributes.

Each agent may contain only a single (Medical Device System) MDS object. MDS contains attributes like System ID, manufacturer information, specialization etc.

MDS can have a number of "children" objects, which contain the actual medical data. These objects may instantiate the following classes:

• Metric: an abstract class for several classes like Numeric and Enumeration.

Enumeration – represents status information (codes) or annotations (text). For example, these objects can be used to report information about falls, location of people about the home, or smoke alarm conditions. For example, the generic status of a patient when measurement is taken (1="healthy", 2="ill", 3="stressed", 4="menses").

Numeric – represent a single measurement. The standard defines two forms of floating point data suitable for real-world measurements – one contained in 32 bits and the other in 16 bits. A Numeric object may return data in either format, and either as the data value itself (if the context allows the type of measurement to be inferred) or together with units and status information. Arrays are possible, as well as single values. This is by far the most common in currently available agents.

Real-Time Sample Array – represents continuous samples or waveforms. A RTSA object contains information about the interval between samples, the number of samples, the resolution and the scale and offset applied to each data value.

Persistent Metric Store – represents (in a hierarchical fashion) large quantities of data that have been acquired by an Agent. Each PM-Store object contains metadata (data about the data) and zero or more PM-Segments that contain the data.

PM-Segment – each PM-Segment object contains metadata (data about the data) and zero or more entries: each entry containing one or more elements which contain the measurements. There is considerable flexibility with respect to the data that can be stored.

Scanner – scanner objects can observe measurements that are being made in the Agent and generate "events" to report to the Manager. The events can be regular reports, or reports triggered by abnormal readings that merit an alarm. As with the Metric class, the scanner objects are represented by a hierarchy of classes. The Scanner class is never instantiated itself: rather, it is used as the base class for the Configurable Scanner class, which in turn is the base class for two classes which are actually instantiated:

Configurable Scanner – never instantiated itself - base class for:

Episodic Configurable Scanner – these objects are used to send reports of data or events that are not separated by fixed time intervals.

Periodic Configurable Scanner – these objects are used to send reports of data or events that are separated by fixed time intervals.

The UML diagram below shows the relationship between DIM classes.

C:\Users\Silevad\Documents\app-Art\Medical\UML2.png

Each object has a handle, which allows relating APDU messages with the respective

MDS objects. MDS attributes can be retrieved using Getters and sometimes written to using Setters. The MDS "tree" is not transmitted in full over APDUs. The manager discovers the

agent’s MDS in several phases, mainly via configuration and measurement requests & reports.

MDS attributes related to the device type are sent during the association phase. The Manager as needed must request the rest of MDS attributes, as well as children object’s attributes.

2.10 Configuration and Event reports

After an association is successfully create, but prior to operation, the agent sends its Configuration to the manager (in an Event Report APDU). The configuration specifies how many child objects exist in MDS, their types, handles, units etc.

When the value of a MDS object is changed (e.g. the Pulse and Oximetry numeric

objects of an oximeter are updated by sensor data), another Event Report with

measurement data is sent to the Manager (this is when we get some actual medical data/measurements).

The event report packet cannot be interpreted by itself. It is a packed attribute list

that depends on the agent’s setup to be decoded (that’s why the manager must

discover the agent's setup (device type in most cases) before starting the operational data transmission state).

These mechanisms however all for great extensibility. The manager does not need to

have any sort of prior knowledge about a possible agent’s MDS; it learns everything at during the association/configuration phase.

There are two types of configurations: standard and extended.

The standard configurations are set and properly defined by IEEE 11073 specialization documents (see next section for more details). A manager may know some standard configurations in advance, so it does not need to learn it from agent upon association and further specializations may be written in the future.

An extended configuration may have any format, so the Manager must attempt to "learn" it from the device. Once it learns, it may save it locally, skipping this phase in future associations.

The cached configuration is only valid for that particular device. If another device comes

along, even being the same manufacturer and model, the manager has to learn again.

Standard configurations have uniform codes across all devices (e.g. 0x0190 is a

standard configuration for oximeter). Extended configurations have codes above 0x4000,

and they can’t be correlated across devices (meaning that, if device A has config-id 0x5123

and device B has 0x5123 too, the manager can’t assume they share the same

configuration).

2.11 Specializations

Apart from the base IEEE 11073-20601 document, there are additional documents that

define device specializations. Every specialization defines which objects are mandatory in

agent’s MDS, and what they mean.

HDP Device Types

1.

Activity Hub

2.

Blood Pressure Monitor

3.

Glucose Meter

4.

Pulse Oximeter

5.

Thermometer

6.

Cardiovascular Monitor

7.

Peak Flow Monitor

8.

Strength Monitor

9.

Weighing Scale

Table 1 - Device Specialization

For example, 11703-10404 is the oximeter specialization. It defines that an oximeter

must have at least two Numeric objects, one for oximetry (whose unit is %) and one for

pulse (whose unit is bpm). The manufacturer is allowed to add more objects beyond the

required two however these are treated as optional and may even be ignored by the Manager.

This guarantees that, even in face of flexible configurations and variable-format

event reports, an oximeter will always produce the two important pieces of information and the Manager will receive them.

The IEEEE 11073-10404 document also specifies how PM-Store is laid out. PM-Store

is optional in this specialization, but if an oximeter does implement storage, it must follow

the spec.

In SensorArt Manager, two specializations (Blood Pressure Monitor and Weight Scale) are bundled in standard release. It is easy to add more, provided that developer has the specification document in hand.

Note that SensorArt Manager can talk with devices whose specialization is unknown. The only difference is that configuration needs to be learnt upon the first association, and that happens automatically.

Each specialization document specifies one or more standard configurations for each device type. This does not mean that those are advantageous configurations or otherwise.

They are rather bare-minimum expectation configuration. For example, none of the Blood Pressure Monitors standard configurations has a mandatory PM-Store, yet a good BPM device should implement one for on-board historical results and likely multiple user support.

Finally, the specialization documents specify the maximum transmission and reception sizes

for the various supported APDUs, which allow building sensors with less memory, therefore simpler, cheaper and with longer battery life. However, such a discussion is beyond the scope of this document.

2.12 PM-Store

The PM-Store object does not contain stored data by itself. It is a top-level element, like MDS is for all objects. It does contain high-level attributes like operational state and sampling period.

Each PM-Store has a unique handle, like all MDS objects have. The manager mentions this handle to make requests to the store.

Each PM-Store has a variable number of PM-Segment children. They are essentially

packed data arrays. An agent may have more than one PM-Store in its MDS. This is useful when the agent stores data in different fashions (e.g. periodic x aperiodic measurements), or data

from different sensors that don’t work in sync. The Manager "discovers" how many PM-Stores an Agent has, and their handles, via device configuration (the same way the other MDS objects like Numeric are discovered). This implies that the number of PM-Stores in device tends to be stable; otherwise the configuration would have to change.

Each PM-Segment belongs to a PM-Store and has a unique instance number, so the tuple (handle, instance) addresses uniquely a PM-Segment. Each segment has attributes, including its data format (PM-Segment-Entry-Map).

Data itself is sent in "blob" format to the manager. The manager must fetch PMSegment-Entry-Map in advance in order to decode the blob.

SensorArt Manager performs this automatically. The PM-Segment data received by application is already decoded and labeled.

PM-Segments objects have no methods. All access is done through PM-Store. As

stated before, PM-Store handles are discovered via configuration. Methods are:

• Clear-Segments: clears a range (or all) segments belonging to a store.

• Get-Segment-Info: gets information about a segment, including its instance

numbers and data formats.

• Trig-Segment-Data-Xfer: request the transmission of a given segment.

• Segment-Data-Event: "callback" with requested segment’s data blob. If segment

data does not fit in one APDU, several events are sent back until completion.

SensorArt Manager PM-Store API is a simplified version of the PM-Store method set, but follows similar principles. First the user gets a list of segments, and then requests each segment’s data. Note that the data flow is fully asynchronous.

Integration with SensorArt platform

Integration Plan

Conclusions



rev

Our Service Portfolio

jb

Want To Place An Order Quickly?

Then shoot us a message on Whatsapp, WeChat or Gmail. We are available 24/7 to assist you.

whatsapp

Do not panic, you are at the right place

jb

Visit Our essay writting help page to get all the details and guidence on availing our assiatance service.

Get 20% Discount, Now
£19 £14/ Per Page
14 days delivery time

Our writting assistance service is undoubtedly one of the most affordable writting assistance services and we have highly qualified professionls to help you with your work. So what are you waiting for, click below to order now.

Get An Instant Quote

ORDER TODAY!

Our experts are ready to assist you, call us to get a free quote or order now to get succeed in your academics writing.

Get a Free Quote Order Now