Repository navigation
CSPS query interface_v0.2
Because of the library architecture, results of the processing of a topology is necessarily stored in streams. The library provides then a way of accessing the data contained in the streams through a query interface. Moreover, the query interface allows to perform queries on values that are not necessarily on a time discretization node using cubic interpolation. It follows that any timestamp can be given to access data stored in a result stream.
Taking into account that client software have to perform a large number of query on a specific result stream, the query interface operates in three steps : the first step consists in result stream openning and loading returning a structure that is then used for queries as a second step. The last step consists simply in structure release to unallocate memory. The following code gives an example of query interface usage :
/* Query structure creation */
lp_Geopos_t Query = lp_query_position_read(
"/some/path/",
"gps",
"ls20031",
"mod-SGNQF"
);
/* Perform a query on position */
lp_query_position( & Query, 1400684250lu );
/* Check query results */
if ( Query.qrStatus == LP_TRUE ) {
/* Display queried position */
printf( "Position : %f, %f, %f\n",
Query.qrLatitude,
Query.qrLongitude,
Query.qrAltitude
);
} else {
/* The query on position failed */
printf( "Invalid stream or timestamp\n" );
}
/* Release query structure */
lp_query_position_delete( & Query );On this example, a single query is performed on position provided by the mod-SGNQF module output stream related to a GPS device with tag ls20031. The query failure is simply detected through the value of the qrStatus field of the query structure. Failure are essentially due to bad CSPS structure path or a timestamp outside of the data range. If the query structure is not released, memory leaks have to be expected.
Documentation under CC BY-SA license (c) 2013-2015 FOXEL SA
[Home](Home)
Section : device assembly
- [CSPS device assembly](CSPS device assembly)
Section : architecture
- [CSPS architecture](CSPS architecture)
Section : streams
- [CSPS streams](CSPS streams)
Section : extraction modules
- [Module : cam-mod-DSIDE](Module cam-mod-DSIDE)
- [Module : imu-mod-DSIDE](Module imu-mod-DSIDE)
- [Module : gps-mod-DSIDE](Module gps-mod-DSIDE)
Section : stream modules
- [Module : gps-mod-SGNQF](Module gps-mod-SGNQF)
- [Module : imu-mod-IFETI](Module imu-mod-IFETI)
- [Module : imu-mod-IOISA](Module imu-mod-IOISA)
- [Module : imu-mod-ISRAD](Module imu-mod-ISRAD)
- [Module : imu-mod-SGNDN](Module imu-mod-SGNDN)
- [Module : imu-mod-SGSFR](Module imu-mod-SGSFR)
- [Module : imu-mod-AACEX](Module imu-mod-AACEX)
- [Module : imu-mod-IFICR](Module imu-mod-IFICR)
- [Module : imu-mod-IOBMA](Module imu-mod-IOBMA)
Section : topology
- [CSPS topology](CSPS topology)
Section : query interface
- [CSPS query interface](CSPS query interface)
Section : Library usage
- [Library usage](Library usage)
Development : logs