Hi all
I am trying to use a Bluetooth Finding Function which findd other Bluetooth devices. But I get a lot of Errors. I think I have to add some libraries. Can someone tell me which libraries I have to add and where.
And also what other reasons r there for these errors? The error messages are:
Compiling...
Sybera_btappui.cpp
Sybera_btcontainer.cpp
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(167) : error C2065: 'LeaveIfError' : undeclared identifier
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(171) : error C2065: 'TBTDeviceSelectionParams' : undeclared identifier
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(171) : error C2146: syntax error : missing ';' before identifier 'param'
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(171) : error C2065: 'param' : undeclared identifier
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(175) : error C2228: left of '.SelectUUID' must have class/struct/union type
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(177) : error C2065: 'TBTDeviceSelectionParamsPckg' : undeclared identifier
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(177) : error C2146: syntax error : missing ';' before identifier 'pckg'
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(177) : error C2065: 'pckg' : undeclared identifier
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(179) : error C2065: 'TBTDeviceResponseParams' : undeclared identifier
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(179) : error C2146: syntax error : missing ';' before identifier 'result'
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(179) : error C2065: 'result' : undeclared identifier
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(182) : error C2065: 'TBTDeviceResponseParamsPckg' : undeclared identifier
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(182) : error C2146: syntax error : missing ';' before identifier 'response'
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(182) : error C2065: 'response' : undeclared identifier
F:\KABIR\PROGRAMS\SYBERA_BT\SRC\Sybera_btcontainer.cpp(186) : error C2065: 'KDeviceSelectionNotifierUid' : undeclared identifier
Sybera_btdocument.cpp
Generating Code...
Error executing cl.exe.
SYBERA_BT.APP - 15 error(s), 0 warning(s)
THANX A Lot.
Nimo
It would be easier to help if you attached the code you have prolems with.
Here u go:
void SelectDeviceL()
{
RNotifier not; // Create a RNotifier object, A handle to a session _
// with the extended notifier server that provides
//support for plug-in notifiers
User:LeaveIfError(not.Connect); // Connects to the extended notifier server,_
//creating a session with that server.
TBTDeviceSelectionParams param; // Device information used to form a list of_
// possible devices from which the user can_
// select the appropriate device.
TUUID btid(0x001f82e2);
param.SelectUUID(btid);
TBTDeviceSelectionParamsPckg pckg(btid); //Packages a TBTDeviceSelectionParams_
// for transfer over an IPC boundary.
TBTDeviceResponseParams result; //Information about the device selected by a user from _
// _ a Device Selection dialog.
TBTDeviceResponseParamsPckg response(result) ; // Packages a TBTDeviceSelectionParams for transfer_
// over an IPC(Inter process communication) boundary
TRequestStatus status; //Indicates the completion status of a request made to a service provider
not.StartNotifierAndGetResponse(status, KDeviceSelectionNotifierUid, pckg, response);
// StartNotifierAndGetResponse is a Requests the extended notifier server_
// to start the plug-in notifier identified by the specified UID.This is an asynchronous request
//KDeviceSelectionNotifierUid is Device selection plug-in UID of Bluetooth plugin to the RNotifier interface.
User::WaitForRequest(status); //Waits for a specific asynchronous request to complete_
// The current thread waits on its request semaphore
TPtrC name;
/* if (status.Int() == KErrNone) ; // StartNotifierAndGetResponse returns KErrNone if the search is successful
{
if (response.IsValidDeviceName()) ;// Tests if the device name has been set in the object.
{
name.Set(response().DeviceName());
}
}
*/
// 4. Clean up
not.CancelNotifier(KDeviceSelectionNotifierUid);
not.Close();
}
In the above code, as an example, I used TBTDeviceSelectionParams, and as the Documentation says,
Location: btmanclient.h
Link against: bluetooth.lib
Class TBTDeviceSelectionParams
I included the library <btmanclient.h> in the code....still the compiler says
"error C2065: 'TBTDeviceSelectionParams' : undeclared identifier"....I must b doin something wrong.......what that is?
You must include the bluetooth.lib in the .mmp file and another .lib that i can't remember but you can see in the symbian help.
I hope that help you.F
resolved by now i hope?
for later readers: class TBTDeviceSelectionParams is in btextnotifiers.h
/la_burdet.
Fawsy wrote:You must include the bluetooth.lib in the .mmp file and another .lib that i can't remember but you can see in the symbian help.I hope that help you.F