22 void custody_signal_received(custody_signal_t *custody_signal) {
24 if((custody_signal->status & CUSTODY_TRANSFER_SUCCEEDED) != 0)
26 custody_remove_bundle(custody_signal->src_node, custody_signal->src_app, custody_signal->bundle_creation_timestamp, custody_signal->bundle_creation_timestamp_seq);
28 else if((custody_signal->status & CUSTODY_TRANSFER_SUCCEEDED) == 0) {
30 if((custody_signal->status & REDUNDANT_RECEPTION) != 0) {
32 custody_remove_bundle(custody_signal->src_node, custody_signal->src_app, custody_signal->bundle_creation_timestamp, custody_signal->bundle_creation_timestamp_seq);
38 void custody_signal_set_signal_status (uint8_t reason, uint8_t transfer_result, custody_signal_t *return_signal) {
40 return_signal->status = transfer_result | reason;
44 void custody_signal_set_signal_time(custody_signal_t *return_signal) {
46 return_signal->custody_signal_time =
clock_time();
50 void custody_signal_copy_timestamp_to_signal (
struct bundle_t *bundle , custody_signal_t *return_signal) {
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);
57 void custody_signal_copy_eid_to_signal(
struct bundle_t *bundle, custody_signal_t *return_signal) {
59 sdnv_decode(bundle->mem->ptr + bundle->offset_tab[SRC_NODE][OFFSET], bundle->offset_tab[SRC_NODE][STATE], return_signal->src_node);
61 sdnv_decode(bundle->mem->ptr + bundle->offset_tab[SRC_APP][OFFSET], bundle->offset_tab[SRC_APP][STATE], return_signal->src_app);