Table of Contents
ULLA (Unified Link Layer API) - access link layer information
#include
<ulla/lu.h>
typedef struct ullaCoreDescr
{
ullaString_t manufacturerName __attribute__ ((packed));
ullaStringLen_t manufacturerNameLen __attribute__ ((packed));
ullaString_t luIfVersion __attribute__ ((packed));
ullaStringLen_t luIfVersionLen __attribute__ ((packed));
ullaProfile_t profile __attribute__ ((packed));
ullaString_t uqlVersion __attribute__ ((packed));
ullaStringLen_t uqlVersionLen __attribute__ ((packed));
ullaString_t license __attribute__ ((packed));
ullaStringLen_t licenseLen __attribute__ ((packed));
} __attribute__ ((packed)) ullaCoreDescr_t;
ullaResultCode_t ullaGetCoreDescriptor(ullaCoreDescr_t *coreDescriptor);
When using the ULLA API, a version dependency might occur.
The ULLA Link User Interface (luIf) is designed to be future proof. However,
future versions of the API might require an API change that breaks legacy
LU implementations.
In order to provide a version check a function was
introduced to check for the various versioning information. The ullaCoreDescr_t
might expand in the future. However, additional versioning information is
only appended in the end of the structure.
The respective entries in the
ullaCoreDescriptor are explained below:
- manufacturerName
- and manufacturerNameLen
give the name of the organization supplying the ULLA Core.
- luIfVersion
- and luIfVersionLen contain the version of the luIf as composed of two integers
in the format "major.minor" version. If the major number is different than
the expected one the application might break during runtime accessing
the symbols of the library.
If the major number is the same but the minor number is higher than the
expected one, additional methods are available in the ULLA library.
If the major number is the same and the minor number is smaller than the
expected one, required methods are missing in the ULLA library and the
application might break during runtime if using symbols that have been
added to the ULLA API since then.
- profile
- the profile is used to describe
the available feature set of the ULLA API. ULLA is designed to fit with
very resource limited devices, such as PDAs and smart phones as well as
Laptop computers. Hence, not all functionality might be available on small
devices due to limitations in memory and computational power.
- uqlVersion
- and uqlVersionLen The ULLA Query Language (UQL) version might change independently
from the ULLA API version. One can interpret this version as a sub-versioning
information to the luIfVersion.
If the major number is different than the expected one, the uql_statements
used within the queries are not valid and the method calls will fail. However,
the application will not break if error codes are handled correctly.
If the major number is the same but the minor number is higher than the
expected one, additional uql_statements are available in the ULLA library.
If the major number is the same and the minor number is smaller than the
expected one, required UQL statements are missing in the UQL language
and some UQL queries might fail.
- license
- and licenseLen The license of
the ULLA Core is exposed because some applications might be concerned about
viral licenses, such as GNU Public License (GPL), contaminating their
code. It might be preferable for sensitive applications not to use ULLA
if no non-viral license is available.
The following parameters
have to be carefully considered:
- coreDescriptor
- the pre-allocated coreDescriptor
is filled and retured to the LU.
- ULLA_OK
- everything is fine.
- ULLA_ERROR_FAULT
- general error occured.
Some examples for version
checking in GPL code below:
- How-to verify the ULLA Core version is ok for
me?
#define _GNU_SOURCE
#include <string.h>
#include <ulla/lu.h>
/* version the LU is compliant with */
#define MY_VERSION "1.0"
ullaCoreDescr_t coreDescr;
ullaResultCode_t res;
if( (res = ullaGetCoreDescriptor(&coreDescr)) < 0) {
/* failed to get ULLA Core descriptor */
/* cannot verify ULLA Core version */
}
if((res = strverscmp(coreDescr.luIfVersion, MY_VERSION)) == 0) {
/* what we expect */
}
else if (res < 0) {
/* MY_VERSION is newer: do NOT use ULLA */
/* maybe check major number is equal and verify only additional symbols
are used */
}
else {
/* MY_VERSION is older: do use ULLA */
}
ullaReflection(1)
, ullaAttribute(1)
, ullaCommand(1)
, ullaSample(1)
, ullaNotification(1)
, ullaTools(1)
ulla(2)
, uql(2)
, ullaResult(2)
, ullaTuple(2)
,
ullaRequestReflection(2)
, ullaRequestAttribute(2)
, ullaRequestCommand(2)
,
ullaRequestNotification(2)
, ullaRequestSample(2)
, ullaRequestLock(2)
,
ullaGetCoreDescriptor(2)
RWTH contribution to the GOLLUM
project (http://www.ist-gollum.org). Compliant with ULLA C-API Version 1.0 (http://ulla.sourceforge.net).
This man page was written by Marten Bandholz (mba@mobnets.rwth-aachen.de).
Table of Contents