Menu

SerialDriver Connection functions

Thierry CHOMAUD

Connection functions

After having made the configuration of the serial driver instance, it could be open or close:

  • open method to open the connection
  • close method to close the opened connection
  • isOpen to get the open status of a serial driver instance

C source API extract

/**

 * Open the SerialDriver connection with the serial port id,
 * and configure the serial port parameters
 * @param driver The SerialDriver instance to open
 * @return the open status (serial_driver_status)
 *         OK_PROTOCOL_SUCCESS if opening succeed
 *         KO_SERIALPORTID_NOT_EXIST if id does not exist from the OS point of view
 *         KO_SERIALPORT_NOT_AVAILABLE if port is not available (already in use, broken down, etc.)
 *         KO_PARAM_XXXX_NOT_VALID if parameters configuration fails
 */
WAVENIS_API int driver_open( const void* driver );

/**

 * Close the SerialDriver connection,
 * @param driver The SerialDriver instance to close
 * @return the close status (serial_driver_status)
 *         OK_SERIALDRIVER_SUCCESS if closing succeed
 *         KO_SERIALPORT_UNEXPECTED_ERROR if error occurs during closing process
 */
WAVENIS_API int driver_close( const void* driver );

/**

 * Test if the SerialDriver connection is open are not
 * @param driver The SerialDriver instance
 * @return <code>1</code> if the serial driver is connected, <code>0</code> otherwise
 */
WAVENIS_API int driver_is_open( const void* driver );

Java source API extract

/**

 * Open the SerialDriver connection with the serial port id,
 * and configure the serial port parameters
 * @throws SerialDriverException if error occurs during opening process
 *         SERIALPORTID_NOT_EXIST if id does not exist from the OS point of view
 *         SERIALPORT_NOT_AVAILABLE if port is not available (already in use, broken down, etc.)
 *         PARAM_XXXX_NOT_VALID if parameters configuration fails
 */
public void open() throws SerialDriverException;

/**

 * Close the SerialDriver connection
 * @throws SerialDriverException.SERIALPORT_UNEXPECTED_ERROR if error occurs during closing process
 */
public void close() throws SerialDriverException;

/**

 * Test if the SerialDriver connection is open are not
 * @return <code>true</code> if the SerialDriver instance is connected, <code>false</code> otherwise
 */
public boolean isOpen();

Related

Wiki: APIs

MongoDB Logo MongoDB