its_mode2.c File Reference

#include "its_mode2.h"
#include "its_common.h"
#include "wpan.h"
#include "mrf24j40.h"
#include "config.h"
#include "pic_serial.h"
#include "pic_tick.h"
#include "pic_timer.h"
#include "memory.h"
#include "debug.h"
Include dependency graph for its_mode2.c:

Go to the source code of this file.

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 ()
its2_result its2_device_transmit (uns8 *data, uns8 data_length)
its2_result its2_find_controller ()
uns8 its2_find_free_queue_slot ()
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 ()
void its2_rebroadcast_net_addr_req ()
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 (queued_item *item)
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_setup_io ()
void its2_transmit (queued_item *item)
void turn_off_mrf_interrupts ()
void turn_on_mrf_interrupts ()
void wpan_data_received_callback (wpan_address *addr, uns8 *data, uns8 data_size)
void wpan_data_transmitted_callback (uns8 status, uns8 retries, uns8 channel_busy)
 Callback for data transmitted.

Variables

uns8 channel
uns8 controller_handle
bit debug_module = 0
uns8 its2_seen_index
static seen_packet its2_seen_list [ITS2_SEEN_LIST_SIZE]
bit its2_transmitting = 0
static queued_item its2_tx_queue [ITS2_TX_QUEUE_SIZE]
bit queue_processing = 0
its2_state state = STATE_STARTUP
uns16 state_timeout
uns16 tick_marker

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 (  ) 
its2_result its2_device_transmit ( uns8 *  data,
uns8  data_length 
)

Definition at line 1199 of file its_mode2.c.

References controller_handle, ITS_GENERIC_DATA, and its_transmit_to_handle().

Here is the call graph for this function:

its2_result its2_find_controller (  ) 

Definition at line 1157 of file its_mode2.c.

References channel, state, STATE_SEARCHING, tick_get_count(), and tick_marker.

Here is the call graph for this function:

uns8 its2_find_free_queue_slot (  ) 

Definition at line 99 of file its_mode2.c.

References ITS2_FLAG_DELETED, and uns8.

Referenced by its2_forward_routed_packet(), and its2_rebroadcast_net_discover_req().

Here is the caller graph for this function:

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 (  ) 
void its2_rebroadcast_net_addr_req (  ) 

Definition at line 800 of file its_mode2.c.

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 ( queued_item item  ) 

Definition at line 1102 of file its_mode2.c.

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_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 turn_off_mrf_interrupts (  ) 

!clear_bit(intcon, INT0IE);

Definition at line 82 of file its_mode2.c.

Referenced by its2_router_process(), and its2_router_queue_packet().

Here is the caller graph for this function:

void turn_on_mrf_interrupts (  ) 

!set_bit(intcon, INT0IE);

Definition at line 90 of file its_mode2.c.

Referenced by its2_router_process(), and its2_router_queue_packet().

Here is the caller graph for this function:

void wpan_data_received_callback ( wpan_address addr,
uns8 *  data,
uns8  data_size 
)
void wpan_data_transmitted_callback ( uns8  status,
uns8  retries,
uns8  channel_busy 
)

Once the lower layers have attempted to transmit the packet, the results will be presented to the callback.

Parameters:
status Set to 0 for success or 1 for failure
retries Set to the number of retries
channel_busy Set to 1 if failure was due to the channel being busy.

Definition at line 804 of file its_mode2.c.

References its2_transmitting.

Referenced by mrf24j40_transmit_callback().

Here is the caller graph for this function:


Variable Documentation

uns8 channel

Definition at line 71 of file its_mode2.c.

Definition at line 67 of file its_mode2.c.

bit debug_module = 0

Definition at line 64 of file its_mode2.c.

Referenced by its2_respond_local_addr().

Definition at line 73 of file its_mode2.c.

Referenced by its2_router_init().

seen_packet its2_seen_list[ITS2_SEEN_LIST_SIZE] [static]

Definition at line 75 of file its_mode2.c.

queued_item its2_tx_queue[ITS2_TX_QUEUE_SIZE] [static]

Definition at line 76 of file its_mode2.c.

Definition at line 65 of file its_mode2.c.

its2_state state = STATE_STARTUP

Definition at line 62 of file its_mode2.c.

Definition at line 69 of file its_mode2.c.

Referenced by its2_router_process().

uns16 tick_marker

Definition at line 68 of file its_mode2.c.


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