Contiki 2.5
custody_signal.c
Go to the documentation of this file.
1 /**
2  * \addtogroup admininistrative_records
3  * @{
4  */
5 
6 /**
7  * \file
8  * \brief Implementation of Custody Signals
9  * \author Georg von Zengen <vonzeng@ibr.cs.tu-bs.de>
10  */
11 
12 #include <stdlib.h>
13 #include <string.h>
14 
15 #include "clock.h"
16 
17 #include "sdnv.h"
18 #include "custody.h"
19 
20 #include "custody_signal.h"
21 
22 void custody_signal_received(custody_signal_t *custody_signal) {
23 #if 0
24  if((custody_signal->status & CUSTODY_TRANSFER_SUCCEEDED) != 0)
25  {
26  custody_remove_bundle(custody_signal->src_node, custody_signal->src_app, custody_signal->bundle_creation_timestamp, custody_signal->bundle_creation_timestamp_seq);
27  }
28  else if((custody_signal->status & CUSTODY_TRANSFER_SUCCEEDED) == 0) {
29 
30  if((custody_signal->status & REDUNDANT_RECEPTION) != 0) {
31 
32  custody_remove_bundle(custody_signal->src_node, custody_signal->src_app, custody_signal->bundle_creation_timestamp, custody_signal->bundle_creation_timestamp_seq);
33  }
34  }
35 #endif
36 }
37 
38 void custody_signal_set_signal_status (uint8_t reason, uint8_t transfer_result, custody_signal_t *return_signal) {
39 #if 0
40  return_signal->status = transfer_result | reason;
41 #endif
42 }
43 
44 void custody_signal_set_signal_time(custody_signal_t *return_signal) {
45 #if 0
46  return_signal->custody_signal_time = clock_time();
47 #endif
48 }
49 
50 void custody_signal_copy_timestamp_to_signal (struct bundle_t *bundle , custody_signal_t *return_signal) {
51 #if 0
52  sdnv_decode(bundle->mem->ptr + bundle->offset_tab[TIME_STAMP][OFFSET], bundle->offset_tab[TIME_STAMP][STATE], return_signal->bundle_creation_timestamp);
53  sdnv_decode(bundle->mem->ptr + bundle->offset_tab[TIME_STAMP_SEQ_NR][OFFSET], bundel->offset_tab[TIME_STAMP_SEQ_NR][STATE], return_signal->bundle_creation_timestamp_seq);
54 #endif
55 }
56 
57 void custody_signal_copy_eid_to_signal(struct bundle_t *bundle, custody_signal_t *return_signal) {
58 #if 0
59  sdnv_decode(bundle->mem->ptr + bundle->offset_tab[SRC_NODE][OFFSET], bundle->offset_tab[SRC_NODE][STATE], return_signal->src_node);
60 
61  sdnv_decode(bundle->mem->ptr + bundle->offset_tab[SRC_APP][OFFSET], bundle->offset_tab[SRC_APP][STATE], return_signal->src_app);
62 #endif
63 }
64 /** @} */