Indigresso Wiki

Open Source Stuff for DASH7

User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
opentag:otlib:main [2014/02/27 23:37]
jpnorair OTv2 updates
opentag:otlib:main [2014/09/01 18:14] (current)
jpnorair Updated for v2
Line 1: Line 1:
 ====== OTlib ====== ====== OTlib ======
-OTlib (/otlib) is a main subdirectory in the [[opentag:​main|OpenTag]] source root.  As of OpenTag v2, OTlib contains ​code libraries ​that are used by all parts of OpenTag.  ​It does not contain tasks, apps, or stack implementations:​ just common libraries. ​ For OpenTag releases prior to v2, it OTlib contains files which have since been relocated to [[opentag:|otstack]] and [[opentag:kernel:main|otkernel].+__//For OpenTag v2.//​__ ​ __//​[[opentag:​otlib:​main#​otlib_(v1)|See OTlib v1 reference below]]//__ \\ 
 +OTlib (/otlib) is a main subdirectory in the [[opentag:​main|OpenTag]] source root.  As of **OpenTag v2**, OTlib contains ​only functional models and object-like features ​that are useful to all parts of OpenTag.  ​Prior to v2, OTlib contained all platform-independent code, but now the **Mode 2 Stack** features ​have been moved into **[[opentag:m2:main|/m2]]** and the system tasks like **mpipe** and **veelite** into **[[opentag:otsys|/otsys]]**.
-===== OTlib Files ===== +===== Modules & Files ===== 
-The OTlib files are written entirely in C and are portable to any platform that has a suitable C compiler and build environment. ​ OTlib has no dependencies ​other than [[opentag:platforms:main|Platform ​Module]], ​which is necessary ​for any OpenTag build.  The platform definition files (headersthemselves are part of OTlib, ​so OTlib will be consistent across platforms despite different implementations.+The OTlib files are written entirely in C and are portable to any platform that has a suitable C compiler and build environment ​(the standard is GCC).  ​The implementations (C Code) are stored in **/otlib** and the headers in **/​include/​otlib**. 
 +OTlib code has no platform-specific ​dependencies, although certain modules in OTlib are typically enhanced by optional, platform-specific optimizations. ​ OTlib includes data modules and function modules. ​ OTlib is fully atomic; it does not expose tasks, callbacks, or any sort of non-atomic / non-linear functionality. 
 +^ Module ​         ^ Description ​                           ^ Include ​         ^ C Files  ^ 
 +| ALP             | OT Application Layer Protocol Support ​ | otlib/​alp.h ​     | **alp_main.c**,​ **alp_tmpl.c**,​ alp_api_client.c,​ alp_api_server.c,​ alp_dashforth.c,​ alp_logger.c,​ alp_security.c,​ alp_sensor.c ​ | 
 +| Authentication ​ | OT Authentication & Security Module ​   | otlib/​auth.h ​    | auth.c ​ | 
 +| Buffers ​        | Required buffers for OpenTag ​          | otlib/​buffers.h ​ | buffers.c ​ | 
 +| CRC16           | CRC16 calculation & checking ​          | otlib/​crc16.h ​   | crc16.c ​ | 
 +| Crypto ​         | Base EAX cryptography interface ​       | otlib/​crypto.h ​  | crypto.c ​ | 
 +| Logger ​         | Logger Interface (OpenTag'​s print) ​    | otlib/​logger.h ​  | logger.c ​ | 
 +| Queue           | Data queue "​object"​ for streaming IO   | otlib/​queue.h ​   | queue.c ​  | 
 +| Utils           | Helpful utility functions ​             | otlib/​utils.h ​   | utils.c ​  | 
 +=== ALP Module === 
 +The **[[opentag:otlib:alp|ALP Module]]** provides an interface for managing M2DEF-based Application Layer Protocols defined by DASH7 Mode 2 and also used intrinsically by OpenTag. ​ OpenTag can also use this format as a form of inter-processinter-layer,​ or inter-chip communication. 
 +=== Auth Module ===  
 +Both the DASH7 Mode 2 specification as well as OpenTag'​s core Veelite filesystem define user IDs and user-based access privileges. ​ The **[[opentag:​otlib:​auth|Authentication Module]]** provides a way to authenticate **and** secure data messages, and to identify them as Root/​User/​Guest. 
 +=== Buffer Module === 
 +OpenTag ​is a system ​for data communication,​ so data buffers are important.  The **[[opentag:​otlib:​buffer|Buffer Module]]** is a lightly-structured data heap with no memory-management requirements ​(i.e. no malloc) 
 +=== CRC16 Module === 
 +The **[[opentag:​otlib:​crc|CRC16 Module]]** implements block-based and stream-based calculation methods for CRC16. 
 +=== Crypto Module === 
 +The **[[opentag:​otlib:​crypto|Crypto Module]]** provides a generic interface to EAX encryption, which is the standard for OpenTag. ​ The Crypto Module can be ignored if using the Auth Module instead. 
 +=== Logger Module === 
 +The **[[opentag:​otlib:​logger|Logger]]** is basically a "​print"​ function for OpenTag. ​ It is an M2DEF-formatted ALP, and it supports binary, text, and other sorts of outputs. 
 +=== Queue Module ===  
 +The **[[opentag:​otlib:​queue|Queue Module]]** is the standard way in OpenTag to manipulate, inspect, and reference data buffers. ​ OpenTag Queues are particularly designed to work with streaming data I/O, where writing and reading may be happening in parallel by independent processes. 
 +=== Utils === 
 +**[[opentag:​otlib:​ot_utils|OpenTag Utils]]** provide various, handy features for OpenTag users. 
 +===== Working with OTlib ===== 
 +You may include individual OTlib modules into your C projects as shown below (using queue and crc16 as examples):​ 
 +#include <​otlib/​queue.h>​ 
 +#include <​otlib/​crc16.h>​ 
 +Additionallyif you want to simply include the entire ​OTlib, just do the following:​ 
 +#include <otlib.h> 
 +====== OTlib (v1) ======
 === Platform Definition === === Platform Definition ===
opentag/otlib/main.txt · Last modified: 2014/09/01 18:14 by jpnorair