Skip to content

Commit 088d4a1

Browse files
committed
Updated send information
1 parent d7160d4 commit 088d4a1

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

docs/README.md

+24-4
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,23 @@ Send a packet
7878
-------------
7979

8080
```C++
81-
ICSC::send(destination, commandID, length, data);
81+
ICSC::send(unsigned char station, char command, unsigned char len=0, char *data=NULL);
82+
ICSC::send(unsigned char station, char command, char *str);
83+
ICSC::send(unsigned char station, char command, long data);
84+
ICSC::send(unsigned char station, char command, int data);
85+
ICSC::send(unsigned char station, char command, char data);
86+
8287
```
8388
84-
Send a packet to a remote station. The commandID should match a command registered in the remote station. Length is the number of bytes of data to include in the packet. Data is a pointer to the data to send (should be cast to a char * if it isn't already).
89+
Send a packet to a remote station. The commandID should match a command registered in the remote station.
90+
91+
The different overloaded methods provide, in turn:
92+
93+
* Sending of a raw data packet of length `len`.
94+
* Sending a NULL-terminated C string.
95+
* Sending a `long` value (32 bits).
96+
* Sending an `int` value (**Caution: the size of this depends on the architecture. It may be 16 or 32 bits.**).
97+
* Sending a single char value (8 bit signed value).
8598
8699
Example:
87100
@@ -93,10 +106,17 @@ Send a broadcast
93106
----------------
94107

95108
```C++
96-
ICSC::broadcast(command, length, data);
109+
ICSC::broadcast(char command, unsigned char len=0, char *data=NULL);
110+
ICSC::broadcast(char command, char *str);
111+
ICSC::broadcast(char command, long data);
112+
ICSC::broadcast(char command, int data);
113+
ICSC::broadcast(char command, char data);
97114
```
98115
99-
Send a packet to all stations. The default address for broadcasting is 0 (can be edited in the ICSC.h file). Apart from that broadcast() works like send().
116+
This is the same as the `send` method above, except the data is sent to all
117+
stations on the network. Care should be taken to ensure that the destination
118+
stations do not respond to a broadcast message since that would cause collisions
119+
on the network.
100120
101121
Example:
102122

0 commit comments

Comments
 (0)