Collect-view Code Details

From Contiki
Revision as of 16:06, 4 November 2014 by Pradiptg (Talk | contribs) (Description)

Jump to: navigation, search

Back to Contiki Tutorials


Introduction

This tutorial covers the main features of Collect-view Protocol (CTP) available on ContikiOS 2.7. There are many different section of CTP codes that are distributed over different folders. In this tutorial we will cover the codes and their interdependence in brief details.

You will learn

Through this tutorial you will learn about different code components of CTP. This will help you in any projects that require deep understanding of the code or need modification of some portion of the code.


Source Codes

~/contiki-2.7/core/net/rime/collect.c

~/contiki-2.7/core/net/rime/collect.h

~/contiki-2.7/core/net/rime/collect-neighbor.c

~/contiki-2.7/core/net/rime/collect-neighbor.c

~/contiki-2.7/apps/collect-view/

Description

void collect_open(struct collect_conn *c, uint16_t channels, uint8_t is_router, const struct collect_callbacks *callbacks);

This function opens a unicast channel in each node with the channel being (channels+1).

                  unicast_open(&tc->unicast_conn, channels + 1, &unicast_callbacks);

void collect_close(struct collect_conn *c);

int collect_send(struct collect_conn *c, int rexmits);

void collect_set_sink(struct collect_conn *c, int should_be_sink);

int collect_depth(struct collect_conn *c);


const rimeaddr_t *collect_parent(struct collect_conn *c);

void collect_set_keepalive(struct collect_conn *c, clock_time_t period);

void collect_print_stats(void);