API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

IBTMGR1

Brew Release
Brew MP 1.0.2
See Also
None
Description
This interface provides methods to control the underlying Bluetooth driver. User of this interface should have appropriate privilege.
Usage

Usage example:

===== To create an IBTMgr1 object, see instruction in .bid file


   

===== To register signal

// first create the signal; // for example, use ISignalCBFactory_CreateSignal() // then register the signal: IBTMgr1_OnStateChangeNotify (piBTMgr1, piSignal);

===== To retrieve state:

BTResult dResult; IBTMgr1_RetrieveState (piBTMgr, &dState, &dResult) switch (dState) { // Handle state changes } ISignalCtl_Enable (pMe->piMgr1EvSignalCtl); // re-enable signal

===== To Enable Bluetooth driver and radio IBTMgr1_EnableBT(piBTMgr1);

===== To Disable Bluetooth driver and radio IBTMgr1_DisableBT(piBTMgr1);

===== To set Bluetooth name for local device:

uint8 myBTName[] = "MyBluetooth"; IBTMgr1_SetName(piBTMgr, myBTName); ===== To set Bluetooth Short name for local device: uint8 myBTName[] = "MyBT"; IBTMgr1_SetShortName(piBTMgr, myBTName);

===== To set class of device for your device:

BTClassOfDevice myCoD = {AEEBT_COS_TELEPHONY, AEEBT_DC_PHONE, AEEBT_SDC_PHONE_CELLULAR}; IBTMgr1_SetCoD(piBTMgr1, myCoD);

===== To set prefer connection role for local device to MASTER:

IBTMgr1_SetPrefConnRole(piBTMgr1, TRUE);

===== To allow for role change when requested by the remote:

IBTMgr1_SetRoleSwitchPolicy(piBTMgr1, TRUE);

===== To set the device as discoverable

IBTMgr1_SetDiscoverableMode(piBTMgr1, AEEBTSD_DISCOVERABLE_MODE_GENERAL);

===== To set the Manufacturer specific EIR data

// Create an instance of IBTEIR interface. // Add EIR data. For example see AEEIBTEIR.h IBTMgr1_SetEIRData(piBTMgr1, piBTEir);

===== To set the device as connectable

IBTMgr1_SetConnectable(piBTMgr1, TRUE);

===== To add to the list of black listed devices

IBTMgr1_SetBlackList(piBTMgr1, pAddr, AEEBTMGR1_OP_ADD );

===== To add to the list of prefered devices

IBTMgr1_SetWhiteList(piBTMgr1, pAddr, AEEBTMGR1_OP_ADD );

===== To remove a device from the white list

IBTMgr1_SetWhiteList(piBTMgr1, pAddr, AEEBTMGR1_OP_REMOVE );

===== To enable a list of services

IBTMgr1_EnableServices(piBTMgr1, AEEBT_SCU_VIDEO_DISTRIBUTION, 1);

===== To tune performance:

IBTMgr1_TunePerformance ( piBTMgr, AEEBT_AVP_SMALLEST_ACT_MOST_POWER, // faster connection AEEBT_AVP_AUTOMATIC, // let Bluetooth driver decide on inquiry scan perf AEEBT_DATA_LATENCY_AUTO); // let Bluetooth driver decide low power parameters.

===== To tune audio performance for high quality - high power consumption.

IBTMgr1_TuneAudioPerformance(piBTMgr1, AEEBT_AUDIO_LATENCY_AUTO, AEEBT_AUDIO_HIGH_QUALITY_MOST_POWER);