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


API Reference


Brew Release
Brew MP 1.0.2
See Also

This interface provides access to the Device Database kept by BT driver. User of this interface can add a new entry to the DB, remove an existing entry from the DB, retrieve (or read) a particular entry in the DB, update certain fields of an entry in the DB, or enumerate through the DB based on some criteria. Note that a new entry in the Device Database will be automatically created by BT driver when the local device is bonded to another device.

Usage example:

   ===== To create a DevDB object, see instruction in class header file
   ===== To add a device entry to database
      IBTDEVDB_Add ( pIBTDevDB,
                      &deviceInfo); // new device entry
    ===== To read a device entry specified by BD address
      IBTDEVDB_Read ( pIBTDevDB,
                      &deviceEntry); // deviceEntry structure with 
                                     // bdAddr value filled
    ===== To remove an entry from database
      IBTDEVDB_Remove ( pIBTDevDB,
                      &bdAddr); //BD address of the entry to be removed
    ===== To initialize device database enumeration
      IBTDEVDB_EnumInit( pIBTDevDB,
                      &enumerator); //address of BTDevDBEnumerator
                                    // having enumeration criteria
    ===== To enumerate the next device matching search criteria
      IBTDEVDB_EnumNext( pIBTDevDB,
                        &deviceEntry); //place holder to store next entry
                                      // matching search criteria
    ===== To set the Nickname of for an entry in device database
                           &BDAddr,      // BD Address of the device
                           "MyHeadset"); // nick name for the device
    ===== To update the security settings for a particular device
        BTResult IBTDEVDB_SetSecurity(pIBTDevDB,
                                      &BDAddr,    // BDAddress of the device
                                      secLevel);  // BTSecurityLevel
   ===== To update a user defined value for a particular device
        BTResult IBTDEVDB_SetUserValue(pIBTDevDB,
                                  &BDAddr,    // BDAddress of the device
   ===== To initiate bonding with a device
       BTResult IBTDEVDB_Bond(pIBTDevDB,
                         &BDAddr,    // BDAddress of the device
                         "0000",     // PIN key for Bonding
                          TRUE,      // We initiated bonding
                          &result,   // place holder to store
                                     // result of operation
                          &(resultCb ) // Callback to be called 
                                       // when operation is done
   ===== To initiate un bond from a device which is already bonded 
       BTResult IBTDEVDB_Unbond(pIBTDevDB
                            &BDAddr);    // BDAddress of the device
   < When done with IBTDevDB Object