Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
HarmonyOS
This module provides Bluetooth message access capability based on Message Access Profile (MAP), and supports functions such as creating MSE instances and obtaining and subscribing to the Bluetooth message service connection status between devices. This module is applicable to scenarios where the Bluetooth protocol is used for message access and connection management.
The initial APIs of this module are supported since API version 11. Newly added APIs will be marked with a superscript to indicate their earliest API version.
- import { map } from '@kit.ConnectivityKit';
type BaseProfile = baseProfile.BaseProfile
BaseProfile class, which provides public capabilities such as obtaining the connection status and listening for connection status changes.
System capability: SystemCapability.Communication.Bluetooth.Core
| Type | Description |
|---|---|
| baseProfile.BaseProfile | BaseProfile API definition. |
createMapMseProfile(): MapMseProfile
Creates a Message Server Equipment (MSE) instance. Through this instance, you can use API provided when the local device is used as the MSE and implement functions such as obtaining the Bluetooth message service connection status of the local device. This API is applicable to scenarios such as Bluetooth message synchronization and viewing messages of the Bluetooth car kit.
System capability: SystemCapability.Communication.Bluetooth.Core
Return value
| Type | Description |
|---|---|
| MapMseProfile | MapMseProfile instance. This instance can be used by the local device as an MSE to access Bluetooth messages. |
Error codes
For details about the error codes, see Universal Error Codes.
| ID | Error Message |
|---|---|
| 401 | Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 3. Parameter verification failed. |
| 801 | Capability not supported. |
Example
- import { BusinessError } from '@kit.BasicServicesKit';
-
- try {
- let mapMseProfile = map.createMapMseProfile();
- console.info('MapMse success');
- } catch (err) {
- console.error('errCode: ' + (err as BusinessError).code + ', errMessage: ' + (err as BusinessError).message);
- }
Represents the MSE role in MAP.
Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Quick start
Helps you find desired resources with ease.