Class Adapter

An adapter represents the chip or peripheral that is used to communicate over BLE.
On the ESP32 it is the integrated peripheral. On desktops it is provided by the operating system, and can be a USB chip, or an integrated chip of laptops.

Class summary


Constructors

Methods

The central manager handles connections to remote peripherals.
It is responsible for scanning, discovering and connecting to other devices.

close -> none

operator == other/any -> bool
Whether this object is equal to the other.
By default, identical is used for equality.
Inheritance
Classes overwrite this operator to get an equality specific to their needs. Equality operators often compare the type and field contents. For example:

class Pin:
  number/int

  constructor .number:

  operator == other:
    if other is not Pin: return false
    return number == other.number
A class doesn't have to follow the above format, but it must keep the operator in sync with any hash-code method. That is, if a class has a hash-code member, then the equality and hash-code must agree. If two instances are equal (a == b), then their hash codes must also be equal (a.hash-code == b.hash-code).

peripheral --bonding/bool=false --secure-connections/bool=false --name/string=null -> Peripheral
The peripheral manager is used to advertise and publish local services.
If bonding is true then the peripheral is allowing remote centrals to bond. In that case the information of the pairing process may be stored on the device to make reconnects more efficient.
If secure-connections is true then the peripheral is enabling secure connections.
If name is provided, it is used for the GAP name. The GAP name can be different from the advertised name in the advertisement data. On some platforms, the GAP name is stored and will be used in future calls to this method (if the name is not provided).

Stringifies this object.
Inheritance
Objects that need a human-friendly string representation should overwrite this method. The default string is based on the internal class-ID.