Description
set_handshake() – switches handshake of the instance on or off. If switched ‘on’ then this CAN2SER instance starts sending handshaking messages to the communication partner. The handshake can also be configured with the help of the class constructor.
Syntax
myExampleSerial.set_handshake( b_OnOff );
Parameters
bool b_OnOff– true or false – starting / stoping the handshaking
Returns
nothing
Example Code
The following example swtiches the handshaking of the CAN2SER instance ‘Serial
‘ on and off.
void setup()
{
// Wait for the PC can2ser-monitor to send handshakes
while(!Serial) {;}
Serial.println("Welcome to the handshake example");
}
void loop ()
{
Serial.println("Handshaking OFF");
delay(2000);
Serial.println("Handshaking ON");
Serial.set_handshake(true);
delay(2000);
Serial.set_handshake(false);
}
This can be seen in the CAN2SER monitor at the right bottom corner :
