Project

General

Profile

Revision 1581

editing wireless branch, added error codes and constants

View differences:

wireless_send.c
51 51
 * @param data pointer to the byte array of data to be included in the packet
52 52
 * @param length the length of the data array
53 53
 * @param group the packet group of the packet
54
 * @param scope flag for sending global packet, to your current PAN, or to a specific robot
54
 * @param scope flag for sending global packet or your current PAN
55 55
 * @param dest robot ID (for robot to robot packet)
56
 * @param mode flag for using TCP or UDP
56
 * @param mode flag for using FAST or RELIABLE sending
57 57
 *
58
 * @return 0 for OK, or error code (TBD)
58
 * @return positive packet number for tracking acks, or error code (TBD)
59 59
 **/
60
int8_t wl_send(char *data, uint8_t length, uint8_t group, uint8_t scope, uint8_t dest, uint8_t mode) {
60
int16_t wl_send(char *data, uint8_t length, uint8_t group, uint8_t scope, uint16_t dest, uint8_t mode) {
61 61

  
62 62
  return 0;
63 63
}
......
69 69
 * @param length the length of the data array
70 70
 * @param group the packet group of the packet
71 71
 *
72
 * @return 0 for OK, or error code (TBD)
72
 * @return positive packet number for tracking acks, or error code (TBD)
73 73
 **/
74
int8_t wl_send_global(char *data, uint8_t length, uint8_t group) {
74
int16_t wl_send_global(char *data, uint8_t length, uint8_t group) {
75 75

  
76 76
  return 0;
77 77
}
......
83 83
 * @param length the length of the data array
84 84
 * @param group the packet group of the packet
85 85
 *
86
 * @return 0 for OK, or error code (TBD)
86
 * @return positive packet number for tracking acks, or error code (TBD)
87 87
 **/
88
int8_t wl_send_pan(char *data, uint8_t length, uint8_t group) {
88
int16_t wl_send_pan(char *data, uint8_t length, uint8_t group) {
89 89

  
90 90
  return 0;
91 91
}
......
97 97
 * @param length the length of the data array
98 98
 * @param group the packet group of the packet 
99 99
 * @param dest robot ID (for robot to robot packet)
100
 * @param mode flag for using TCP or UDP
100
 * @param mode flag for using FAST or RELIABLE sending
101 101
 *
102
 * @return 0 for OK, or error code (TBD)
102
 * @return positive packet number for tracking acks, or error code (TBD)
103 103
 **/
104
int8_t wl_send_robot(char *data, uint8_t length, uint8_t group, uint8_t dest, uint8_t mode) {
104
int16_t wl_send_robot(char *data, uint8_t length, uint8_t group, uint16_t dest, uint8_t mode) {
105 105

  
106 106
  return 0;
107 107
}
......
112 112
 * @param data pointer to the byte array of data to be included in the packet
113 113
 * @param length the length of the data array
114 114
 *
115
 * @return 0 for OK, or error code (TBD)
115
 * @return positive packet number for tracking acks, or error code (TBD)
116 116
 **/
117
int8_t wl_send_basic(char *data, uint8_t length) {
117
int16_t wl_send_basic(char *data, uint8_t length) {
118 118

  
119 119
  return 0;
120 120
}
......
122 122

  
123 123
/**
124 124
 * acknowledgment error
125
 * you call this function periodically to check if any of the packets you have sent have been lost
125
 * check if any of the packets you have sent have been lost.
126 126
 *
127
 * note that all other error checking will be handled by library, so your user behavior won't have to worry about it
127
 * note that all other error checking will be handled by library, 
128
 * so your user behavior won't have to worry about it
128 129
 *
129
 * @return an error code (or maybe the # of packets you have lost)
130
 * @return the # of packets lost (up to 255)
130 131
 **/
131 132
int8_t wl_ack_error(void) {
132 133

  
133 134
  return 0;
134 135
}
135 136

  
137
/**
138
 * acknowledgement error check
139
 * check if a specific packet has been lost
140
 * note: buffer will overflow ever 255 packets
141
 * 
142
 * @param packet number
143
 *
144
 * @return 0=still sending,1=ack received,-1=ack failure
145
 **/
146
int8_t wl_ack_check(uint8_t packet) {
136 147

  
148
	return 0;
149
}
150

  
151
/**
152
 * acknowledgement reset
153
 * reset the acknowledgement buffer
154
 **/
155
void wl_ack_reset(void) {
156

  
157
}
158

  
159

  
137 160
/**@} **/ //end defgroup
138 161

  
139 162

  

Also available in: Unified diff