You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initialize the serial port and internal structures. stationId is the ID of the local station. Set the baud rate to be the same on all stations. &SerialPort is a pointer to a HardwareSerial device, such as &Serial1. If not specified, defaults to &Serial. DEPin is the pin to use to control the RE#/DE pins of an RS-485 transceiver chip if needed. If not specified RE#/DE operation is disabled.
23
+
The `Stream` is the device you wish to communicate over. `station` is the number (or single letter code) of this station, and `depin` is, if provided, the DE/RE pin pair of a MAX485 chip or similar.
@@ -55,52 +59,52 @@ Unregister a reception command
55
59
------------------------------
56
60
57
61
```C++
58
-
ICSC.unregisterCommand(commandID);
62
+
ICSC::unregisterCommand(commandID);
59
63
```
60
64
61
65
Remove a registered callback command from the list of recognized commands at this station.
62
66
63
67
Example:
64
68
65
69
```C++
66
-
ICSC.unregisterCommand('T');
70
+
icsc.unregisterCommand('T');
67
71
```
68
72
69
73
Send a packet
70
74
-------------
71
75
72
76
```C++
73
-
ICSC.send(destination, commandID, length, data);
77
+
ICSC::send(destination, commandID, length, data);
74
78
```
75
79
76
80
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).
77
81
78
82
Example:
79
83
80
84
```C++
81
-
ICSC.send(6, 'T', 5, (char *)&myData);
85
+
icsc.send(6, 'T', 5, (char *)&myData);
82
86
```
83
87
84
88
Send a broadcast
85
89
----------------
86
90
87
91
```C++
88
-
ICSC.broadcast(command, length, data);
92
+
ICSC::broadcast(command, length, data);
89
93
```
90
94
91
95
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().
92
96
93
97
Example:
94
98
95
99
```C++
96
-
ICSC.broadcast('T', 1, (char *)&myData);
100
+
icsc.broadcast('T', 1, (char *)&myData);
97
101
```
98
102
99
103
Performing reception
100
104
--------------------
101
105
102
106
```C++
103
-
ICSC.process();
107
+
ICSC::process();
104
108
```
105
109
106
110
This function should be called during any long loops, and on every pass of the main loop() function.
0 commit comments