# BLEPeripheralServer

Start from base library version 2.10.3. Please remaining backward compatible.

Peripheral Server

# method

# BLEPeripheralServer.addService(Object object)

Add service.

# BLEPeripheralServer.removeService(Object object)

Remove service.

# BLEPeripheralServer.startAdvertising(Object Object)

Begins broadcasting a locally created peripheral.

# BLEPeripheralServer.stopAdvertising()

Stop broadcasting.

# BLEPeripheralServer.writeCharacteristicValue(Object Object)

Writes a binary data value to the specified feature, notifying the connected host that the slave's characteristic value has changed, and the interface handles whether to walk back to the packet or to subscribe.

# BLEPeripheralServer.onCharacteristicWriteRequest(function callback)

Listen for connected device requests to write the current peripheral's eigenvalue event. You need to call the writeCharacteristicValue Write back the data or the host will not receive the response.

# BLEPeripheralServer.offCharacteristicWriteRequest(function callback)

Unlisten for connected device requests to write current peripheral feature events

# BLEPeripheralServer.onCharacteristicReadRequest(function callback)

Listen to connected devices request to read the eigenvalue events of the current peripheral device. You need to call the writeCharacteristicValue Write back the data or the host will not receive the response.

# BLEPeripheralServer.offCharacteristicReadRequest(function callback)

Cancels listening for connected device requests to read current peripheral device eigenvalue events

# BLEPeripheralServer.onCharacteristicSubscribed(function callback)

Listen for feature subscription events, only iOS Support.

# BLEPeripheralServer.offCharacteristicSubscribed(function callback)

Unsubscribe from listening feature

# BLEPeripheralServer.onCharacteristicUnsubscribed(function callback)

Listen to uncharacteristic subscription events, only iOS Support.

# BLEPeripheralServer.offCharacteristicUnsubscribed(function callback)

Unlistening Uncharacteristic Subscription Event