Skip to content

OLS Device Profiles

jawi edited this page Mar 14, 2011 · 3 revisions

In the 0.9.4 release of the OLS client, the concept of "device profiles" is introduced. A device profile describes the exact functionality that is supported by a SUMP-compatible client. For example, how many samples it can store, whether triggers are supported, if it needs a delay after opening, and so on.

Table of Contents

Format

Device profiles are simple text-based configuration files, which are read by the OLS client at runtime. This makes it easy to make changes to existing device profiles, or to create additional device profiles without any knowledge about Java or any other programming language.

The syntax of a device profile file consist of simple key-value pairs and comments.

Key-value pairs are placed on one, continuous line. The key and value are separated by a = character, optionally surrounded by white space (tabs/spaces). Values are free-format and can contain any character except for newline/carriage return characters (\r, \n). Keys can consist of the following characters: 0-9a-zA-Z_-.\. To enhance the readability of key-value pairs, they can be spread out across multiple lines by escaping the newline/carriage return characters with a backslash (\), like:

  my-key = \
    value1, \
    value2, \
    value3

The above key-value pair will be exactly equivalent to:

  my-key = value1, value2, value3

Lines starting with a hashpound (#) are regarded as comments, and will be ignored. It is not possible to mix comments and key-value pairs.

File encoding

It should be possible to read the contents of device profiles on different platforms with different (default) file encodings. Hence, it is strongly advices to use only ASCII characters for comments and key-value pairs. However, if needed, one can provide Unicode escapes for any non-standard ASCII character, like:

  my-key = my 0.02\u00A2...

which will assign the value "my 0.02¢..." ('¢' is the cent sign) to "my-key".

Device profile naming

The names of device profiles must adhere to the following naming convention/pattern: ols.profile-{NAME}.cfg. Where {NAME} can be any desired name. The OLS client will look for all files matching this naming pattern and consider them as device profile. Keep the {NAME} short and brief, for example, to a maximum of 10 characters. By convention, the {NAME} is equal to the device.type key in the device profile itself.

Deployment

Device profiles are placed in ${OLS_HOME}/plugins. This directory is continuously watched at runtime and any changes to files are processed after a short delay (1 or 2 seconds). This makes it possible to add/remove/update device profiles at runtime without the need of restarting the OLS client.

As a safety measure, device profiles that do not comply to the naming convention or are incomplete/broken are not deployed.

Current issues

Sometimes, device profiles seem to get duplicated. Why this happens is not entirely clear, but it looks like to occur after an upgrade. Investigation on the exact details still remains. See also issue #48 on GitHub.