Project

General

Profile

Revision 397

added error returns to some libwireless functions, handled in server.

View differences:

wireless.c
55 55

  
56 56
//Note: the actual frame sent has group as the first four bits and
57 57
//frame as the last four.
58
void wl_send_packet(char group, char type, char* data, int len,
59
					int dest, char options, char frame);
58
int wl_send_packet(char group, char type, char* data, int len, int dest, char options, char frame);
60 59

  
61 60
/*Data Members*/
62 61

  
......
261 260
 * @param len the packet length in bytes
262 261
 * @param frame the frame number to see with a TX_STATUS response
263 262
 **/
264
void wl_send_global_packet(char group, char type,
265
		char* data, int len, char frame)
263
int wl_send_global_packet(char group, char type, char* data, int len, char frame)
266 264
{
267
	wl_send_packet(group, type, data, len, XBEE_BROADCAST,
268
			XBEE_OPTIONS_BROADCAST_ALL_PANS, frame);
265
	return wl_send_packet(group, type, data, len, XBEE_BROADCAST, XBEE_OPTIONS_BROADCAST_ALL_PANS, frame);
269 266
}
270 267

  
271 268
/**
......
295 292
 * @param options the options for sending the packet
296 293
 * @param frame the frame number to see with a TX_STATUS response
297 294
 **/
298
void wl_send_packet(char group, char type, char* data, int len,
299
					int dest, char options, char frame)
295
int wl_send_packet(char group, char type, char* data, int len, int dest, char options, char frame)
300 296
{
301 297
	char buf[128];
302 298
	int i;
303 299
	if (frame != 0)
304 300
		frame = (frame & 0x0F) | ((group & 0x0F) << 4);
301

  
305 302
	buf[0] = group;
306 303
	buf[1] = type;
307 304
	for (i = 0; i < len; i++)
308 305
		buf[2 + i] = data[i];
309
	xbee_send_packet(buf, len + 2, dest, options, frame);
306

  
307
	return xbee_send_packet(buf, len + 2, dest, options, frame);
310 308
}
311 309

  
312 310
/**

Also available in: Unified diff