WD Bluetooth
// Summary: Procedure that retrieves the list of BT devices, stores their ID and Mac address, and fills the combo box with the name of the devices
// Syntax:
//ListBTDevice ()
//
// Parameters:
// None
// Return value:
// None
//
PROCEDURE ListBTDevice()
//Delete the content of the combo box previously
ListDeleteAll(COMBO_BTDevices)
//Retrieve the BT devices
sListBTDevice is string = BTListDevice(btSimpleList)
sABTDevice, sDeviceName are strings
stInfoBTDevice is STBTDevice
FOR EACH STRING sABTDevice OF sListBTDevice SÉPARÉE BY CR
//Retrieve the ID of the BT device
stInfoBTDevice:nDeviceID = ExtractString(sABTDevice,1,TAB)
//Retrieve the Mac address of the BT device
stInfoBTDevice:sMACAddress = ExtractString(sABTDevice,2,TAB)
//Retrieve the name of the BT device
sDeviceName = ExtractString(sABTDevice,3,TAB)
//Store the information about the BT device in an associative array
gaaBTDevice[sDeviceName ] = stInfoBTDevice
//Add the device to the combo box
ListAdd(COMBO_BTDevices, ExtractString(sABTDevice,3,TAB))
END
IF ListCount(COMBO_BTDevices) = 0 THEN
Info("No Bluetooth device was found.")
END