Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

High-Performance Bluetooth Low Energy Library For RAD Developers

high performance bluetooth low energy library for rad developers

Embarcadero offers a set of components and libraries to work with Bluetooth Low Energy or just BLE-enabled devices. For instance, you can utilize the new TBluetoothLE component to implement the RTL BluetoothLE feature for server and client applications using with FireMonkey.

Furthermore, the RTL provides a BLE scan filter implementation that takes advantage of the new BLE low consumption chips. Probably you can connect any BLE-enabled devices using built-in Bluetooth components which comes with RAD Studio.

In addition to that, there are third-party BLE libraries or components available for Delphi & C++ Builder developers. For instance, IPWorks BLE library.

What is IPWorks BLE Library? 

IPWorks BLE includes a set of powerful components for integrating Bluetooth Low Energy communications capabilities into the web, desktop, and more applications. The BLEClient component provides a simple but flexible BLE GATT client implementation and descriptors exposed by BLE GATT servers on BLE devices.

procedure TFormBLEClient.iplBLEClient1Advertisement(Sender: TObject; const ServerId,
  Name: string; RSSI, TxPower: Integer; const ServiceUuids, ServicesWithData,
  SolicitedServiceUuids: string; ManufacturerCompanyId: Integer;
  ManufacturerData: string; ManufacturerDataB: TBytes; IsConnectable, IsScanResponse: Boolean);
var
  serverIdExists: Boolean;
  I: Integer;
begin
  // This method will check to see if the ServerID already exists. If it does not,
  // then display advertisement information for it.

  serverIdExists := false;
  if ServerIds.Count = 0 then
  begin
    ServerIds.Add(ServerId);
  end
  else
  begin
    for I := 0 to ServerIds.Count-1 do
    begin
      if ServerIds[I] = ServerId then
      begin
        serverIdExists := true;
        break;
      end;
    end;
  end;

  if not serverIdExists then
  begin
    ServerIds.Add(ServerId);
    lvAdvertisements.Items.Add();
    lvAdvertisements.Items[lvAdvertisements.Items.Count-1].Caption := ServerId;
    lvAdvertisements.Items.Item[lvAdvertisements.Items.Count-1].SubItems.Add(Name);
    lvAdvertisements.Items.Item[lvAdvertisements.Items.Count-1].SubItems.Add(inttostr(RSSI));
    lvAdvertisements.Items.Item[lvAdvertisements.Items.Count-1].SubItems.Add(inttostr(TxPower));
    lvAdvertisements.Items.Item[lvAdvertisements.Items.Count-1].SubItems.Add(booltostr(IsConnectable, True));
    lvAdvertisements.Items.Item[lvAdvertisements.Items.Count-1].SubItems.Add(ServiceUuids);
    lvAdvertisements.Items.Item[lvAdvertisements.Items.Count-1].SubItems.Add(ServicesWithData);
    lvAdvertisements.Items.Item[lvAdvertisements.Items.Count-1].SubItems.Add(inttostr(ManufacturerCompanyId));
    lvAdvertisements.Items.Item[lvAdvertisements.Items.Count-1].SubItems.Add(TBytesToHex(ManufacturerDataB)); // Needs to be converted to hex string
  end
end;

IPWorks BLE Library Features:

How do I get the IPWorks BLE Library?

Head over and check out the BLE library on the GetIt portal and download it in the IDE using the GetIt Package Manager.

Exit mobile version