Indigresso Wiki

Open Source Stuff for DASH7

User Tools

Site Tools


opentag:otlib:alp_api

Differences

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

Link to this comparison view

opentag:otlib:alp_api [2012/03/26 18:21] (current)
jpnorair created
Line 1: Line 1:
 +====== ALP APIs (OTlib) ======
 +[[opentag:​main|OpenTag]] implements an [[opentag:​api:​main|API]] that is designed to give the user the ability to work with [[dash7_mode_2:​main|DASH7]] networking. ​ For more information about the API and how to use it, check the API article linked about. ​ This article describes the implementation of the API in [[opentag:​otlib:​main|OTlib]].
  
 +===== ALPs Used in the API =====
 +The ALPs below are all API-like in that they map to functions in [[opentag:​otlib:​main|OTlib]]
 +
 +^ OpenTag-specific APIs            ^^
 +^  ALP ID  ^ Description ​            ^
 +|  0x03    | [[opentag:​otlib:​logger|Logger API]]  |
 +|  0x80    | Session API ([[opentag:​otlib:​session|Session Module Functions]]) ​ |
 +|  0x81    | System API ([[opentag:​kernel:​main|Kernel/​MAC Functions]]) ​ |
 +|  0x82    | Query API ([[opentag:​otlib:​M2QP|M2QP/​Transport Functions]]) ​ |
 +^ DASH7-specific APIs        ^^
 +^  ALP ID  ^ Description ​            ^
 +|  0x00    | Null ALP    |
 +|  0x01    | [[opentag:​otlib:​alp_filedata|Filedata ALP]]  |
 +|  0x02    | [[opentag:​otlib:​alp_sensor|Sensor ALP]]  |
 +|  0x1X    | [[opentag:​otlib:​alp_security|Crypto-Security ALPs]] ​ |
 +
 +===== Implementation Notes =====
 +**Function->​Message->​Function**\\
 +OpenTag follows a [[opentag:​system_arch|client-server architecture]] and the roles of client and server ALP APIs are mirror images of each other. ​ The Server ALP implementation must parse/​process incoming ALP messages, take the corresponding actions, and then respond using some valid return data specified in the ALP.  The Client ALP implementation is basically a sandboxed, function-based implementation of [[opentag:​otlib:​otapi|OTAPI]],​ where the function calls are converted into ALP messages and sent to the server to be parsed. ​ Therefore, an OTAPI function call on a client gets converted into a message that gets re-converted to an OTAPI function call on a server.
 +
 +**Client Implementation**\\
 +The Client ALP API is implemented via OTAPI.h, alp.h, and alp_api_client.c. ​ Typically, [[opentag:​otlib:​mpipe|MPipe]] and [[opentag:​otlib:​ndef|NDEF]] are also needed to push the message onto the server, although technically a client and a server could be implemented on the same device as two processes. ​ In this case, any interprocess pipe do the work of the MPipe.
 +
 +**Server Implentation**\\
 +The Server ALP API requires all of the alp... files in OTlib/ to be present and compiled. ​ If the server build is configured not to use one or more optional ALPs (via the [[opentag:​apps:​main|Application]] configuration),​ there are preprocessor conditionals in the alp...c files that will prevent that code from being built. ​ Therefore, it is best to put all of the alp...c files into you makefile or project and to use the application configuration to select which ones get built.
 +
 +
 +===== OTlib/alp.h =====
opentag/otlib/alp_api.txt ยท Last modified: 2012/03/26 18:21 by jpnorair