-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/docs/quickintro | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/docs/quickintro b/noncore/net/wellenreiter/libwellenreiter/docs/quickintro index a027a4e..97458b7 100644 --- a/noncore/net/wellenreiter/libwellenreiter/docs/quickintro +++ b/noncore/net/wellenreiter/libwellenreiter/docs/quickintro | |||
@@ -32,48 +32,57 @@ Included functions: | |||
32 | -- | 32 | -- |
33 | Protocol: | 33 | Protocol: |
34 | 34 | ||
35 | Send a found network to GUI: | 35 | Send a found network to GUI: |
36 | int send_network_found (const char *, int, void *); | 36 | int send_network_found (const char *, int, void *); |
37 | 37 | ||
38 | The first two arguments are the guihost and the guiport. | 38 | The first two arguments are the guihost and the guiport. |
39 | The third is the filled structure (wl_network_t), that will | 39 | The third is the filled structure (wl_network_t), that will |
40 | be send to the GUI. | 40 | be send to the GUI. |
41 | 41 | ||
42 | Setup structure for found network: | 42 | Setup structure for found network: |
43 | int get_network_found (void *, const char *); | 43 | int get_network_found (void *, const char *); |
44 | 44 | ||
45 | When the GUI receives a new network found packet it calls | 45 | When the GUI receives a new network found packet it calls |
46 | this function and passes a wl_network_t structure and the | 46 | this function and passes a wl_network_t structure and the |
47 | received buffer. The function will strip the data from | 47 | received buffer. The function will strip the data from |
48 | the buffer and set it to the structure. | 48 | the buffer and set it to the structure. |
49 | 49 | ||
50 | -- | 50 | -- |
51 | Log to syslog/info: | 51 | Log to syslog/info: |
52 | void wl_loginfo(const char *, ...); | 52 | void wl_loginfo(const char *, ...); |
53 | 53 | ||
54 | Log to syslog/err: | 54 | Log to syslog/err: |
55 | void wl_logerr(const char *, ...); | 55 | void wl_logerr(const char *, ...); |
56 | 56 | ||
57 | Use like printf() function with format strings and so on. | 57 | Use like printf() function with format strings and so on. |
58 | 58 | ||
59 | -- | 59 | -- |
60 | Setup udp socket for incoming commands: | 60 | Setup udp socket for incoming commands: |
61 | int commsock(const char *, int); | 61 | int commsock(const char *, int); |
62 | 62 | ||
63 | Fist argument is the host where it should listen and second | 63 | Fist argument is the host where it should listen and second |
64 | is the port. | 64 | is the port. Socket is returned, on failure -1 is returned. |
65 | 65 | ||
66 | Return values: | 66 | |
67 | Recvfrom socket: | ||
68 | int recv_commsock(int *, char *, int); | ||
69 | |||
70 | First argument is the address of the socket, second is a buffer | ||
71 | that should be filled in and the third is the maxlength of the | ||
72 | buffer. On error, -1 is returned, on success the number of | ||
73 | packet type is returned. (return value should be used with switch | ||
74 | command, for types see proto.hh) | ||
67 | 75 | ||
68 | Send command to udp socket: | 76 | Send command to udp socket: |
69 | int sendcomm(const char *, int, const char *, ...); | 77 | int sendcomm(const char *, int, const char *, ...); |
70 | 78 | ||
71 | First two arguments are the host and port where the command should | 79 | First two arguments are the host and port where the command should |
72 | be send to, followed by buffer that should be send. | 80 | be send to, followed by buffer that should be send. On error, -1 |
81 | is returned. | ||
73 | 82 | ||
74 | 83 | ||
75 | --- | 84 | --- |
76 | 85 | ||
77 | Thats it for the moment. | 86 | Thats it for the moment. |
78 | 87 | ||
79 | mjm. | 88 | mjm. |