1) The following is the example,
Code:
// 1. Create a notifier
RNotifier not;
User::LeaveIfError(not.Connect());
// 2. Start the device selection plug-in
TBTDeviceSelectionParams selectionFilter;
TUUID targetServiceClass(0x2345);
selectionFilter.SetUUID(targetServiceClass);
TBTDeviceSelectionParamsPckg pckg(selectionFilter);
TBTDeviceResponseParams result;
TBTDeviceResponseParamsPckg resultPckg(result);
TRequestStatus status;
not.StartNotifierAndGetResponse(status, KDeviceSelectionNotifierUid, pckg, resultPckg);
User::After(2000000);
// 3. Extract device name if it was returned
User::WaitForRequest(status);
TPtrC name;
if (status.Int() == KErrNone)
{
if (resultPckg.IsValidDeviceName())
{
name.Set(resultPckg().DeviceName());
}
}
// 4. Clean up
not.CancelNotifier(KDeviceSelectionNotifierUid);
not.Close();
So for clarification could you maybe tell me the actual use of package buffers?
Are they only being used because the not.StartNotifierAndGetResponse(status, KDeviceSelectionNotifierUid, pckg, resultPckg) function takes only a packaged buffer. If yes my next question would be how do I open a package buffer to reassign the value to the TBTDeviceResponseParams result parameter.
2) Ok so I set, TBuf<255> iAddress;
Code:
if (status.Int() == KErrNone)
{
if (resultPckg().IsValidBDAddr())
{
iBTState = EBTDiscoveredDevice;
//iDevice = resultPckg().DeviceName();
resultPckg().BDAddr().GetReadable(iAddress);
}
}
and get the error BTDevAddr 0