wpan.c File Reference

Wireless Personal Area Network routines. More...

#include "wpan.h"
#include "pic_utils.h"
#include "pic_serial.h"
#include "debug.h"
Include dependency graph for wpan.c:

Go to the source code of this file.

Defines

#define debug_on

Functions

void mrf24j40_receive_callback ()
 Callback is actioned when mrf24j40 has a packet received off air.
void mrf24j40_transmit_callback (uns8 status, uns8 retries, uns8 channel_busy)
 Callback is actioned when mrf24j40 has finished transmitting a packet, or failed to do so.
void wpan_handle_receive ()
 Handle reception of packet.
void wpan_init ()
 Initialise this and lower layers ready for use.
void wpan_print_address (wpan_address *addr)
 Print the address of the packet.
void wpan_print_frame_type (uns8 frame_type)
 Print information about the WPAN frame type.
void wpan_print_mac_command (uns8 *data)
 Debug routine that prints out the mac command type.
void wpan_process ()
 Process WPAN layer.
void wpan_setup_io ()
 Setup IO as requred.

Variables

uns8 pkt_received = 0
uns8 receive_lost = 0
uns8 wpan_rx_buffer [50]
uns8 wpan_rx_count

Detailed Description

Definition in file wpan.c.


Define Documentation

#define debug_on

Definition at line 40 of file wpan.c.


Function Documentation

void mrf24j40_receive_callback (  ) 

Callback indicating the mrf24j40 has a packet ready.

Definition at line 56 of file wpan.c.

References debug_int, debug_str, mrf24j40_flush_receive_buffer(), mrf24j40_receive(), pkt_received, receive_lost, serial_putc(), wpan_rx_buffer, and wpan_rx_count.

Referenced by mrf24j40_handle_isr().

Here is the call graph for this function:

Here is the caller graph for this function:

void mrf24j40_transmit_callback ( uns8  status,
uns8  retries,
uns8  channel_busy 
)

Callback indicating the mrf24j40 has finished the transmission sequence.

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 75 of file wpan.c.

References debug_int, debug_str, and wpan_data_transmitted_callback().

Referenced by mrf24j40_handle_isr().

Here is the call graph for this function:

Here is the caller graph for this function:

void wpan_handle_receive (  ) 
void wpan_init (  ) 

Initialise underlying hardware (typically mrf24j40)

Definition at line 336 of file wpan.c.

References mrf24j40_init().

Referenced by its1_controller_init(), its1_device_init(), its2_device_init(), and its_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void wpan_print_address ( wpan_address addr  ) 
void wpan_print_frame_type ( uns8  frame_type  ) 

Definition at line 148 of file wpan.c.

References FRAME_TYPE_ACK, FRAME_TYPE_BEACON, FRAME_TYPE_DATA, FRAME_TYPE_MAC_COMMAND, and serial_print_str().

Referenced by wpan_data_received_callback().

Here is the call graph for this function:

Here is the caller graph for this function:

void wpan_print_mac_command ( uns8 *  data  ) 

Print the MAC layer command details

Definition at line 166 of file wpan.c.

References MAC_CMD_ASSOC_REQ, MAC_CMD_ASSOC_RES, MAC_CMD_BEACON_REQ, MAC_CMD_COORD_REALIGN, MAC_CMD_DATA_REQ, MAC_CMD_DISASSOC, MAC_CMD_GTS_REQ, MAC_CMD_ORPHAN, MAC_CMD_PAN_ID_CONFLICT, serial_print_int_hex(), serial_print_str(), serial_putc(), and uns8.

Here is the call graph for this function:

void wpan_process (  ) 

Call wpan_process() regularly to handle events at the WPAN layer. Typically this includes handling any received packets, processing them, and handing up to a higher layer.

Definition at line 214 of file wpan.c.

References pkt_received, and wpan_handle_receive().

Here is the call graph for this function:

void wpan_setup_io (  ) 

Set up ports and pins for WPAN use

Definition at line 332 of file wpan.c.

References mrf24j40_setup_io().

Referenced by its1_setup_io(), and its2_setup_io().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

uns8 pkt_received = 0

Definition at line 53 of file wpan.c.

Referenced by mrf24j40_receive_callback(), wpan_handle_receive(), and wpan_process().

uns8 receive_lost = 0

Definition at line 51 of file wpan.c.

Referenced by mrf24j40_receive_callback().

uns8 wpan_rx_buffer[50]

Definition at line 49 of file wpan.c.

Referenced by mrf24j40_receive_callback(), and wpan_handle_receive().

Definition at line 50 of file wpan.c.

Referenced by mrf24j40_receive_callback(), and wpan_handle_receive().


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