its_mode2.h File Reference

ITS Mesh networking mode 2. More...

#include "pic_utils.h"
Include dependency graph for its_mode2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  its2_packet
struct  queued_item
struct  seen_packet

Defines

#define ITS2_FLAG_ACK   0x01
#define ITS2_FLAG_DELETED   0xff
#define ITS2_FLAG_NO_ACK   0x02
#define ITS2_NO_AVAILABLE_SLOTS   0xff
#define ITS2_STATUS_QUEUED   0x00
#define ITS2_STATUS_TX_QUEUE_FULL   0x01
#define ITS2_TX_STATUS_NEXT_HOP_UNKNOWN   0x04
#define ITS2_TX_STATUS_NO_ACK   0x02
#define ITS2_TX_STATUS_NO_ROUTE   0x01
#define ITS2_TX_STATUS_REMOTE_NO_ACK   0x03
#define ITS2_TX_STATUS_SUCCESS   0x00
#define ITS2_UPDATE_ROUTE_FAIL   0x01
#define ITS2_UPDATE_ROUTE_SUCCESS   0x00
#define POS_DEST_H   0x0a
#define POS_DEST_L   0x09
#define POS_HOP_COUNT   0x0d
#define POS_KEY1   0x00
 !! look at the adding in routes bit...
#define POS_KEY2   0x01
#define POS_LENGTH_HEADER   0x02
#define POS_MAX_HOP_COUNT   0x0b
#define POS_NETWORK_H   0x06
#define POS_NETWORK_L   0x05
#define POS_NUM_ROUTES   0x0c
#define POS_PKT_TYPE   0x03
#define POS_ROUTE_START   0x0e
#define POS_SEQUENCE   0x04
#define POS_SOURCE_H   0x08
#define POS_SOURCE_L   0x07
#define QS_ACK_RECEIVED   0x04
#define QS_READY_TO_SEND   0x02
#define QS_ROUTING_FAILED   0x06
#define QS_SENT   0x05
#define QS_WAITING_ON_ACK   0x03
#define QS_WAITING_ON_LOCAL_ADDR   0x00
#define QS_WAITING_ON_NETWORK_ADDR   0x01
#define REMOTE_DEVICE   0xffff

Typedefs

typedef enum _its2_result its2_result
typedef enum _its2_state its2_state

Enumerations

enum  _its2_result {
  RESULT_SUCCESSFUL, RESULT_FAILED, ITEM_QUEUED, QUEUE_FULL,
  ROUTING_TOO_MANY_HOPS, NEXT_HOP_NOT_LOCAL
}
enum  _its2_state {
  STATE_STARTUP, STATE_RUNNING, STATE_SEARCHING, STATE_ASSOCIATED,
  STATE_UNASSOCIATED
}

Functions

void its2_delete_item_from_queue (queued_item *item)
its2_result its2_device_init (uns16 my_device_id, uns16 network_id)
void its2_device_process ()
void its2_device_receive_callback (uns8 *data, uns8 data_length)
its2_result its2_device_transmit (uns16 device_id, uns8 *data, uns8 data_length)
its2_result its2_find_coordinator ()
its2_result its2_forward_routed_packet (its2_packet *pkt, uns8 *data, uns8 data_length)
void its2_print_packet (its2_packet *pkt)
void its2_print_queue ()
void its2_process_tx_queue ()
its2_result its2_rebroadcast_net_discover_req (its2_packet *pkt)
void its2_request_local_addr (uns16 device_id)
void its2_request_net_addr (uns16 device_id)
void its2_respond_local_addr (uns16 device_id)
void its2_respond_net_addr (uns16 device_id)
its2_result its2_router_handle_association (uns16 pan_id, uns16 its_device_id)
uns8 its2_router_init (uns16 my_device_id, uns16 network_id)
void its2_router_process ()
its2_result its2_router_queue_packet (uns16 device_id, uns8 packet_type, uns8 *data, uns8 data_length, uns8 ack)
void its2_router_receive_callback (uns16 device_id, uns8 *data, uns8 data_length)
void its2_setup_io ()
void its2_transmit (queued_item *item)
void its2_transmit_status_callback (its2_packet *pkt, uns8 status)

Variables

bit debug_module
its2_state state

Detailed Description

Definition in file its_mode2.h.


Define Documentation

#define ITS2_FLAG_ACK   0x01

Definition at line 112 of file its_mode2.h.

Referenced by its2_transmit().

