Skip to main content

RS232OnReceive

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

RS232OnReceive( dword port, byte buffer[], dword number );

Description

Callback handler for reception of data at a serial port. Note
  • Will be called only at the nodes which issued a RS232Receive operation for the given port.
  • The handler will only be called for success. For errors RS232OnError will be called.
  • The buffer may be much larger than number. For very slow connections, the handler may get called for few bytes. At least one byte is given.
  • It is possible to listen to one and the same port at several nodes. All nodes will be called with the same data.

Parameters

  • port: A number between 1 and 255 identifying a serial port.
  • buffer: The buffer given to the start receive call.
  • number: The number of bytes which have been received. Note
    • The number of received bytes will vary strongly with the speed of the connection.

Return Values

  • 0: error
    • The error occurs if no start receive operation has been.
  • 1: success

Example