1# @ohos.bluetooth.hfp (蓝牙hfp模块) 2 3hfp模块提供了访问蓝牙呼叫接口的方法。 4 5> **说明:** 6> 7> 本模块首批接口从API version 10开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 8 9 10 11## 导入模块 12 13```js 14import hfp from '@ohos.bluetooth.hfp'; 15``` 16 17 18## hfp.createHfpAgProfile 19 20createHfpAgProfile(): HandsFreeAudioGatewayProfile 21 22创建hfp profile实例。 23 24**系统能力**:SystemCapability.Communication.Bluetooth.Core。 25 26**返回值:** 27 28| 类型 | 说明 | 29| ----------------------------- | ---------- | 30| HandsFreeAudioGatewayProfile | 返回该profile的实例。 | 31 32**示例:** 33 34```js 35import { BusinessError } from '@ohos.base'; 36try { 37 let hfpAgProfile = hfp.createHfpAgProfile(); 38 console.info('hfpAg success'); 39} catch (err) { 40 console.error('errCode: ' + (err as BusinessError).code + ', errMessage: ' + (err as BusinessError).message); 41} 42``` 43 44 45## HandsFreeAudioGatewayProfile 46 47使用HandsFreeAudioGatewayProfile方法之前需要创建该类的实例进行操作,通过createHfpAgProfile()方法构造此实例。 48