panctrl.h File Reference

const TInt KCOAgentPanBase

const TIntKCOAgentPanBase
Base value for constants for use with Control() call RConnection::Control
Note:

KCO* values for use with PAN agent

const TInt KCOAgentPanConnectDevice

const TIntKCOAgentPanConnectDevice

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.

Note:

KCO* value for use with PAN agent

const TInt KCOAgentPanDisconnectDevice

const TIntKCOAgentPanDisconnectDevice

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.

Note:

KCO* value for use with PAN agent

const TInt KCOAgentPanEnumerateDevices

const TIntKCOAgentPanEnumerateDevices

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.

Note:

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
	  //......
      }
   }
Note:

KCO* value for use with PAN agent

const TInt KCOAgentPanEnumerateUplinkAccessDevices

const TIntKCOAgentPanEnumerateUplinkAccessDevices
RConnection::ControlReturn a list of device addresses that are allowed to use the uplink
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
	  //......
      }
   }