|
|
User login
Feeds |
How to accept incoming bluetooth connections silently?
|
|||||
| Wed, 2005-08-03 18:14 | |
|
The problem I am facing right now is that : How to accept incoming
bluetooth connections on my Symbian mobile phone silently (i.e without the prompt). I am running a OBEX server which listens for incomming connections - when a linux machine starts to setup a RFCOMM channel with the phone on the port of the OBEX server - the user gets a prompt to accept the incoming connection - how to avoid it and accept that connection transparently?? Thanks in advance, Archit Gupta |
|
Forum posts: 727
Forum posts: 12
Thanks for replying
I have already been able to find solution - actually you can allow other devices to connect without authorization (and malice prevails) - by setting the RBTSecurity parameter of authorization to EFalse. And the pairing technique also works. But I don't want the user to be prompted.
Thanks
Archit
Forum posts: 732
Thanks
Archit
I am using the BTPMP exaple code:
{
// setup channel security
TRequestStatus status;
RBTMan secManager;
RBTSecuritySettings secDatabase;
TBTServiceSecurity secSettings;
// connect to security manager
User::LeaveIfError(secManager.Connect());
CleanupClosePushL(secManager);
User::LeaveIfError(secDatabase.Open(secManager));
CleanupClosePushL(secDatabase);
// setup security
TUid settingsUID;
settingsUID.iUid = KMyApp_serviceID;
secSettings.SetUid(settingsUID);
secSettings.SetChannelID(aChannel);
secSettings.SetProtocolID(KSolBtRFCOMM);
secSettings.SetAuthentication(EFalse);
secSettings.SetAuthorisation(EFalse);
secSettings.SetEncryption(EFalse);
// register settings with security
secDatabase.RegisterService(secSettings, status);
User::WaitForRequest(status);
CleanupStack::PopAndDestroy();Â //Â secManager
CleanupStack::PopAndDestroy();Â //Â secSettings
}
Here already set all the authorization to false, even though when ever I try to connect
other device its asking for the passcode. how to resolve this problem. I want to connect
other device silently. Is there any problem with the above code?
Forum posts: 12
For me in the example - btobject exchange - when i set the setting of the obex server to Efalse - the phone no longer prompted for manual authorization. I don't know what is wrong in ur code - seems correct. The only change i made to the application for this is the Efalse setting.
Forum posts: 176
Any suggestions, solutions?
CG
Forum posts: 12
if it working means... can u post some sample code of that security settings... even iam also need that functionality .... i tried by making settings to false but it was not working .... if u can post means it will help to others also in future...hope for the positive repply from you....
Forum posts: 12
Anyway will post it soon
Good luck!
Archit
Forum posts: 732
{
RBTMan secManager;
RBTSecuritySettings secDatabase;
// connect to security manager
User::LeaveIfError(secManager.Connect());
CleanupClosePushL(secManager);
User::LeaveIfError(secDatabase.Open(secManager));
CleanupClosePushL(secDatabase);
// the security settings
TBTServiceSecurity secSettings(KUidMyApplication, KSolBtRFCOMM, 0);
//Define security requirements
secSettings.SetAuthentication(EFalse);
secSettings.SetEncryption(EFalse);
secSettings.SetAuthorisation(EFalse);
secSettings.SetChannelID(aChannel);
TRequestStatus status;
// register settings with security
secDatabase.RegisterService(secSettings, status);
User::WaitForRequest(status); // wait until the security settings are set
User::LeaveIfError(status.Int());
CleanupStack::PopAndDestroy();Â //Â secManager
CleanupStack::PopAndDestroy();Â //Â secSettings
}
Anybody have a hint?
Forum posts: 22
I am using BluetoothPMP code for bluetooth connection but i m getting error in RBTSecuritySettings "undeclared identifier" so any one can help me & tells me whts should i do for resolve this problem.
With regards
brajendra
Forum posts: 732
Forum posts: 22
I have included btmanclient.h & BTManClient.lib after all i m getting this error....
Forum posts: 732
Can you post some code snippet from where you are getting this error and the error message here?
Forum posts: 22
when i call this function SetSecurityL(channel);
void CListener::SetSecurityL(TInt aChannel)
{
// setup channel security
TRequestStatus status;
  RBTMan secManager;
RBTSecuritySettings secDatabase;
  RBTSecuritySettings secDatabase; //comments
TBTServiceSecurity secSettings;
// connect to security manager
User::LeaveIfError(secManager.Connect());
  CleanupClosePushL(secManager);
User::LeaveIfError(secDatabase.Open(secManager)); //comments
  CleanupClosePushL(secDatabase); //comments
// setup security
TUid settingsUID;
settingsUID.iUid = KBT_serviceID;
secSettings.SetUid(settingsUID);
secSettings.SetChannelID(aChannel); //comments
secSettings.SetProtocolID(KSolBtRFCOMM); //comments
secSettings.SetAuthentication(EFalse);
secSettings.SetAuthorisation(EFalse);
secSettings.SetEncryption(EFalse);
// register settings with security
secDatabase.RegisterService(secSettings, status);
User::WaitForRequest(status);
  CleanupStack::PopAndDestroy(); // secManager
  CleanupStack::PopAndDestroy(); // secSettings
}
now in this code i m getting 7 errors
Listener.cpp
C:\WORK\BLUETOOTHPMP\SRC\Listener.cpp(139) : error C2065: 'RBTSecuritySettings' : undeclared identifier
C:\WORK\BLUETOOTHPMP\SRC\Listener.cpp(139) : error C2146: syntax error : missing ';' before identifier 'secDatabase'
C:\WORK\BLUETOOTHPMP\SRC\Listener.cpp(139) : error C2065: 'secDatabase' : undeclared identifier
C:\WORK\BLUETOOTHPMP\SRC\Listener.cpp(145) : error C2228: left of '.Open' must have class/struct/union type
C:\WORK\BLUETOOTHPMP\SRC\Listener.cpp(151) : error C2039: 'SetChannelID' : is not a member of 'TBTServiceSecurity'
    \Symbian\8.0a\S60_2nd_FP2\EPOC32\INCLUDE\bt_sock.h(117) : see declaration of 'TBTServiceSecurity'
C:\WORK\BLUETOOTHPMP\SRC\Listener.cpp(152) : error C2039: 'SetProtocolID' : is not a member of 'TBTServiceSecurity'
    \Symbian\8.0a\S60_2nd_FP2\EPOC32\INCLUDE\bt_sock.h(117) : see declaration of 'TBTServiceSecurity'
C:\WORK\BLUETOOTHPMP\SRC\Listener.cpp(157) : error C2228: left of '.RegisterService' must have class/struct/union type
Error executing cl.exe.
BT.APP - 7 error(s), 0 warning(s)
plz if u find out problem then plz let me know
thanks fot it...
Forum posts: 732
Read the file called README_BLUETOOTH.txt that comes with the FP2 setup for more information. If you cant find that text file then I can mail you the same.