#define ITS2_FLAG_DELETED   0xff
#define ITS2_FLAG_NO_ACK   0x02
#define ITS2_NO_AVAILABLE_SLOTS   0xff

Definition at line 109 of file its_mode2.h.

Referenced by its2_forward_routed_packet(), and its2_rebroadcast_net_discover_req().

#define ITS2_STATUS_QUEUED   0x00

Definition at line 107 of file its_mode2.h.

#define ITS2_STATUS_TX_QUEUE_FULL   0x01

Definition at line 108 of file its_mode2.h.

#define ITS2_TX_STATUS_NEXT_HOP_UNKNOWN   0x04

Definition at line 100 of file its_mode2.h.

Referenced by its2_process_tx_queue().

#define ITS2_TX_STATUS_NO_ACK   0x02

Definition at line 98 of file its_mode2.h.

Referenced by its2_process_tx_queue().

#define ITS2_TX_STATUS_NO_ROUTE   0x01

Definition at line 97 of file its_mode2.h.

Referenced by its2_process_tx_queue().

#define ITS2_TX_STATUS_REMOTE_NO_ACK   0x03

Definition at line 99 of file its_mode2.h.

#define ITS2_TX_STATUS_SUCCESS   0x00

Definition at line 96 of file its_mode2.h.

Referenced by its2_process_tx_queue().

#define ITS2_UPDATE_ROUTE_FAIL   0x01

Definition at line 104 of file its_mode2.h.

Referenced by its2_router_queue_packet().

#define ITS2_UPDATE_ROUTE_SUCCESS   0x00

Definition at line 103 of file its_mode2.h.

#define POS_DEST_H   0x0a

Definition at line 78 of file its_mode2.h.

#define POS_DEST_L   0x09

Definition at line 77 of file its_mode2.h.

#define POS_HOP_COUNT   0x0d

Definition at line 81 of file its_mode2.h.

#define POS_KEY1   0x00

Definition at line 68 of file its_mode2.h.

#define POS_KEY2   0x01

Definition at line 69 of file its_mode2.h.

#define POS_LENGTH_HEADER   0x02

Definition at line 70 of file its_mode2.h.

#define POS_MAX_HOP_COUNT   0x0b

Definition at line 79 of file its_mode2.h.

#define POS_NETWORK_H   0x06

Definition at line 74 of file its_mode2.h.

#define POS_NETWORK_L   0x05

Definition at line 73 of file its_mode2.h.

#define POS_NUM_ROUTES   0x0c

Definition at line 80 of file its_mode2.h.

#define POS_PKT_TYPE   0x03

Definition at line 71 of file its_mode2.h.

#define POS_ROUTE_START   0x0e

Definition at line 82 of file its_mode2.h.

#define POS_SEQUENCE   0x04

Definition at line 72 of file its_mode2.h.

#define POS_SOURCE_H   0x08

Definition at line 76 of file its_mode2.h.

#define POS_SOURCE_L   0x07

Definition at line 75 of file its_mode2.h.

#define QS_ACK_RECEIVED   0x04

Definition at line 89 of file its_mode2.h.

Referenced by its2_process_tx_queue().

#define QS_READY_TO_SEND   0x02
#define QS_ROUTING_FAILED   0x06

Definition at line 91 of file its_mode2.h.

Referenced by its2_process_tx_queue().

#define QS_SENT   0x05

Definition at line 90 of file its_mode2.h.

Referenced by its2_process_tx_queue(), and its2_transmit().

#define QS_WAITING_ON_ACK   0x03

Definition at line 88 of file its_mode2.h.

Referenced by its2_process_tx_queue(), and its2_transmit().

#define QS_WAITING_ON_LOCAL_ADDR   0x00

Definition at line 85 of file its_mode2.h.

Referenced by its2_forward_routed_packet(), and its2_process_tx_queue().

#define QS_WAITING_ON_NETWORK_ADDR   0x01

Definition at line 86 of file its_mode2.h.

Referenced by its2_process_tx_queue().

#define REMOTE_DEVICE   0xffff

Definition at line 94 of file its_mode2.h.


Typedef Documentation

typedef enum _its2_result its2_result

Definition at line 152 of file its_mode2.h.

typedef enum _its2_state its2_state

Definition at line 162 of file its_mode2.h.


Enumeration Type Documentation

Enumerator:
RESULT_SUCCESSFUL 
RESULT_FAILED 
ITEM_QUEUED 
QUEUE_FULL 
ROUTING_TOO_MANY_HOPS 
NEXT_HOP_NOT_LOCAL 

