const TInt | KCOAgentPanBase |
KCO* values for use with PAN agent
const TInt | KCOAgentPanConnectDevice |
RConnection::ControlBring a new device into the PAN network. The Control() call will complete as soon as the PAN agent has started the process, so it may be several seconds before the device is addressable. It is also possible for the connection attempt to fail even if the Control() method returns KErrNone, due to the actual processing occuring asynchronously.
RConnection connection; TBTDevAddr remoteDeviceToAdd; ... <Connect RConnection object, and find the remote device to add to the PAN> ... TPtr8 ptr = remoteDeviceToAdd.Des(); User::LeaveIfError(connection.Control(KCOLAgent, KCOAgentPanConnectDevice, ptr));
The use of a temporary TPtr is safe, as the Control method is synchronous.
KCO* value for use with PAN agent
const TInt | KCOAgentPanDisconnectDevice |
RConnection::ControlAttempt to remove a connected device from the PAN network.
RConnection connection; TBTDevAddr remoteDeviceToRemove; ... <Connect RConnection object, and find the remote device to remove from the PAN> ... TPtr8 ptr = remoteDeviceToRemove.Des(); User::LeaveIfError(connection.Control(KCOLAgent, KCOAgentPanDisconnectDevice, ptr));
The use of a temporary TPtr is safe, as the Control method is synchronous.
KCO* value for use with PAN agent
const TInt | KCOAgentPanEnumerateDevices |
RConnection::ControlReturn a list of connected devices. If the buffer supplied is too small to hold all of the device addresses, as many as will fit will be returned. The descriptor length will be adjusted to reflect the total connected device count.
Devices which are still in the process of connecting to the PAN network will not be included.
RConnection connection; ... <Connect RConnection object> ... const TUint KMaxDevicesForSimultaneousSelection = 7; TFixedArray<TBTDevAddr, KMaxDevicesForSimultaneousSelection> deviceAddrList; deviceAddrList.Reset(); TPckg<TFixedArray<TBTDevAddr, KMaxDevicesForSimultaneousSelection> > pckg(deviceAddrList); User::LeaveIfError(connection.Control(KCOLAgent, KCOAgentPanEnumerateDevices, pckg)); for(TInt i=0; i < pckg().Count(); ++i) { if (pckg()[i]!=0) { const TBTDevAddr devAddr = pckg().At(i); //...... //...... <-Implmentation to use the BT address //...... } }
KCO* value for use with PAN agent
const TInt | KCOAgentPanEnumerateUplinkAccessDevices |
RConnection connection; ... <Connect RConnection object> ... const TUint KMaxDevicesForSimultaneousSelection = 7; TFixedArray<TBTDevAddr, KMaxDevicesForSimultaneousSelection> deviceAddrList; devices.Reset(); TPckg<TFixedArray<TBTDevAddr, KMaxDevicesForSimultaneousSelection> > pckg(deviceAddrList); connection.Control(KCOLAgent, KCOAgentPanEnumerateUplinkAccessDevices, pckg); for(TInt i=0; i < pckg().Count(); ++i) { if (pckg()[i]!=0) { const TBTDevAddr devAddr = pckg().At(i); //...... //...... <-Implmentation to use the BT address //...... } }
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.