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

Developer

API Reference

IBTCONNECTION1

Brew Release
Brew MP 1.0.2
Description

This interface provides methods to monitor an existing Bluetooth connection.
IBTConnection1 object should always be created by calling GetConnectionObject API of IBTConnectionFactory interface.
Applications can register a signal to be notified when there is a change in status of the connection, by calling OnStatusChange() API. Applications can retrieve the current status of connection by calling GetStatus() API.
Usage

Usage example:



   ===== To create an IBTConnection1 object
   IBTConnectionFactory_GetConnectionObject(piBTConnFactory, &piBTConnection1);

   ===== To register a signal to be notified of status change 
   // first create the signals;
   // for example, use ISignalCBFactory_CreateSignal()
   // then register the signals:
   IBTConnection1_OnStatusChange (piBTConnection1, piSignal);

   ===== To get the current status of the connection
   IBTConnection1_GetStatus(piBTConnection1, 
                            &pConnStat);

   ===== When the signal is triggered
   IBTConnection1_GetStatus(piBTConnection1, 
                            &pConnStat);
 
   // Re-enable the signal to get next status change event
   ISignalCtl_Enable (piSignalCtl); // re-enable signal

   ===== When connection is down,
   // done with IBTConnection1 object:
   IBTConnection1_Release (piBTConnection1);