gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r33954 - in gnunet: po src/include src/sensor


From: gnunet
Subject: [GNUnet-SVN] r33954 - in gnunet: po src/include src/sensor
Date: Sat, 12 Jul 2014 00:10:15 +0200

Author: grothoff
Date: 2014-07-12 00:10:15 +0200 (Sat, 12 Jul 2014)
New Revision: 33954

Modified:
   gnunet/po/POTFILES.in
   gnunet/src/include/gnunet_sensor_util_lib.h
   gnunet/src/sensor/gnunet-service-sensor-reporting.c
Log:
-fixing doxygen, indentation

Modified: gnunet/po/POTFILES.in
===================================================================
--- gnunet/po/POTFILES.in       2014-07-10 20:52:52 UTC (rev 33953)
+++ gnunet/po/POTFILES.in       2014-07-11 22:10:15 UTC (rev 33954)
@@ -267,7 +267,9 @@
 src/secretsharing/secretsharing_api.c
 src/secretsharing/secretsharing_common.c
 src/sensor/gnunet-sensor.c
+src/sensor/gnunet-service-sensor-analysis.c
 src/sensor/gnunet-service-sensor.c
+src/sensor/plugin_sensor_model_gaussian.c
 src/sensor/sensor_api.c
 src/set/gnunet-service-set.c
 src/set/gnunet-service-set_intersection.c

Modified: gnunet/src/include/gnunet_sensor_util_lib.h
===================================================================
--- gnunet/src/include/gnunet_sensor_util_lib.h 2014-07-10 20:52:52 UTC (rev 
33953)
+++ gnunet/src/include/gnunet_sensor_util_lib.h 2014-07-11 22:10:15 UTC (rev 
33954)
@@ -209,7 +209,7 @@
   void *value;
 
   /**
-   * Size of @value
+   * Size of @e value
    */
   uint16_t value_size;
 

Modified: gnunet/src/sensor/gnunet-service-sensor-reporting.c
===================================================================
--- gnunet/src/sensor/gnunet-service-sensor-reporting.c 2014-07-10 20:52:52 UTC 
(rev 33953)
+++ gnunet/src/sensor/gnunet-service-sensor-reporting.c 2014-07-11 22:10:15 UTC 
(rev 33954)
@@ -61,7 +61,7 @@
 
   /**
    * Collection point reporting task
-   * (OR GNUNET_SCHEDULER_NO_TASK)
+   * (or #GNUNET_SCHEDULER_NO_TASK)
    */
   GNUNET_SCHEDULER_TaskIdentifier cp_task;
 
@@ -76,7 +76,7 @@
   void *last_value;
 
   /**
-   * Size of @last_value
+   * Size of @e last_value
    */
   size_t last_value_size;
 
@@ -125,13 +125,13 @@
   void *pending_msg;
 
   /**
-   * Size of @pending_msg
+   * Size of @e pending_msg
    */
   size_t pending_msg_size;
 
   /**
    * Handle to CADET tranmission request in case we are sending
-   * (sending == GNUNET_YES)
+   * (sending == #GNUNET_YES)
    */
   struct GNUNET_CADET_TransmitHandle *th;
 
@@ -232,15 +232,18 @@
   GNUNET_free (cc);
 }
 
+
 /**
  * Stop sensor reporting module
  */
-void SENSOR_reporting_stop ()
+void
+SENSOR_reporting_stop ()
 {
   struct ReportingContext *rc;
   struct CadetChannelContext *cc;
 
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "Stopping sensor reporting module.\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Stopping sensor reporting module.\n");
   while (NULL != cc_head)
   {
     cc = cc_head;
@@ -265,6 +268,7 @@
   }
 }
 
+
 /**
  * Returns CADET channel established to given peer
  * or creates a new one
@@ -297,6 +301,7 @@
   return cc;
 }
 
+
 /**
  * Construct a reading message ready to be sent over CADET channel
  *
@@ -306,7 +311,7 @@
  */
 static size_t
 construct_reading_message (struct ReportingContext *rc,
-    struct GNUNET_SENSOR_ReadingMessage **msg)
+                           struct GNUNET_SENSOR_ReadingMessage **msg)
 {
   struct GNUNET_SENSOR_ReadingMessage *ret;
   uint16_t sensorname_size;
@@ -333,6 +338,7 @@
   return total_size;
 }
 
+
 /**
  * Function called to notify a client about the connection begin ready
  * to queue more data.  @a buf will be NULL and @a size zero if the
@@ -351,7 +357,8 @@
 
   cc->th = NULL;
   cc->sending = GNUNET_NO;
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "Copying to CADET transmit buffer.\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Copying to CADET transmit buffer.\n");
   if (NULL == buf)
   {
     LOG (GNUNET_ERROR_TYPE_WARNING,
@@ -374,14 +381,16 @@
   return written;
 }
 
+
 /**
  * Task scheduled to send values to collection point
  *
- * @param cls closure, a 'struct CollectionReportingContext *'
+ * @param cls closure, a `struct CollectionReportingContext *`
  * @param tc unused
  */
