Implementing RNDIS Network Connection Refusal Notifier Plug-in

The RNDIS Network Connection Refusal Notifier informs the user when an attempt to use RNDIS has been blocked because the Bluetooth PAN is active.

Due to current implementation limitations, it is not possible to have an active Bluetooth PAN connection at the same time as an active USB RNDIS connection. The RNDIS connection refusal notifier informs the user if an attempt to use RNDIS has been blocked because Bluetooth PAN is active.

Licensees need to implement a notifier plugin which will be activated when a PC tries to establish a RNDIS network connection with a mobile device but does not succeed because the PAN has an active connection.

The RNDIS network connection refusal notifier UID is defined in the RNDIS header file rndisuiinterfaces.h.
const TUid KUidRndisNetworkConnectionRefusalNotifier = {0x10286A45};
  1. Your new class CRndisNetworkConnectionRefusalNotifier must implement the MEikSrvNotifierBase2 interface.

  2. Implement the Start() function to start the notifier. This is called as a result of a client-side call to RNotifier::StartNotifier(), which the client uses to start a notifier from which it does not expect a response. The function is synchronous, but it should be implemented so that it completes as soon as possible, allowing the notifier framework to enforce its priority mechanism. It is not possible to wait for a notifier to complete before returning from this function unless the notifier is likely to finish implementing its functionality immediately.
    Parameter Description

    aBuffer

    Data that can be passed from the client-side. The format and meaning of any data is implementation dependent.

    In this example from the reference code, specific details are given for a refusal resulting from BT Pan being active and a default message is given for other reasons.
    TPtrC8 CRndisNetworkConnectionRefusalNotifier::StartL(const TDesC8& aBuffer)
        {
        //Get the refusal reason from aBuffer
        TPckgBuf<TRndisRefusalNotifierReasonCode> pkgbuf;
        pkgbuf.Copy(aBuffer);
        TRndisRefusalNotifierReasonCode reason = pkgbuf();
    
        //Get the label control 
        CEikLabel* label = static_cast<CEikLabel*>(Control(ERefusalLabel));
    
        switch(reason)
        {
        case ERndisRefusalNotifierBTPanIsActive:
            {
            //Notify that BT Pan is active, rndis is refused.
            label->SetTextL(KBTPanIsActive);
            break;
            }
        default:
            //Set error message
            label->SetTextL(KUnknownMessage);
            break;
        }
     
        //Update the control.
        label->DrawNow();
        label->MakeVisible(ETrue);
    
        //Show dialog.
        if (!IsVisible())
            {
            RouseSleepingDialog();
            }
    
        return aBuffer;
        }