# BLEPeripheralServer.startAdvertising(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
Begins broadcasting a locally created peripheral.
# parameter
# Object Object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
advertiseRequest | Object | yes | Broadcast custom parameters | |
powerLevel | String | medium | no | Broadcast power |
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.advertiseRequest Structure
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
connectable | Boolean | true | no | Whether the current device can be connected |
deviceName | String | no | On the radio. deviceName Field, default empty | |
serviceUuids | Array.<String> | no | Service to be broadcast UUID List. use 16/32 position UUID Please refer to the points for attention. | |
manufacturerData | Array.<Object> | no | Manufacturer information for the broadcast. Android only support, iOS Unable to customize due to system limitations. |
manufacturerData Structure
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
manufacturerId | String | yes | Manufacturer ID, 0x Beginning hexadecimal | |
manufacturerSpecificData | ArrayBuffer | no | Manufacturer Information |
Object.powerLevel Legal value
value | Introductions | Minimum version |
---|---|---|
low | Low power | |
medium | Moderate power | |
high | High power |
# Be careful
- Android 8.0.9 Start, support direct use 16/32/128 position UUID
- Android 8.0.9 The following versions only support 128 position UUID, using 16/32 Bit UUID The system will automatically identify whether it belongs to the pre-allocation interval, you can refer toBluetooth Guide
- iOS Must be used directly 16 Bit UUUID cannot be filled to 128 Bit, or the system will still group packages according to the 128 Bit transmission. iOS Temporary support 32 position UUID。
- iOS Only one broadcast can be launched at the same time. Android supports multiple broadcasts simultaneously.