Project

General

Profile

Revision 726

Added by Greg Tress about 16 years ago

Working on bayboard wireless

View differences:

wireless.h
1 1
/**
2 2
 * Copyright (c) 2007 Colony Project
3
 * 
3
 *
4 4
 * Permission is hereby granted, free of charge, to any person
5 5
 * obtaining a copy of this software and associated documentation
6 6
 * files (the "Software"), to deal in the Software without
......
9 9
 * copies of the Software, and to permit persons to whom the
10 10
 * Software is furnished to do so, subject to the following
11 11
 * conditions:
12
 * 
12
 *
13 13
 * The above copyright notice and this permission notice shall be
14 14
 * included in all copies or substantial portions of the Software.
15
 * 
15
 *
16 16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 17
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18 18
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
......
34 34

  
35 35
#ifndef WIRELESS_H
36 36
#define WIRELESS_H
37
 
37

  
38 38
//Note: If this is raised above 16, we will need to do
39 39
//something about frame numbers for TX Status packets.
40 40
/**
41 41
 * The maximum number of packet groups.
42 42
 **/
43
#define WL_MAX_PACKET_GROUPS 16
43
#define WL_MAX_PACKET_GROUPS 4
44 44

  
45 45
/**
46 46
 * @defgroup wireless Wireless
......
48 48
 *
49 49
 * Contains functions and definitions for dealing with wireless functionality.<br><br>
50 50
 *
51
 * The wireless library provides a modular method for dealing with 
51
 * The wireless library provides a modular method for dealing with
52 52
 * wireless packets, by allowing packet groups to be registered.
53 53
 * A packet group is a collection of packets which share a packet
54
 * group code. Each packet in the group also has a type. A packet 
54
 * group code. Each packet in the group also has a type. A packet
55 55
 * group code and type are sent with each packet. When a packet
56
 * with a group code registered in the wireless library is 
56
 * with a group code registered in the wireless library is
57 57
 * received, the corresponding event handler is called. The
58 58
 * event handler uses the packet type and other information
59 59
 * stored in the packet to respond.<br><br>
......
67 67

  
68 68
/**
69 69
 * @struct PacketGroupHandler
70
 * A PacketGroupHandler represents a packet group, and is used to 
70
 * A PacketGroupHandler represents a packet group, and is used to
71 71
 * register a packet group with the wireless library. It contains
72 72
 * handlers for various events which can occur related to a packet
73 73
 * group.
......
75 75
typedef struct
76 76
{
77 77
	/**
78
	 * The group code for this packet group. This number
79
	 * must be unique. The maximum number of packet groups
80
	 * is defined by WL_MAX_PACKET_GROUPS.
81
	 **/
82
	unsigned int groupCode;
83

  
84
	/**
85 78
	 * Called every half second (not in interrupt,
86 79
	 * but in wl_do).
87 80
	 **/
88 81
	void (*timeout_handler) (void);
89
	
82

  
90 83
	/**
91 84
	 * Called when a transmit status packet is received
92 85
	 * from the XBee where the first four bits of the frame
......
97 90
	 * we did not.
98 91
	 **/
99 92
	void (*handle_response) (int frame, int received);
100
	
93

  
101 94
	/**
102 95
	 * Called when we receive a packet from this group.
103 96
	 *
......
114 107
	 **/
115 108
	void (*unregister) (void);
116 109

  
110
	/**
111
	 * The group code for this packet group. This number
112
	 * must be unique. The maximum number of packet groups
113
	 * is defined by WL_MAX_PACKET_GROUPS.
114
	 **/
115
	unsigned int groupCode;
116

  
117 117
} PacketGroupHandler;
118 118

  
119 119
/**@brief Initialize the wireless library **/

Also available in: Unified diff