Android Programming Press on the image to return to the main documentation page.

BLE2Peripheral

List of types:

BlePeripheral2

BlePeripheral2

Allows to configure the device as a BLE peripheral device. Other central devices can connect to this device.
Only supported by some devices running Android 5+. Make sure to check IsPeripheralSupported property.

Events:

Start (Success As Boolean)
Subscribe (DeviceId As String)
Unsubscribe (DeviceId As String)
NewData (DeviceId As String, Data() As Byte)

Members:


  Close

  Initialize (EventName As String, Ble As BleManager2)

  IsPeripheralSupported As Boolean [read only]

  ManufacturerData As Map

  Start (Name As String)

  Start2 (Name As String, Settings As android.bluetooth.le.AdvertiseSettings)

  Write (Centrals As List, Data() As Byte)

Members description:

Close
Initialize (EventName As String, Ble As BleManager2)
Initializes the object.
IsPeripheralSupported As Boolean [read only]
Checks whether peripheral mode is supported.
ManufacturerData As Map
Gets or sets the manufacturer specific data that will be advertised.
Each item in the map should have a positive int number as the key and an array of bytes as the value.
Start (Name As String)
Starts advertising. The name will be set as the device Bluetooth name. Pass an empty string to keep the current name.
The Start event will be raised.
Start2 (Name As String, Settings As android.bluetooth.le.AdvertiseSettings)
Similar to Start. Allows overriding the default settings.
Write (Centrals As List, Data() As Byte)
Writes data to subscribed devices.
Centrals - Target devices. Pass Null to send to all subscribed devices.
Top