LitDev Extension API
LDBlueTooth
![](images/IntellisenseObject.png)
BlueTooth control.
The Advanced features refer to non file transfer (effectively writing a device driver).
To communicate with a USB bluetooth stick you also need have an external bluetooth device, setting it to be dicoverable etc before running your SmallBasic program.
Connect
![]() |
DataAvailable
![]() |
Device
![]() |
Encode
![]() |
GetDevices
![]() |
GetEncodings
![]() |
GetServices
![]() |
Initialise
![]() |
InRange
![]() |
LastDevice
![]() |
LastError
![]() |
OutOfRange
![]() |
ReceiveData
![]() |
ReceiveFile
![]() |
SendData
![]() |
SendFile
![]() |
Service
![]() |
Connect()
![](images/IntellisenseMethod.png)
Advanced feature.
Connect an external device and service to the bluetooth USB stick.
You must first Initialise, then set the device, service and encoding.
returns "True" or "False" on success or failure.
DataAvailable
![](images/IntellisenseProperty.png)
The number of bytes of data received and waiting to be read.
This could be used in a Timer to check for data received.
Device
![](images/IntellisenseProperty.png)
The current bluetooth device.
Encode
![](images/IntellisenseProperty.png)
Advanced feature.
The current bluetooth data encoding.
GetDevices()
![](images/IntellisenseMethod.png)
Get a list of discovered bluetooth devices.
returns An array of devices or "" on failure.
GetEncodings()
![](images/IntellisenseMethod.png)
Advanced feature.
Get a list of available encodings.
returns An array of encodings or "" on failure.
GetServices()
![](images/IntellisenseMethod.png)
Advanced feature.
Get a list of available service protocols.
returns An array of services or "" on failure.
Initialise()
![](images/IntellisenseMethod.png)
Initialise a bluetooth USB stick and detect discoverable external devices.
As devices come into or out of range the devices list is updated.
returns "True" or "False" for success or failure configuring a bluetooth interface.
InRange
![](images/IntellisenseEvent.png)
Event when a bluetooth device comes in range.
Seems to keep firing unexpectedly.
LastDevice
![](images/IntellisenseProperty.png)
The last device in or out of range.
LastError
![](images/IntellisenseProperty.png)
Get the last error message.
Error messages may be set for various failures.
OutOfRange
![](images/IntellisenseEvent.png)
Event when a bluetooth device goes out of range.
Doesn't seem to work as expected.
ReceiveData()
![](images/IntellisenseMethod.png)
Advanced feature.
Receive (fetch) data from a bluetooth device.
The device must be Initialised and Connected.
The encoding should also be set.
returns String of received characters or "" on failure.
ReceiveFile(fileName)
![](images/IntellisenseMethod.png)
Receive (fetch) a file from an attached external bluetooth device.
You must first Initialise, then set the device.
fileName The location to save the received file.
returns A result status message "True" or "False".
SendData(data)
![](images/IntellisenseMethod.png)
Advanced feature.
Send data to a bluetooth device.
The device must be Initialised and Connected.
The encoding should also be set.
data A string of characters to send.
returns A result status message "True" or "False".
SendFile(fileName)
![](images/IntellisenseMethod.png)
Send a file to an attached external bluetooth device.
You must first Initialise, then set the device.
fileName The file to send.
returns A result status message "True" or "False".
Service
![](images/IntellisenseProperty.png)
Advanced feature.
The current bluetooth service.