2 This file is part of GNUnet
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file include/gnunet_sensor_service.h
23 * @brief API to the sensor service
24 * @author Omar Tarabai
26 #ifndef GNUNET_SENSOR_SERVICE_H
27 #define GNUNET_SENSOR_SERVICE_H
30 #include "gnunet_util_lib.h"
35 #if 0 /* keep Emacsens' auto-indent happy */
42 * Handle to the sensor service.
44 struct GNUNET_SENSOR_Handle;
47 * Structure containing brief info about sensor
49 struct SensorInfoShort //FIXME: rename
58 * First part of version number
60 uint16_t version_major;
63 * Second part of version number
65 uint16_t version_minor;
75 * Type of an iterator over sensor definitions.
78 * @param hello hello message for the peer (can be NULL)
79 * @param error message
81 typedef void (*GNUNET_SENSOR_SensorIteratorCB) (void *cls,
82 const struct SensorInfoShort *sensor,
86 * Continuation called with a status result.
89 * @param emsg error message, NULL on success
91 typedef void (*GNUNET_SENSOR_Continuation)(void *cls,
95 * Connect to the sensor service.
97 * @return NULL on error
99 struct GNUNET_SENSOR_Handle *
100 GNUNET_SENSOR_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
103 * Disconnect from the sensor service
105 * @param h handle to disconnect
108 GNUNET_SENSOR_disconnect(struct GNUNET_SENSOR_Handle *h);
111 * Client asking to iterate all available sensors
113 * @param h Handle to SENSOR service
114 * @param timeout how long to wait until timing out
115 * @param sensorname information on one sensor only, can be NULL to get all
116 * @param sensorname_len length of the sensorname parameter
117 * @param callback the method to call for each sensor
118 * @param callback_cls closure for callback
119 * @return iterator context
121 struct GNUNET_SENSOR_SensorIteratorContext *
122 GNUNET_SENSOR_iterate_sensors (struct GNUNET_SENSOR_Handle *h,
123 struct GNUNET_TIME_Relative timeout,
124 const char* sensorname, size_t sensorname_len,
125 GNUNET_SENSOR_SensorIteratorCB callback, void *callback_cls);
127 #if 0 /* keep Emacsens' auto-indent happy */