Systems and methods are provided for utilizing scripts with instructions for Bluetooth LE clients interfacing with Bluetooth LE servers.
Increasing numbers of smart devices are being deployed to provide measurement data to other devices or systems that utilize this data. The interworking of such devices in this manner is sometimes referred to as the “Internet of Things (IoT)”. Such devices are often independently designed and developed by many different parties. There is a continuous desire for methods that ease the deployment and integration of these devices into a variety of systems and services to take advantage of their many capabilities.
One example method is provided for a Bluetooth LE client to use a script to control how it interfaces with a Bluetooth LE Server. The client reads a script comprised of instructions for interfacing with devices of a particular class. In response to detecting a server advertisement the client utilizes the server advertisement to make a determination as to whether the script should be executed. If said determination is made then the client executes the script.
Another example method is provided for a Bluetooth LE client to create a script comprised of instructions for interfacing with a Bluetooth LE server. The client reads the profile of a Bluetooth LE server. The profile is comprised of one or more services and the said services are comprised of one or more characteristics. The client reads the permissions available for each characteristic and generates an action step in the script based upon the permissions.
Yet another example method is provided for a service to validate and distribute a script comprised of instructions for a Bluetooth LE client to interface with a Bluetooth LE server. The service receives the script and checks it for alterable conditions. In response to detecting such conditions alerts are generated. The service also checks the script to determine if it is ready to be distributed to a Bluetooth LE client. If the script is ready, the service distributes the script to one or more Bluetooth LE clients.
This disclosure relates to the use of a script to provide instructions to a Bluetooth Low Energy client device for connecting to and collecting data from a Bluetooth LE server device. Prior to describing the script and other components of the invention disclosed herein, it will be helpful to provide background information about Bluetooth LE.
Bluetooth LE is a client-server protocol, with one of the client or server devices acting as a master and the other in a slave role. Master (or “central”) devices scan for other devices. Typically the master device is a smartphone, tablet, personal computer or a specialized device, such as a controller. Slave (or “peripheral”) devices advertise and wait for connections. Usually the slave is a small device such as, for example, a fitness tracker or smart-watch, or it might be a personal health device such as a blood-pressure monitor or a weight-scale. A device can switch between being a master or slave, but it cannot be both at the same time. Client devices access remote resources over a Bluetooth LE link using a protocol called the Attribute (ATT) protocol. There is a higher level protocol called the General Attribute (GATT) protocol, built on top of the core ATT protocol, which Bluetooth LE devices use to communicate with one another. Server devices are comprised of a local database and access control methods as defined by the GATT protocol, and provide resources to remote clients. A device can concurrently be both a server and a client.
ATT defines the core data structure used in Bluetooth LE and the operations used to access this data structure. Bluetooth LE data is comprised of attributes, which are always located on the server and accessed by the client. Clients may also sometimes modify attributes. Each attribute is comprised of four fields: 1) Handle—a serial index of two octets; 2) Type—a 128 bit UUID describing the kind of data present in the Value field of the attribute; 3) Permissions—meta data describing what ATT operations can be performed on the attribute; and 4) Value—the actual data content of the attribute. There are four operations that can be performed on an attribute to move data between the client and server: read and write operations are requested by the client and the server responds (or acknowledges); notify and indicate operations are enabled by the client, but initiated by the server, providing a way to push data to the client.
GATT is built on top of ATT and provides a way to specify a hierarchical structure of higher level objects understood by the client and server. Each object is specified as a grouping of attributes. Every Bluetooth LE device is comprised of three different types of objects: 1) Profile—each Bluetooth LE device has one or more Profiles defined, where each Profile describes a collection of features. The Bluetooth Special Interest Group (SIG) describes a set of standard profiles—for example, Heart Rate, Blood Pressure, Health Thermometer and many others; 2) Service—each profile is comprised of one or more services, the service describing one feature among those included in the Profile—for example, for lighting equipment measurement of electricity usage, detection of lucidity, and control of lucidity are implemented as three independent services; and 3) characteristic—each service is comprised of one or more characteristics, where the characteristic is the actual container for data—for example, the systolic and diastolic values for a blood pressure measurement service are held inside a characteristic.
We now turn to
We turn now to monitoring service 230 of
Portal 231 also includes human interface manager 234, which provides interfaces for the configuration and management of the system and its components, as well as interfaces for the presentation of monitoring data and reports. For example, human interface manager 234 may provide interfaces to provide configuration information, such as parameters for connecting devices to monitoring service 230. Interfaces may also be provided to configure and manage interfaces between BLE slave devices 201 and BLE master devices 202.
BLE master device 202 includes a number of modules such as portal manager 205 and device manager 206 that are stored in memory 204 and executed by a processing unit 203 that is coupled to the memory for accessing data and executed instructions stored therein. The memory 204 can include an arrangement of system memory and additional memory devices, such as a hard disc drive, removable storage media, read-only memory (ROM) and random access memory (RAM).
Portal manager 205 connects BLE master device 202 to portal 231. It is responsive to commands received from portal 231 and relays data to portal 231. Additionally, portal manager 205 sends alerts to portal 231 for certain conditions of BLE master device 202.
Device manager 206 interfaces with any number of local devices, such as BLE slave devices 201a to 201n. The device manager receives, for example, data from the devices and, after doing any local processing, provides it to portal manager 205 for delivery to portal 231.
BLE slave devices 201, BLE master devices 202 and the monitoring service 230 typically include familiar software and hardware components, only some of which have been illustrated. For example, they may include operating systems, processors, local memory for storage, I/O devices, and system buses interconnecting the hardware components. RAM and disk drives are examples of local memory for storage of data and computer programs. Other types of local memory include magnetic storage media, optical storage media, flash memory, networked storage devices, and the like. Monitoring service 230, including portal 231, may be comprised of multiple servers and databases.
It's desirable to have a mechanism by which interactions between BLE devices can be programmed and customized without requiring software updates. A device script is now described which can be supported by systems such as system 200 described above. The script is structured in JSON format, with each section being an array of actions: 1) an optional preamble section; 2) a required main section; and 3) one or more optional custom sections. The high level structure of the script is illustrated in Table 1, which shows all three sections, although only the main section is required:
The preamble of the script contains commands that are only run once, when a client first connects to a device. Examples of commands that might be placed in the preamble section include setting the current time on the device or reading static information such as a model number, firmware version and the like. The main section of the script runs repeatedly and contains commands used to get measurement data from a device. Optional custom sections are named so that they can be referenced from commands in the preamble or main sections.
Each section of the script is an array of actions, with each entry in the array a set of name-value pairs representing the characteristic of interest, the operation needed on the characteristic, the value (for commands such as write) and other meta data pertaining to the command. Table 2 illustrates an array of actions. In this example each entry in the array has a command name-value pair that identifies an operation to be performed, a uuid name-value pair identifying the characteristic that the operation is to be performed against, and also an id name-value pair that may be used for purposes such as referencing an entry from other parts of the script, identifying an entry when reporting errors and for other purposes. The second entry in the array of actions includes a value for use when executing the write command.
Table 3 lists example commands that may be used in a script and also includes notes about the commands. The commands included in Table 3 are not meant to be an exhaustive list. They are examples of commands that might be processed by a BLE client device to interface with a BLE server device.
Table 4 describes parameters used with the above commands. Note that a handle or uuid parameter is required to identify the characteristic that the command is for. For some commands an array form may be used by specifying handle-array or uuid-array. This identifies a set so that the command can be applied to multiple characteristics.
We turn now to
Having determined that a script should be executed we turn to flowchart 400 of
At 405 the client checks whether this is the first time that it has connected to the device. If so it continues to 410 and executes the preamble portion of the script, after which it continues at 420. In the example script of Table 5 the discovery command of the preamble section would be executed. 420 is also reached immediately when this is not the first time the client has connected to the device. In either case, once at 420 the client executes the main portion of the script. In the example script of Table 5 the five steps in the main portion of the script would be executed.
We turn now to
At 550, the action script is generated by reading the permissions from the GATT structure available to the client for the characteristic. The permissions may allow the client to read the value of the characteristic, write a value to the characteristic, or to both read and write. In some cases the client may not have permission to perform any operations for the characteristic and no action will be generated. When the client has read permissions a command may be added to the script to read the value or a register-notify may be generated so that when the script is executed on the client it registers to receive asynchronous notices of updated data. The client may be configured to generate particular command(s) based upon, for example, the type of device, location, administrative preferences regarding commands to be generated, or other factors. When the client has write permissions command(s) may be added to the action script to write a value to the characteristic. In some cases the client may be configured so that the value to be written can be included in the generated script. In other cases, the command added to the action script may be incomplete and an administrator will later edit the script to provide the additional details—in short order, flowchart 600 of
Continuing at 560, the client checks to see if there are additional characteristics making up the service. If so the method continues back at 530 to read the next characteristic and continue processing. If not the method advances to 570 where it checks for additional services. If there are additional services the method returns to 510 to read the next service from the GATT structure. If there are no additional services the method ends.
We now turn to flowchart 600 of
Continuing at 620, the method checks the received script for conditions that the administrative user should be alerted to. Examples of such conditions include syntax errors in the script and additional information that may be needed to execute the script. At 630 any necessary alerts are generated. For example, a preliminary script may have been generated by method 500 of
It should be appreciated that the steps illustrated in
It should be appreciated that some embodiments may be implemented by hardware, software, firmware, middleware, microcode, hardware description languages, or any combination thereof. When implemented in software, firmware, middleware, or microcode, the program code or code segments to perform the necessary tasks may be stored in a computer-readable medium such as a storage medium. Processors may be adapted to perform the necessary tasks. The term “computer-readable medium” includes, but is not limited to, portable or fixed storage devices, optical storage devices, wireless channels, sim cards, other smart cards, and various other non-transitory mediums capable of storing, containing, or carrying instructions or data.
What have been described above are examples. It is, of course, not possible to describe every conceivable combination of components or methodologies, but one of ordinary skill in the art will recognize that many further combinations and permutations are possible. Accordingly, the disclosure is intended to embrace all such alterations, modifications, and variations that fall within the scope of this application, including the appended claims. As used herein, the term “includes” means includes but not limited to, the term “including” means including but not limited to. The term “based upon” means based at least in part upon. Additionally, where the disclosure or claims recite “a,” “an,” “a first,” or “another” element, or the equivalent thereof, it should be interpreted to include one or more than one such element, neither requiring nor excluding two or more such elements.
This application claims the benefit of U.S. Patent Application No. 62/433,880, filed Dec. 14, 2016, and entitled SYSTEM AND METHODS FOR UTILIZING A SCRIOPT TO INSTRUCT A BLUETOOTH LOW ENERGY CLIENT IN INTERFACING WITH A BLUETOOTH LOW ENERGY SERVER, which is incorporated herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
62433880 | Dec 2016 | US |