pic_packet.h File Reference

#include "pic_utils.h"
#include "pic_serial.h"
#include "pic_tick.h"
#include "config.h"
#include <memory.h>
#include "pic_rf_2401a.h"

Include dependency graph for pic_packet.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  _rf_packet
struct  _rf_packet_det
struct  _seen_packet
struct  _sending_item

Defines

#define PKT_CONFIG_ADDR   0xfffe
#define PKT_FLAG_DELETED   0xff
#define PKT_FLAG_NO_RESEND   0
#define PKT_FLAG_RESEND   1
#define PKT_PACKET_SIZE   21
#define PKT_STATUS_CHECK_FAIL   12
#define PKT_STATUS_DIRECT_SEND   6
#define PKT_STATUS_I_AM_SENDER   2
#define PKT_STATUS_NEED_TO_REBROADCAST   9
#define PKT_STATUS_PKT_IS_ACK_FOR_ME   4
#define PKT_STATUS_PKT_IS_FACK_FOR_ME   5
#define PKT_STATUS_PKT_IS_FOR_ME   3
#define PKT_STATUS_PREVIOUS_ROUTED_VIA_ME   7
#define PKT_STATUS_QUEUED   10
#define PKT_STATUS_ROUTING_FULL   8
#define PKT_STATUS_SEEN_BEFORE   1
#define PKT_STATUS_TX_QUEUE_FULL   11
#define RF_RX_BUFFER_SIZE   PKT_PACKET_SIZE
#define RF_TX_BUFFER_SIZE   PKT_PACKET_SIZE + 1

Typedefs

typedef union _rf_packet rf_packet
typedef struct _rf_packet_det rf_packet_det
typedef struct _seen_packet seen_packet
typedef struct _sending_item sending_item

Functions

void pkt_calc_check_byte (rf_packet *packet)
uns8 pkt_check_check_byte (rf_packet *packet)
void pkt_init (uns16 my_addr)
uns8 pkt_load_rx (rf_packet *pkt)
uns8 pkt_print_packet (rf_packet *my_packet)
void pkt_process_payload (uns16 source_addr, uns16 pkt_id, uns8 *payload)
void pkt_process_tx_queue ()
uns8 pkt_queue_packet (rf_packet *packet, uns8 resend)
uns8 pkt_rx_avail ()
uns8 pkt_send (uns16 dest_addr, uns8 *payload, uns8 resend)
void pkt_send_packet (rf_packet *packet)


Define Documentation

#define PKT_CONFIG_ADDR   0xfffe

Definition at line 66 of file pic_packet.h.

#define PKT_FLAG_DELETED   0xff

Definition at line 63 of file pic_packet.h.

Referenced by pkt_init(), pkt_load_rx(), pkt_process_tx_queue(), and pkt_queue_packet().

#define PKT_FLAG_NO_RESEND   0

Definition at line 61 of file pic_packet.h.

Referenced by pkt_load_rx(), and pkt_process_tx_queue().

#define PKT_FLAG_RESEND   1

Definition at line 62 of file pic_packet.h.

#define PKT_PACKET_SIZE   21

#define PKT_STATUS_CHECK_FAIL   12

Definition at line 57 of file pic_packet.h.

Referenced by pkt_load_rx().

#define PKT_STATUS_DIRECT_SEND   6

Definition at line 51 of file pic_packet.h.

Referenced by pkt_load_rx().

#define PKT_STATUS_I_AM_SENDER   2

Definition at line 47 of file pic_packet.h.

Referenced by pkt_load_rx().

#define PKT_STATUS_NEED_TO_REBROADCAST   9

Definition at line 54 of file pic_packet.h.

Referenced by pkt_load_rx().

#define PKT_STATUS_PKT_IS_ACK_FOR_ME   4

Definition at line 49 of file pic_packet.h.

Referenced by pkt_load_rx().

