Description

s_get_peers_DevName() – returns the device name of the communication partner
s_get_peers_ident_data() – returns the identification of the channel of our communication partner
toString() – returns a String that describes the details of the communication partner

Syntax

myExampleSerial.s_get_peers_DevName();
myExampleSerial.s_get_peers_ident_data();
myExampleSerial.toString();

Parameters

None

Returns

String – holding the requested information or “” if not available

Example Code

The following example send the request and prints the received ‘name’ and ‘ident’ of the CAN2SER interface of the peer.

void setup()
{  
  // Wait for the PC can2ser-monitor to send handshakes
  while(!Serial) {;}
  Serial.println("Request and print the name");
  Serial.println("and channel identifier of the CAN2SER peer");
  // Send out the request (in this case, to the PC)
  Serial.u8_request_peers_name_ident();
  // give the PC some time to answer
  delay(100); 
}
void loop () 
{
  Serial.print("Connected to: '"+ Serial.s_get_peers_DevName());
  Serial.println("' - channel identifier: '" + Serial.s_get_peers_ident_data() +"'");
  delay(2000);
  Serial.println("---- using toString() -----");
  Serial.println(Serial.toString());
  delay(2000);
}

Notes and Warnings

See also


CAN2SER Class
u8_set_ident_data()
u8_request_peers_name_ident()
BOOTLOADER SETTINGS – Library