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

Developer

API Reference

IBT

Brew Release
Brew MP 1.0.2
See Also
None
Description
This interface enables Brew MP applications to control the Bluetooth driver.
Usage

Usage example:



   ===== To create an IBT  object, see the instruction in the class header file

   ===== To register for Bluetooth notifications, see the instructions in the 
         class header file
   
   ===== To get a Bluetooth class from IBT (for example, AEEIID_BT_DEV_DB)
      IBT_GetObject ( pIBTObj,
                      AEEIID_BT_DEV_DB,      // class id of desired class
                      NULL,                 // No input data
                       0,                   // size of data
                      ( void** )&pIDevDB ); // Address of Dev DB pointer
   
 
   ===== To retrieve information on the local Bluetooth device.
   IBT_GetLocalInfo (pIBTObj,
                     pLocalInfo, // Address of buffer to fill local info
                     size ):     // size of buffer
                     
   ===== To get the state of the radio
   IBT_GetRadioState (pIBTObj,
                      pRadioState); // address of BTRadioState structure 
                                   //  variable
                                          
   ===== To send a command to the Bluetooth driver 
   IBT_Command (pIBTObj,
                AEEBT_CMD_SET_LOCAL_NAME,
                pCb,                    // Callback to be called when
                                        //  command result arrives
               "My Bluetooth Device",   // Local BT device name
               STRLEN("My Bluetooth Device"), // Device name len
               NULL,                          
               0);  

   ===== To get Notification data when a Bluetooth-related event arrives
     int IBT_GetNotificationData(pIBTObj,
                               &(notifyInfo),     //info to look up event.
                               sizeof(notifyInfo),// size of notification info
                                                  // structure
                               &(eventData),      // placeholder for
                                                  // all data associated with 
                                                  // the event of interest  
                               sizeof(eventData)); // size of event data structure
                               
   < When done with IBT Object call
       IBT_Release(pIBTObj);