# BLEPeripheralServer.addService(Object object)

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

with Promise style call: Not supported

Mini Program plugin: Not supported

Add service.

# parameter

# Object object

attribute type Default values Required Introductions
service Object yes Object describing service
success function no Interface calls the successful callback function
fail function no Interface calls failed callback functions
complete function no Callback function at the end of an interface call (both successful and unsuccessful calls are executed)

object.service Structure

attribute type Default values Required Introductions
uuid String yes Bluetooth Service UUID
characteristics Array.&ltObject&gt yes Charateristics list

characteristics Structure

attribute type Default values Required Introductions
uuid String yes characteristic of UUID
properties Object no Feature supported operation
permission Object no Feature permission
value ArrayBuffer no Binary value corresponding to feature
descriptors Array.&ltObject&gt no Descriptor data

properties Structure

attribute type Default values Required Introductions
write Boolean false no write
writeNoResponse Boolean false no No Reply Write
read Boolean false no read
notify Boolean false no Subscribe
indicate Boolean false no Pack

permission Structure

attribute type Default values Required Introductions
readable Boolean false no Readable
writeable Boolean false no Writable
readEncryptionRequired Boolean false no Encrypted read request
writeEncryptionRequired Boolean false no Encrypted write request

descriptors Structure

attribute type Default values Required Introductions
uuid String yes Descriptor of UUID
permission Object no Descriptor permissions
value ArrayBuffer no Descriptor data

permission Structure

attribute type Default values Required Introductions
write Boolean false no write
read Boolean false no read