Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This structure is used when creating a virtual COM port.

Syntax

typedef struct _portemu_port_params {
  int 
channel;
  int 
flocal;
  BT_ADDR 
device;
  int 
imtu;
  int 
iminmtu;
  int 
imaxmtu;
  int 
isendquota;
  int 
irecvquota;
  GUID 
uuidService;
  unsigned int 
uiportflags;
} PORTEMUPortParams;

Members

channel

Set to either an explicit server channel, or, for a server application that wants the server channel to be autobound, to RFCOMM_CHANNEL_MULTIPLE. Call the IOCTL, IOCTL_BLUETOOTH_GET_RFCOMM_CHANNELto determine which channel was assigned.

flocal

Set to TRUE for a server port that accepts connections, or to FALSE for a client port that is used to creating outgoing connections.

device

The BT_ADDRof a target device on a client port. BT_ADDRis defined in Ws2bth.h:

Copy Code
typedef ULONGLONG bt_addr, *pbt_addr, BT_ADDR, *PBT_ADDR;
imtu

The suggested number for the maximum transmission unit (MTU) for a packet in negotiations on connect, iminmtuand imaxmtudefine acceptable range of negotiation (if all 3 are 0, default will be used).

iminmtu

Defines an acceptable range of negotiation.

imaxmtu

Defines an acceptable range of negotiation.

isendquota

Queue size on send. The WriteFileoperation will block if isendquotais exceeded. If set to 0, the default setting is used.

irecvquota

Queue size on receive. Flow control is used to prevent receiving more data than irecvquota. Incoming data is discarded if it exceeds this limit. If set to 0, the default setting is used.

uuidService

Specifies the UUID for the target RFCOMM service. If channel == 0 for the client port, an SDP query is performed to determine the target channel id before the connection is made.

uiportflags

Can be a combination of the following flags.

Flag Hex code

RFCOMM_PORT_FLAGS_REMOTE_DCB

0x00000001

RFCOMM_PORT_FLAGS_KEEP_DCD

0x00000002

RFCOMM_PORT_FLAGS_AUTHENTICATE

0x00000004

RFCOMM_PORT_FLAGS_ENCRYPT

0x00000008

Remarks

If RFCOMM_PORT_FLAGS_AUTHENTICATE and/or RFCOMM_PORT_FLAGS_ENCRYPT is set, authentication is performed and/or encryption is toggled at connection establishment.

If RFCOMM_PORT_FLAGS_REMOTE_DCB is set, the Getor SetCommStatefunctions initiate RFCOMM "remote port negotiation" (RPN) command, otherwise a local copy of DCB is being operated on.

If RFCOMM_PORT_FLAGS_KEEP_DCD, the data carrier detect flag is raised on connection and kept up throughout. In NULL-modem cable, DCD is paired with DSR signal and is always on.

The direct connection UNIMODEM function uses DCD to detect cable unplugging. If a peer does not keep this bit on throughout the connection, this flag may be used to have port emulation layer simulate the bit being on.

Requirements

Header bt_api.h
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Other Resources