-static void report_collection_point
-(void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
+static void
+report_collection_point (void *cls,
+                         const struct GNUNET_SCHEDULER_TaskContext* tc)
 {
   struct ReportingContext *rc = cls;
   struct SensorInfo *sensor = rc->sensor;
@@ -392,22 +401,26 @@
   rc->cp_task = GNUNET_SCHEDULER_NO_TASK;
   if (0 == rc->last_value_size) /* Did not receive a sensor value yet */
   {
-    LOG (GNUNET_ERROR_TYPE_WARNING, "Did not receive a value from `%s' "
-        "to report yet.\n", rc->sensor->name);
+    LOG (GNUNET_ERROR_TYPE_WARNING,
+         "Did not receive a value from `%s' to report yet.\n",
+         rc->sensor->name);
     rc->cp_task = GNUNET_SCHEDULER_add_delayed (sensor->collection_interval,
             &report_collection_point, rc);
     return;
   }
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "Now trying to report last seen value of `%s' "
-      "to collection point.\n", rc->sensor->name);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Now trying to report last seen value of `%s' "
+       "to collection point.\n",
+       rc->sensor->name);
   GNUNET_assert (NULL != sensor->collection_point);
   cc = get_cadet_channel (*sensor->collection_point);
   if (GNUNET_YES == cc->sending)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
-        "Cadet channel to collection point busy, "
-        "trying again for sensor `%s' after %d seconds.\n", rc->sensor->name,
-        COLLECTION_RETRY);
+         "Cadet channel to collection point busy, "
+         "trying again for sensor `%s' after %d seconds.\n",
+         rc->sensor->name,
+         COLLECTION_RETRY);
     rc->cp_task = GNUNET_SCHEDULER_add_delayed (
       GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 
COLLECTION_RETRY),
       &report_collection_point, rc);
@@ -427,7 +440,8 @@
       &report_collection_point, rc);
 }
 
-/*
+
+/**
  * Sensor value watch callback
  */
 static int
@@ -448,12 +462,15 @@
   memcpy (rc->last_value, record->value, record->value_size);
   rc->last_value_size = record->value_size;
   rc->timestamp = GNUNET_TIME_absolute_get().abs_value_us;
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "Received a sensor `%s' watch value at "
-      "timestamp %" PRIu64 ", updating notification last_value.\n",
-      rc->sensor->name, rc->timestamp);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Received a sensor `%s' watch value at "
+       "timestamp %" PRIu64 ", updating notification last_value.\n",
+       rc->sensor->name,
+       rc->timestamp);
   return GNUNET_YES;
 }
 
+
 /**
  * Iterator for defined sensors
  * Watches sensors for readings to report
@@ -509,6 +526,7 @@
   return GNUNET_YES;
 }
 
+
 /**
  * Function called whenever a channel is destroyed.  Should clean up
  * any associated state.
@@ -520,9 +538,10 @@
  * @param channel_ctx place where local state associated
  *                   with the channel is stored
  */
-static void cadet_channel_destroyed (void *cls,
-    const struct GNUNET_CADET_Channel *channel,
-    void *channel_ctx)
+static void
+cadet_channel_destroyed (void *cls,
+                         const struct GNUNET_CADET_Channel *channel,
+                         void *channel_ctx)
 {
   struct CadetChannelContext *cc = channel_ctx;
 
@@ -545,13 +564,14 @@
  */
 int
 SENSOR_reporting_start (const struct GNUNET_CONFIGURATION_Handle *c,
-    struct GNUNET_CONTAINER_MultiHashMap *sensors)
+                        struct GNUNET_CONTAINER_MultiHashMap *sensors)
 {
   static struct GNUNET_CADET_MessageHandler cadet_handlers[] = {
       {NULL, 0, 0}
   };
 
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "Starting sensor reporting module.\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Starting sensor reporting module.\n");
   GNUNET_assert(NULL != sensors);
   cfg = c;
   peerstore = GNUNET_PEERSTORE_connect(cfg);
@@ -571,13 +591,14 @@
   if (NULL == cadet)
   {
     LOG (GNUNET_ERROR_TYPE_ERROR,
-        _("Failed to connect to CADET service.\n"));
+         _("Failed to connect to CADET service.\n"));
     SENSOR_reporting_stop ();
     return GNUNET_SYSERR;
   }
-  GNUNET_CRYPTO_get_peer_identity(cfg, &mypeerid);
-  GNUNET_CONTAINER_multihashmap_iterate(sensors, &init_sensor_reporting, NULL);
-
+  GNUNET_CRYPTO_get_peer_identity (cfg,
+                                   &mypeerid);
+  GNUNET_CONTAINER_multihashmap_iterate(sensors,
+                                        &init_sensor_reporting, NULL);
   return GNUNET_OK;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]