]> rtime.felk.cvut.cz Git - frescor/fna.git/blobdiff - src_frescan/frescan_servers.h
add functions to be able to change the PERCEIVED parameters and then commit them...
[frescor/fna.git] / src_frescan / frescan_servers.h
index e38622cae44b2ce0a76929c04a74266ddced40b4..0ecaed88e3690a8ca0df6962506480472cde4ce9 100644 (file)
  *
  * @license
  *
- * See MaRTE OS license
+ * -----------------------------------------------------------------------
+ *  Copyright (C) 2006 - 2008 FRESCOR consortium partners:
+ *
+ *    Universidad de Cantabria,              SPAIN
+ *    University of York,                    UK
+ *    Scuola Superiore Sant'Anna,            ITALY
+ *    Kaiserslautern University,             GERMANY
+ *    Univ. Politécnica  Valencia,           SPAIN
+ *    Czech Technical University in Prague,  CZECH REPUBLIC
+ *    ENEA                                   SWEDEN
+ *    Thales Communication S.A.              FRANCE
+ *    Visual Tools S.A.                      SPAIN
+ *    Rapita Systems Ltd                     UK
+ *    Evidence                               ITALY
+ *
+ *    See http://www.frescor.org for a link to partners' websites
+ *
+ *           FRESCOR project (FP6/2005/IST/5-034026) is funded
+ *        in part by the European Union Sixth Framework Programme
+ *        The European Union is not liable of any use that may be
+ *        made of this code.
+ *
+ *  This file is part of FRESCAN
+ *
+ *  FRESCAN is free software; you can  redistribute it and/or  modify
+ *  it under the terms of  the GNU General Public License as published by
+ *  the Free Software Foundation;  either  version 2, or (at  your option)
+ *  any later version.
+ *
+ *  FRESCAN  is distributed  in  the hope  that  it  will  be useful,  but
+ *  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
+ *  MERCHANTABILITY  or  FITNESS FOR  A  PARTICULAR PURPOSE. See  the  GNU
+ *  General Public License for more details.
+ *
+ *  You should have  received a  copy of  the  GNU  General Public License
+ *  distributed  with  FRESCAN;  see file COPYING.   If not,  write to the
+ *  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
+ *  02111-1307, USA.
+ *
+ * As a special exception, including FRESCAN header files in a file,
+ * instantiating FRESCAN generics or templates, or linking other files
+ * with FRESCAN objects to produce an executable application, does not
+ * by itself cause the resulting executable application to be covered
+ * by the GNU General Public License. This exception does not
+ * however invalidate any other reasons why the executable file might be
+ * covered by the GNU Public License.
+ * -----------------------------------------------------------------------
  *
  */
 
 #ifndef _MARTE_FRESCAN_SERVERS_H_
 #define _MARTE_FRESCAN_SERVERS_H_
 
-#include <drivers/frescan.h> // frescan_prio_t, frescan_ss_t
+#include "frescan.h"         // frescan_prio_t, frescan_ss_t
 #include "frescan_packets.h" // frescan_packet_t
-#include <time.h>            // struct timespec
 #include "frescan_data.h"
 
 /**
@@ -51,9 +96,37 @@ extern int frescan_servers_create(frescan_network_t net,
                                   const frescan_server_params_t *params,
                                   frescan_ss_t *id);
 
+/**
+ * frescan_servers_set_perceived() - update a sporadic server perceived data
+ *
+ * @net: the network instance
+ * @params: the parameters for the server
+ * @id: the identificator for the server
+ *
+ */
+
+extern int frescan_servers_set_perceived(frescan_network_t net,
+                                         const frescan_server_params_t *params,
+                                         frescan_ss_t id);
+
+/**
+ * frescan_servers_commit_perceived() - commit sporadic server perceived data
+ *
+ * @net: the network instance
+ * @params: the parameters for the server
+ * @id: the identificator for the server
+ *
+ */
+
+extern int frescan_servers_commit_perceived(frescan_network_t net,
+                                            frescan_ss_t id);
+
 /**
  * frescan_servers_update() - update a sporadic server data
  *
+ * It is similar to call 'frescan_servers_set_perceived' and then
+ * 'frescan_servers_commit_perceived'
+ *
  * @net: the network instance
  * @params: the parameters for the server
  * @id: the identificator for the server
@@ -122,6 +195,7 @@ extern int frescan_servers_get_highest_prio(frescan_network_t net,
  *
  * @net: the network instance
  * @id: the identificator for the server
+ * @packet: the packet sent (with its timestamp)
  *
  * This function is called when a frame has been effectively sent through the
  * CAN bus and that frame is associated to a certain server. The function
@@ -132,6 +206,8 @@ extern int frescan_servers_get_highest_prio(frescan_network_t net,
  * function at frescan_servers_replenishments module
  */
 
-extern int frescan_servers_frame_sent(frescan_network_t net, frescan_ss_t id);
+extern int frescan_servers_frame_sent(frescan_network_t net,
+                                      frescan_ss_t id,
+                                      frescan_packet_t *packet);
 
 #endif // _MARTE_FRESCAN_SERVERS_H_