Update of "rfcomm command"
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: 87fd543eae408b6d6be4522f4d45fb1cb46c6379
Page Name:rfcomm command
Date: 2017-01-15 12:01:30
Original User: chw
Parent: 963259e4b6baf9f058699073ce6b26667aceaf33 (diff)
Next aba82129089db95c3dc3210846c0b1282f13f96a
Content

Name

rfcomm - transfer data over Bluetooth serial port profile; akin to the Tcl socket command.

Synopsis

package require Rfcomm
rfcomm ?-myaddr addr? ?-myport myport? ?-async? host port
rfcomm -server command ?-myaddr addr? port

Description

This command is used to obtain a channel which is able to transfer data over Bluetooth's serial port profile (SPP or SP). The arguments are nearly identical to the Tcl socket command. It returns a client or server channel handle. Client channels may be used with gets, read, puts, fconfigure, and close. Server channels return a new client channel in the command callback when a incoming connection was established.

For client channels (first command form), the host parameter must be given as a one- or two-element list: the first element is the Bluetooth address of the remote device, and the (optional) second element is the UUID of the remote service. If omitted the standard Bluetooth UUID for the Serial Port Profile 00001101-0000-1000-8000-00805F9B34FB is used. The non-blocking connection mode (-async specified) uses readability of the channel to indicate connection state. This is different to normal socket channels, where writability provides this information.

For server channels, the first element is the UUID for the local SDP (Service Discovery Protocol) record, i.e. the application identifier, and the optional second element is the friendly name of the service as advertised over SDP. On some Android versions the friendly name may not be an empty string, otherwise incoming connection requests are not fulfilled. The port parameter is usually ignored and should be specified as 0.