Project

General

Profile

Revision 1425

Added by Chris Mar over 14 years ago

updated wireless basic library code and docs

View differences:

wl_basic.h
23 23

  
24 24
#include <wireless.h>
25 25

  
26
/** @brief default wireless group for basic sending and receiving packets **/
26 27
#define WL_BASIC_GROUP 8
27 28

  
28
/** @brief init wireless for Basic Group **/
29
int wl_basic_init( void (*handle_receive) (char type, int source, unsigned char* packet, int length) );
30
/** @brief init wireless for Basic Group with default packet handling **/
31
int wl_basic_init_default( void );
32
/** @brief internal function to register a packet handler function **/
33
void wl_basic_register_handler( void (*handle_receive) (char type, int source, unsigned char* packet, int length) );
34
/** @brief send a packet to a single robot in Basic Group **/
35
void wl_basic_send_robot_packet( char type, char* data, int len, int dest );
36
/** @brief send a packet to all robots in Basic Group **/
37
void wl_basic_send_global_packet( char type, char* data, int len );
38
/** @brief default packet handler if none is specified on init **/
39
void wl_basic_packet_receive_handler( char type, int source, unsigned char* packet, int length );
40
/** @brief wrapper for wl_do() to return packet data buffer **/
41
unsigned char* wl_basic_do( void );
42

  
43 29
/** @brief PacketGroupHandler struct for Basic Group **/
44 30
PacketGroupHandler wl_basic_group_handler;
45 31

  
32
/**
33
 * @brief struct that contains relevant packet information
34
 **/
46 35
struct PacketInfo {
47 36
    char new_flag;
48 37
    char type;
49 38
    int source;
50
    unsigned char* pointer;
39
    unsigned char* data;
51 40
    int length;
52 41
};
53 42

  
......
56 45
 **/
57 46
struct PacketInfo current_packet;
58 47

  
48
/** @brief init wireless for Basic Group **/
49
int wl_basic_init( void (*handle_receive) (char type, int source, unsigned char* packet, int length) );
50
/** @brief init wireless for Basic Group with default packet handling **/
51
int wl_basic_init_default( void );
52
/** @brief internal function to register a packet handler function **/
53
void wl_basic_register_handler( void (*handle_receive) (char type, int source, unsigned char* packet, int length) );
54
/** @brief send a packet to a single robot in Basic Group **/
55
void wl_basic_send_robot_packet( char type, char* data, int len, int dest );
56
/** @brief send a packet to all robots in Basic Group **/
57
void wl_basic_send_global_packet( char type, char* data, int len );
58
/** @brief internal default packet handler if none is specified on init **/
59
void wl_basic_packet_receive_handler( char type, int source, unsigned char* packet, int length );
60
/** @brief wrapper for wl_do() to return packet data buffer **/
61
unsigned char* wl_basic_do_default( void );
59 62
/** @} **/ // end defgroup
60 63

  
61 64
#endif

Also available in: Unified diff