Definition at line 150 of file its_mode2.h.

Enumerator:
STATE_STARTUP 
STATE_RUNNING 
STATE_SEARCHING 
STATE_ASSOCIATED 
STATE_UNASSOCIATED 

Definition at line 154 of file its_mode2.h.


Function Documentation

void its2_delete_item_from_queue ( queued_item item  ) 

Definition at line 1025 of file its_mode2.c.

References queued_item::data, queued_item::data_length, queued_item::flag, and ITS2_FLAG_DELETED.

Referenced by its2_process_tx_queue().

Here is the caller graph for this function:

its2_result its2_device_init ( uns16  my_device_id,
uns16  network_id 
)

Definition at line 1136 of file its_mode2.c.

References debug_str, its_init(), its_set_device_id(), its_set_network_id(), mrf24j40_set_pan_id(), mrf24j40_set_short_address(), state, STATE_UNASSOCIATED, and wpan_init().

Here is the call graph for this function:

void its2_device_process (  ) 
void its2_device_receive_callback ( uns8 *  data,
uns8  data_length 
)

Referenced by wpan_data_received_callback().

Here is the caller graph for this function:

its2_result its2_device_transmit ( uns16  device_id,
uns8 *  data,
uns8  data_length 
)
its2_result its2_find_coordinator (  ) 
its2_result its2_forward_routed_packet ( its2_packet pkt,
uns8 *  data,
uns8  data_length 
)
void its2_print_packet ( its2_packet pkt  ) 
void its2_print_queue (  ) 
void its2_process_tx_queue (  ) 
its2_result its2_rebroadcast_net_discover_req ( its2_packet pkt  ) 
void its2_request_local_addr ( uns16  device_id  ) 

Definition at line 779 of file its_mode2.c.

References ITS2_FLAG_NO_ACK, its2_router_queue_packet(), and ITS_LOCAL_DISCOVER_REQ.

Referenced by its2_process_tx_queue().

Here is the call graph for this function:

Here is the caller graph for this function:

void its2_request_net_addr ( uns16  device_id  ) 

Definition at line 792 of file its_mode2.c.

References ITS2_FLAG_NO_ACK, its2_router_queue_packet(), and ITS_NET_DISCOVER_REQ.

Referenced by its2_process_tx_queue().

Here is the call graph for this function:

Here is the caller graph for this function:

void its2_respond_local_addr ( uns16  device_id  ) 

Definition at line 783 of file its_mode2.c.

References debug_module, debug_str, ITS2_FLAG_NO_ACK, its2_router_queue_packet(), and ITS_LOCAL_DISCOVER_RES.

Here is the call graph for this function:

void its2_respond_net_addr ( uns16  device_id  ) 

Definition at line 796 of file its_mode2.c.

References ITS2_FLAG_NO_ACK, its2_router_queue_packet(), and ITS_NET_DISCOVER_RES.

Here is the call graph for this function:

its2_result its2_router_handle_association ( uns16  pan_id,
uns16  its_device_id 
)

Definition at line 118 of file its_mode2.c.

References debug_str, its_add_local_device(), ITS_ASSOC_RES, ITS_DEVICE_NONE, its_get_device_handle(), its_transmit_to_handle(), RESULT_FAILED, and RESULT_SUCCESSFUL.

Here is the call graph for this function:

uns8 its2_router_init ( uns16  my_device_id,
uns16  network_id 
)
void its2_router_process (  ) 

Definition at line 808 of file its_mode2.c.

References its2_process_tx_queue(), state_timeout, tick_calc_diff(), tick_get_count(), tick_marker, turn_off_mrf_interrupts(), turn_on_mrf_interrupts(), and uns16.

Here is the call graph for this function:

its2_result its2_router_queue_packet ( uns16  device_id,
uns8  packet_type,
uns8 *  data,
uns8  data_length,
uns8  ack 
)
void its2_router_receive_callback ( uns16  device_id,
uns8 *  data,
uns8  data_length 
)
void its2_setup_io (  ) 

Definition at line 95 of file its_mode2.c.

References wpan_setup_io().

Here is the call graph for this function:

void its2_transmit ( queued_item item  ) 
void its2_transmit_status_callback ( its2_packet pkt,
uns8  status 
)

Referenced by its2_process_tx_queue().

Here is the caller graph for this function:


Variable Documentation

Definition at line 64 of file its_mode2.c.

Referenced by its2_respond_local_addr().


Generated on Wed Dec 8 13:47:22 2010 for Pic Pack by  doxygen 1.6.1