This function gets the connection status of the specified COM port.

Syntax

int GetConnectionStatus(
  const unsigned int com_port
);

Parameters

com_port
[in] Specify the COM port number for which you want to get the connection status.
ValueDescription
COM3 Bluetooth SPP (Master)
COM4 Bluetooth HID (Slave)
COM5 Bluetooth SPP (Slave)
It does not support the acquisition of other COM port settings.

Return value

Returns the connection status of the specified COM port.
ValueDescription
COM_STATE_CLOSE The specified port is closed.
COM_STATE_CONNECT The specified port is connecting.
COM_STATE_DISCONNECT The specified port is being disconnected.
COM_STATE_WAIT_ACCEPT The specified port is waiting for a connection.
COM_STATE_ACCEPTED The specified port has connection permission.
ERROR The specified port is invalid.

Remarks

Gets the connection status of the specified serial port.

Requirements

Header file:
lib.h
Library file:
libSTARTUPOPH5000.a

Last updated: 2020/10/07