function opens a connection, via Bluetooth, to another device (a computer, laptop, tablet, or phone) running a local server. The first argument must be the keyword Bluetooth
. The second argument, server_device_name
, is an optional string expression of the name of the device to which you want to connect. For Android devices, the device name can be found in Bluetooth settings on the device running the server. For Windows devices, this is the PC name that can be found in Windows settings. The getbluetoothname
function can be used on the other device to find the device name. If no server device name is specified, a list of nearby devices is displayed and the operator may choose which one to connect to.
In order for the two devices to connect successfully, the device running the server must call the function syncserver
at roughly the same time as the call to syncconnect
is made by the client device.
When connecting over Bluetooth, no Internet connection is required, however the two devices must be in close physical proximity. This is useful when transferring data in areas where no Internet connection is available.