AGG (AggreGate) Library
|Top Previous Next|
The AGG library implements an interface to Tibbo AggreGate Server (http://aggregate.tibbo.com). It is the "agent" that runs on your Tibbo BASIC/C device and connects it to the server using Tibbo's proprietary AggreGate Communication Protocol, or ACP (http://aggregate.tibbo.com/docs/ap_protocol.htm). Among the six ways to connect a device to the AggreGate server (http://aggregate.tibbo.com/technology/connectivity.html), using the library fast-tracks you through either the "second way" or the "fourth way".
The second way — "Connecting An Existing Device With AggreGate Agent" — assumes that there is a "legacy" device which is already designed, and possibly in production. This device knows nothing about Tibbo's AggreGate technology, yet you want to connect it to the AggreGate server. In order to achieve this, you use a Tibbo BASIC/C module or controller (EM1000, DS1206, etc.) to act as an "adaptor" that translates between the native protocol (or signals) of the legacy device and the AggreGate server. The fastest way to get this done is to write a Tibbo BASIC/C application that relies on the AGG library for the ACP implementation.
The fourth way — "Designing A New Device Based On Programmable Module" — is for when you are building a new device from scratch and you want this device to work with AggreGate. You take one of our very capable modules (such as the EM1000) and use it as the "CPU" of the new device. You then task this "CPU" with all kinds of things that make your device operational. One of the tasks — communicating with the AggreGate server — is handled by the AGG library.
The AggreGate Communication Protocol (ACP) is rather complex and would take you quite some time to read through, comprehend, and implement — have you not had the AGG library. When you are using the library, all this complexity is hidden behind an easy-to-use configurator. Fill in all the necessary "items", and the server will know how to work with your device.
Without resorting to rewriting the AggreGate manual (http://aggregate.tibbo.com/docs/), let's remind ourselves that from the AggreGate's point of view, your device is an "object" which comprises items of three kinds: variables (properties), functions (methods), and events. To avoid confusion with the internal variables, methods, and events of Tibbo BASIC/C, we will refer to AggreGate ones as A-variables, A-functions, and A-events.
An A-variable can be a simple single-value affair, an array of values, or a full-blown data table (and it will still be a "variable" in the AggreGate's view). The AGG library relies on the STG (settings) library for storing single-value and array A-variables. This provides for persistent and reliable storage of A-variables, and also — through pre-gets and post-sets — for controlling and monitoring the device operation through A-variables (settings). Naturally, the latter will require the custom code to be written and placed into callback_stg_pre_get() and callback_stg_post_set().
Table A-variables are handled through the TBL (tables) library [not yet documented].
A-functions and A-events require custom code to be written, so it's not enough to just put necessary data into the configurator.