C Language Development Kit/Functions/BltIsConnected
From OptiWiki
< C Language Development Kit | Functions(Redirected from C Language Development Kit/Functions/blt is connected)
| Description | Checks if there is a bluetooth connection in the RFCOMM layer. | ||||||
| Syntax | int blt_is_connected(void); | ||||||
| Arguments | None | ||||||
| Returns |
| ||||||
| Remarks | blt_is_connected() function checks to see if the RFCOMM layer is connected. When connected there is a small amount of time that the connection cannot be determined. The function then returns NG. | ||||||
| Example | #include "lib.h" #include <stdio.h> void check_connection( void ) { switch( blt_is_connected()) { case NG: printf("\fNot available yet."); break; case TRUE: printf("\fConnected."); break; case FALSE: printf("\fNot connected."); break; } } void main( void ) { autopowerdown( ON, 3000 ); // 60 seconds systemsetting("7G"); // show charging indication LED cursor( NOWRAP ); comopen( COM3 ); // SPP connection port for(;;) { check_connection(); if( kbhit() ) { resetkey(); comclose( COM3 ); check_connection(); comopen( COM3 ); } delay(5); } } |
