mstBuildProfile
Start from API_LEVEL
3.0
. Please refer to API_LEVEL.
Creating a Profile connection.
Type
function mstBuildProfile(profile: ProfileObj): Result
Parameters
ProfileObj
Property | Type | Required | DefaultValue | Description | API_LEVEL |
---|---|---|---|---|---|
pair | boolean | Y | - | Whether to pair automatically | 3.0 |
id | number | Y | - | Connection ID | 3.0 |
profile | string | Y | - | Profile Name | 3.0 |
dev | ArrayBuffer | Y | - | Device MAC address, 6 bytes long, Uint8Array view recommended | 3.0 |
len | number | Y | - | list array length | 3.0 |
list | Array<ServicesObj> | Y | - | Services list array | 3.0 |
ServicesObj
Property | Type | Required | DefaultValue | Description | API_LEVEL |
---|---|---|---|---|---|
len | number | Y | - | list array length | 3.0 |
list | Array<ServiceObj> | Y | - | Service array | 3.0 |
ServiceObj
Property | Type | Required | DefaultValue | Description | API_LEVEL |
---|---|---|---|---|---|
uuid | string | Y | - | Service UUID | 3.0 |
permission | number | N | 0 | Permission control, default 0 No control | 3.0 |
len1 | number | Y | - | Characteristic array length | 3.0 |
list | Array<CharacteristicObj> | Y | - | Characteristic length | 3.0 |
CharacteristicObj
Property | Type | Required | DefaultValue | Description | API_LEVEL |
---|---|---|---|---|---|
uuid | string | Y | - | Characteristic UUID | 3.0 |
permission | number | N | 0 | Permission control, default 0 No control | 3.0 |
len | number | Y | - | Descriptor array length | 3.0 |
list | Array<DescriptorObj> | Y | - | Descriptor array | 3.0 |
DescriptorObj
Property | Type | Required | DefaultValue | Description | API_LEVEL |
---|---|---|---|---|---|
uuid | string | Y | - | Descriptor UUID | 3.0 |
permission | number | N | 0 | Permission control, default 0 No control | 3.0 |
Result
Type | Description |
---|---|
boolean | The result of the function call, true means success, false means failure |
Example
import { mstGetConnIdByRemoteAddr } from '@zos/ble'
// ...