Maybe I get more luck in the general forum...
My app connects to a measuring device under Bluetooth.
Oddly, disconnection takes long (2-3 s). And while performing the
SrmClose call, the UI is frozen.
I open the Bluetooth serial port with:
SrmOpenConfigType config;
BtVdOpenParams btParams;
BtLibSdpUuidType sppUuid;
MemSet( &sppUuid, sizeof( sppUuid ), 0 );
sppUuid.size = btLibUuidSize16;
sppUuid.UUID[ 0 ] = 0x11;
sppUuid.UUID[ 1 ] = 0x01;
MemSet( &config, sizeof( config ), 0 );
config.drvrDataP = ( MemPtr ) &btParams;
config.drvrDataSize = sizeof( BtVdOpenParams );
MemSet( &btParams, sizeof( btParams ), 0 );
btParams.role = btVdClient;
btParams.u.client.method = btVdUseUuidList;
btParams.u.client.u.uuidList.tab = &sppUuid;
btParams.u.client.u.uuidList.len = 1;
MemMove( &btParams.u.client.remoteDevAddr.address,
&gAurigaInfo.btDeviceRawAddress,
sizeof( gAurigaInfo.btDeviceRawAddress ) );
gError = SrmExtOpen( sysFileCVirtRfComm,
&config,
sizeof( config ),
&gDataPort );
and disconnect like this:
if ( gDataPort != None )
SrmReceiveFlush( gDataPort, noWait);
if ( ( gDataPort == None ) ||
( SrmSendWait( gDataPort ) == serErrLineErr ) )
gDataPort = None;
else
gError = SrmClose( gDataPort );
I attempt a SendWait before closing because I noticed trying to close an
already dead link can freeze the device. Is there
something I could change to make it faster?
I see on the measuring device that the Bluetooth icon stops
blinking in no time, showing disconnection is started, but it
takes another 2-3 s before the SrmClose call returns and the UI
is freed.
Luc Le Blanc
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/