Introduction
The C Object Stack (COS) is a C-language implementation of the OpenDOF
Distributed Object Stack (DOS), a lightweight communication stack
compatible with OpenDOF.
The COS enables embedded software developers to create very small
applications within OpenDOF. The COS implements compliant,
but partially limited, OpenDOF protocols, specifically for use in
environments with very limited resources. A COS-based application is
intended to interact seamlessly with other OpenDOF network nodes.
Please refer to the OpenDOF Overview document for a more comprehensive
description of OpenDOF and its powerful capabilities.
The COS allows for discovery of and communication with other nodes
within the OpenDOF network. A single node can choose to Provide
information to the network and other nodes, Request information of the
network or other nodes, or a combination of both. However, COS does
not support OpenDOF proxy (routing) capabilities. This means that COS
nodes are always "terminal" nodes in the network, and that COS
applications cannot be used as bridges or gateways.
The COS is implemented as a set of portable C source files, and
intended to be compiled and linked directly with a standard C
application on a target platform. The COS does not itself require an
OS or any specific platform libraries, although a limited C library is
assumed (for memcpy and memcmp). The application is responsible for
handling the transport (sending and receiving packets). The COS
assumes a single threaded application, so if the application uses
multiple threads it must adequately protect the COS from re-entrance.
By default, all features of the COS are enabled, which may require a
larger code size than necessary for some projects. An application need
only include the portions of the COS that are appropriate to maintain a
minimal embedded application code size. To reduce the code size for
particular projects, one or more of the following preprocessor
definitions can be defined when compiling the application:
- DOSCONFIG_DISABLE_REQUESTOR: Configure for Provider-only project (disable all Requestor functionality).
- DOSCONFIG_DISABLE_PROVIDER: Configure for Requestor-only project (disable all Provider functionality).
- DOSCONFIG_BUFFER_SIZE_BYTES: Configure the number of bytes used to store buffer size and offset variables. Valid values are 1, 2, and 4. The default is 4.
- DOSCONFIG_DISABLE_DPS_SESSIONS: Configure to disable support for DPS sessions. This implies DOSCONFIG_DISABLE_SECURITY.
- DOSCONFIG_DISABLE_OAP_SESSIONS: Configure to disable support for OAP sessions.
- DOSCONFIG_DISABLE_SECURITY: Configure to disable secure transport sessions. Support for DPS sessions must be enabled for security.
- DOSCONFIG_DISABLE_STANDARDSTRING: Configure to disable support for converting an Object ID in standard string format to a DOSObjectID.
- DOSCONFIG_TRANSPORT_ADDRESS_SIZE: Configure the Transport address byte size to use. This is the byte length of the transport address that is stored in a DOSAddress. This must be set.
- DOSCONFIG_LITTLE_ENDIAN: Configure for a little endian architecture. Either DOSCONFIG_LITTLE_ENDIAN or DOSCONFIG_BIG_ENDIAN must be set.
- DOSCONFIG_BIG_ENDIAN: Configure for a big endian architecture. Either DOSCONFIG_LITTLE_ENDIAN or DOSCONFIG_BIG_ENDIAN must be set.
Using This Reference
This reference defines the APIs for use by a COS-based application.