BTPort Component
Properties Methods Events Configuration Settings Errors
The BTPort component facilitates Bluetooth communications by providing an easy interface to system Bluetooth functions.
Syntax
nsoftware.IPWorksBT.Btport
Remarks
The BTPort component provides a simple way to send and receive data over a Bluetooth socket. The first step is to establish a connection to a service. Connections are established by calling the Connect method.
Example (Connecting)
BTPort.Connect("20:C9:D0:94:3E:46", 10)
Alternatively, RemoteServiceClassId may be used instead of specifying a port. For instance:
btport1.RemoteHost = "20:C9:D0:94:3E:46"; btport1.RemoteServiceClassId = "00001101-0000-1000-8000-00805f9b34fb"; btport1.Connected = true;
The Bluetooth Universally Unique Identifier (UUID) is in the form
00000000-0000-1000-8000-00805F9B34FB
To send data either set DataToSend, or call the Send, SendLine, or SendFile methods.
Received data will be fired through the DataIn event.
Property List
The following is the full list of the properties of the component with short descriptions. Click on the links for further details.
AcceptData | Enables or disables data reception (the DataIn event). |
BytesSent | The number of bytes actually sent after an assignment to DataToSend . |
Connected | Triggers a connection or disconnection. |
DataToSend | A string of data to be sent to the remote host. |
EOL | Used to break the incoming data stream into chunks separated by EOL. |
LocalHost | The address of the Bluetooth device through which connections are initiated or accepted. |
LocalPort | The port in the Bluetooth device to which the component binds. |
Protocol | The Bluetooth protocol to be used. |
RemoteHost | The Bluetooth address of the remote device. |
RemotePort | The port on the remote Bluetooth device. |
RemoteServiceClassId | The class Id (UUID) of the remote service. |
SingleLineMode | Special mode for line-oriented protocols. |
Timeout | A timeout for the component. |
Method List
The following is the full list of the methods of the component with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting . |
Connect | Connects to a remote service. |
Disconnect | Disconnects from the remote host. |
DoEvents | Processes events from the internal message queue. |
GetLine | Gets a line of text from the server. |
Interrupt | Interrupts the current action. |
Send | Sends data to the remote host. |
SendFile | Sends file to the remote host. |
SendLine | Sends a string followed by a newline. |
SetReceiveStream | Sets the stream to which received data will be written. |
SetSendStream | Reads content from the stream and sends it to the server. |
Event List
The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.
Connected | Fired immediately after a connection completes (or fails). |
ConnectionStatus | Fired to indicate changes in connection state. |
DataIn | Fired when data (complete lines) comes in. |
Disconnected | Fired when a connection is closed. |
Error | Information about errors during data delivery. |
ReadyToSend | Fired when IPPort is ready to send data. |
Configuration Settings
The following is a list of configuration settings for the component with short descriptions. Click on the links for further details.
BTAuthenticate | Whether authentication is required. |
BTEncrypt | Forces an encrypted connection if set to True. |
BTMTUMax | The maximum RFCOMM MTU (Maximum Transmission Unit). |
BTMTU | The default RFCOMM MTU (Maximum Transmission Unit). |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
CodePage | The system code page used for Unicode to Multibyte translations. |