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. |
SSLAcceptServerCert | Instructs the component to unconditionally accept the server certificate that matches the supplied certificate. |
SSLCert | The certificate to be used during SSL negotiation. |
SSLEnabled | Whether TLS/SSL is enabled. |
SSLServerCert | The server certificate for the last established connection. |
SSLStartMode | Determines how the component starts the SSL negotiation. |
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. |
StartSSL | starts SSL negotiation on a plaintext connection. |
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 the component is ready to send data. |
SSLServerAuthentication | Fired after the server presents its certificate to the client. |
SSLStatus | Shows the progress of the secure connection. |
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. |
BTMTU | The default RFCOMM MTU (Maximum Transmission Unit). |
BTMTUMax | The maximum RFCOMM MTU (Maximum Transmission Unit). |
CloseStreamAfterTransfer | If true, the component will close the upload or download stream after the transfer. |
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. |
BuildInfo | Information about the product's build. |
GUIAvailable | Tells the component whether or not a message loop is available for processing events. |
LicenseInfo | Information about the current license. |
UseInternalSecurityAPI | Tells the component whether or not to use the system security libraries or an internal implementation. |