#define PKT_STATUS_PKT_IS_FACK_FOR_ME   5

Definition at line 50 of file pic_packet.h.

Referenced by pkt_load_rx().

#define PKT_STATUS_PKT_IS_FOR_ME   3

Definition at line 48 of file pic_packet.h.

Referenced by pkt_load_rx().

#define PKT_STATUS_PREVIOUS_ROUTED_VIA_ME   7

Definition at line 52 of file pic_packet.h.

Referenced by pkt_load_rx().

#define PKT_STATUS_QUEUED   10

Definition at line 55 of file pic_packet.h.

Referenced by pkt_queue_packet().

#define PKT_STATUS_ROUTING_FULL   8

Definition at line 53 of file pic_packet.h.

Referenced by pkt_load_rx().

#define PKT_STATUS_SEEN_BEFORE   1

Definition at line 46 of file pic_packet.h.

Referenced by pkt_load_rx().

#define PKT_STATUS_TX_QUEUE_FULL   11

Definition at line 56 of file pic_packet.h.

Referenced by pkt_queue_packet().

#define RF_RX_BUFFER_SIZE   PKT_PACKET_SIZE

Definition at line 70 of file pic_packet.h.

#define RF_TX_BUFFER_SIZE   PKT_PACKET_SIZE + 1

Definition at line 72 of file pic_packet.h.


Typedef Documentation

typedef union _rf_packet rf_packet

Definition at line 93 of file pic_packet.h.

typedef struct _rf_packet_det rf_packet_det

Definition at line 86 of file pic_packet.h.

typedef struct _seen_packet seen_packet

Definition at line 112 of file pic_packet.h.

typedef struct _sending_item sending_item

Definition at line 105 of file pic_packet.h.


Function Documentation

void pkt_calc_check_byte ( rf_packet packet  ) 

Definition at line 310 of file pic_packet.c.

References _rf_packet::a, _rf_packet_det::check_byte, _rf_packet::d, PKT_PACKET_SIZE, and uns8.

Referenced by pkt_load_rx(), and pkt_send().

Here is the caller graph for this function:

uns8 pkt_check_check_byte ( rf_packet packet  ) 

Definition at line 321 of file pic_packet.c.

References _rf_packet::a, _rf_packet_det::check_byte, _rf_packet::d, PKT_PACKET_SIZE, and uns8.

Referenced by pkt_load_rx().

Here is the caller graph for this function:

void pkt_init ( uns16  my_addr  ) 

uns8 pkt_load_rx ( rf_packet pkt  ) 

uns8 pkt_print_packet ( rf_packet my_packet  ) 

void pkt_process_payload ( uns16  source_addr,
uns16  pkt_id,
uns8 *  payload 
)

Referenced by pkt_load_rx().

Here is the caller graph for this function:

void pkt_process_tx_queue (  ) 

uns8 pkt_queue_packet ( rf_packet packet,
uns8  resend 
)

Definition at line 168 of file pic_packet.c.

References _sending_item::flag, PKT_FLAG_DELETED, PKT_PACKET_SIZE, PKT_STATUS_QUEUED, PKT_STATUS_TX_QUEUE_FULL, _sending_item::sent_count, serial_print_int(), serial_print_str(), and uns8.

Referenced by pkt_load_rx(), and pkt_send().

Here is the call graph for this function:

Here is the caller graph for this function:

uns8 pkt_rx_avail (  ) 

uns8 pkt_send ( uns16  dest_addr,
uns8 *  payload,
uns8  resend 
)

void pkt_send_packet ( rf_packet packet  )  [inline]

Definition at line 151 of file pic_packet.h.

References _rf_packet::a, pic_rf_transmit(), PKT_PACKET_SIZE, pkt_print_packet(), serial_print_str(), tx_buffer, and uns8.

Referenced by pkt_process_tx_queue().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Mon Apr 28 08:15:48 2008 for Pic Pack by  doxygen 1.5.5