×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Regular Contributor
    Join Date
    May 2006
    Posts
    79

    Thumbs down Bluetooth Engine API fails to load on the N79 device

    Hi all,

    I'm creating an application which switch on/off the bluetooth programatically using the CBTMCMSettings.

    This is my hearder file

    class CMyBTEngine : public CBase
    {
    public:
    static CMyBTEngine* NewL();
    static CMyBTEngine* NewLC();
    ~CMyBTEngine();

    private:
    void ConstructL();
    CMyBTEngine();

    public:

    void SetPowerStateOn();
    void SetPowerStateOff();
    private:

    CBTMCMSettings* iBtSettings;
    TBool iPowerState;
    TInt iErrCode;
    TBuf<5> iErrCodeBuf;
    };


    My Source Code :

    // Standard construction sequence
    CMyBTEngine* CMyBTEngine::NewL()
    {
    CMyBTEngine* self = CMyBTEngine::NewLC();
    CleanupStack::Pop(self);
    return self;
    }

    CMyBTEngine* CMyBTEngine::NewLC()
    {
    CMyBTEngine* self = new (ELeave) CMyBTEngine;
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
    }

    CMyBTEngine::CMyBTEngine()
    {

    }

    void CMyBTEngine::ConstructL()
    {
    iBtSettings = CBTMCMSettings::NewL(NULL);
    }

    CMyBTEngine::~CMyBTEngine()
    {
    if ( iBtSettings )
    {
    delete iBtSettings;
    iBtSettings = NULL;
    }

    }

    // sets the Bluetooth Power State On
    void CMyBTEngine::SetPowerStateOn()
    {
    iErrCode = iBtSettings->SetPowerState(ETrue);
    if ( iErrCode == KErrNone )
    {
    CEikonEnv::InfoWinL(_L("setting of Power State On"),_L("successful"));
    }
    else
    {
    iErrCodeBuf.AppendNum(iErrCode);
    CEikonEnv::InfoWinL(_L("SetPowerStateOn Error"), iErrCodeBuf);
    iErrCodeBuf.Zero();
    }
    }

    // sets the Bluetooth Power State Off
    void CMyBTEngine::SetPowerStateOff()
    {
    iErrCode = iBtSettings->SetPowerState(EFalse);
    if ( iErrCode == KErrNone )
    {
    CEikonEnv::InfoWinL(_L("setting of Power State Off"),_L("successful"));
    }
    else
    {
    iErrCodeBuf.AppendNum(iErrCode);
    CEikonEnv::InfoWinL(_L("SetPowerStateOff Error"), iErrCodeBuf);
    iErrCodeBuf.Zero();
    }
    }

    Lib:

    bteng.lib

    Capability:

    LocalServices,NetworkSerivices.



    when i'm using the above codes on my application, the installation is got failed saying that "Unable to Install"

    If i removed the above code from my app, then its got installed successfully.

    Please help me out from this issue.

    I dont know what i need to do to fix this.

    Thanks in Advance

    Karthikeyan.B

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,752

    Re: Bluetooth Engine API fails to load on the N79 device

    Check your .pkg file, a common cause of "Unable to install" is the deployment of winscw binaries to target hardware.

  3. #3
    Regular Contributor
    Join Date
    May 2006
    Posts
    79

    Re: Bluetooth Engine API fails to load on the N79 device

    This is my package file


    ; Installation file for DeviceBlocker application
    ;
    ; This is an auto-generated PKG file by Carbide.
    ; This file uses variables specific to Carbide builds that will not work
    ; on command-line builds. If you want to use this generated PKG file from the
    ; command-line tools you will need to modify the variables with the appropriate
    ; values: $(EPOCROOT), $(PLATFORM), $(TARGET)
    ;
    ;Language - standard language definitions
    &EN

    ; standard SIS file header
    #{"DeviceBlocker"},(0x20026B07),1,11,0

    ;Localised Vendor name
    %{"Vendor-EN"}

    ;Unique Vendor name
    :"Vendor"

    ;Supports Series 60 v 3.0
    [0x101F7961], 0, 0, 0, {"Series60ProductID"}

    ;Files to install
    ;You should change the source paths to match that of your environment
    ;<source> <destination>
    "$(EPOCROOT)Epoc32\data\z\resource\apps\DeviceBlocker_0x20026B07.rsc" -"!:\resource\apps\DeviceBlocker_0x20026B07.rsc"
    "$(EPOCROOT)Epoc32\data\z\private\10003a3f\apps\DeviceBlocker_0x20026B07_reg.rsc" -"!:\private\10003a3f\import\apps\DeviceBlocker_0x20026B07_reg.rsc"
    "$(EPOCROOT)Epoc32\data\z\resource\apps\DeviceBlocker_0x20026B07.mif" -"!:\resource\apps\DeviceBlocker_0x20026B07.mif"

    ;required for application to be covered by backup/restore facility
    "..\sis\backup_registration.xml" -"!:\private\20026B07\backup_registration.xml"

    ;Auto start resource file location
    "$(EPOCROOT)Epoc32\data\z\resource\apps\20026B07.rsc" -"C:\private\101f875a\import\[20026B07].rsc"

    ;Install the application finally to start the app once installation completed
    "$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\DeviceBlocker_0x20026B07.exe" -"!:\sys\bin\DeviceBlocker_0x20026B07.exe",FR,RI

    I think, i'm not installing the winscw binaries

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,752

    Re: Bluetooth Engine API fails to load on the N79 device

    Yes, generally it seems to be fine - if you build for GCCE and use Open Signed something.
    However since it does not install, you could experiment with commenting the files in the .pkg. When it suddenly starts to install, you will know which file is the problematic one. I would start with the .exe

  5. #5
    Regular Contributor
    Join Date
    May 2006
    Posts
    79

    Re: Bluetooth Engine API fails to load on the N79 device

    Hi Wizard,

    I just comment the following line on my .pkg file

    "$(EPOCROOT)Epoc32\data\z\resource\apps\20026B07.rsc" -"C:\private\101f875a\import\[20026B07].rsc"


    And moved the .exe to the top and removed the FR and RI

    "$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\DeviceBlocker_0x20026B07.exe" -"!:\sys\bin\DeviceBlocker_0x20026B07.exe"


    Now, its installed fine, but i could not open the installed application.
    If i click the application icon it stays desktop itself.

    Do you know any reason?

    Thanks,
    Karthikeyan.B

  6. #6
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Bluetooth Engine API fails to load on the N79 device

    How you sign your .sis file? You must use DevCert as minimal, because you are using UID from Protected range - 0x20026B07. Also you can't sign this .sis using Open Signed Online service.

    One more thing - on S60 3rd ed. FP2 and on 5th ed. you can turn bluetooth on/off trough using Central Repository:
    Code:
        CRepository* cenRep = CRepository::NewLC( KCRUidBluetoothPowerState );
     
        TInt state, err = KErrNone;  
     
        cenRep->Get( KBTPowerState, state );
     
       if( state == EBTPowerOff )
          {
           err = cenRep->Set( KBTPowerState, EBTPowerOn );
           ...
          }      
         else
          {
           err = cenRep->Set( KBTPowerState, EBTPowerOff );
           ...
          }    
          
         CleanupStack::PopAndDestroy();

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,752

    Re: Bluetooth Engine API fails to load on the N79 device

    If it is there just it does not start, you should enable the error messages: http://wiki.forum.nokia.com/index.ph...ded_panic_code

  8. #8
    Regular Contributor
    Join Date
    May 2006
    Posts
    79

    Re: Bluetooth Engine API fails to load on the N79 device

    Hi A.A.M

    Thanks for your suggestion....

    I'm using the Open Signed Online service and now the application is working if i removed the Bluetooth releated files and libs.(Using CBTMSettings , bteng.lib,btdevice.lib).

    The Central Repository approach is not working on the device, i've tested already. One of the wiki example, i found that the Central Repository gives the status of the bluetooth power state.

    Now my queries,

    1) why is the app getting closed when i used the bteng.lib and btdevice.lb?
    (These two libs got from the 3rd Edition MR extension pulgins' list and my Environment is S60 3rd Ed FP1 and the target device contains S60 3rd Ed FP2)

    2) Why cant i install the app using the Open Signed Online ? any specific reason?


    Thanks in Advance.

  9. #9
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Bluetooth Engine API fails to load on the N79 device

    Quote Originally Posted by bkarthik_be View Post
    Now my queries,

    1) why is the app getting closed when i used the bteng.lib and btdevice.lb?
    (These two libs got from the 3rd Edition MR extension pulgins' list and my Environment is S60 3rd Ed FP1 and the target device contains S60 3rd Ed FP2)
    Looks like newer devices don't use these libraries anymore. Code which was suggested in my previous post works on S60 3rd ed. FP2 and on 5th ed.

    Quote Originally Posted by bkarthik_be View Post
    2) Why cant i install the app using the Open Signed Online ? any specific reason?
    Read "Open Signed Online (BETA) Service Information" carefully ( https://www.symbiansigned.com/app/pa...ignedOnline.do ):
    ...
    - Alternatively the service will allow signing of SIS files with UIDs in the Test Range; i.e. 0xE0000000...0xEFFFFFFF.
    ...
    but you are using UID from Protected range.

  10. #10
    Regular Contributor
    Join Date
    May 2006
    Posts
    79

    Re: Bluetooth Engine API fails to load on the N79 device

    Hi A.A.M

    Thanks for the information.

    But the Central Repository is not working on my device(N79) that the reason why i went for the bluetooth API.

    I'm targeting all the 3rd edition devices.
    So, which will be the better way to do?

    Or

    Do i need to create a separate builds for the different FPs?

    Thanks in Advance.

    Karthikeyan.B

  11. #11
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Bluetooth Engine API fails to load on the N79 device

    Looks like would be better to create two different sis-files. One for S60 3rd ed. MR&FP1 and second for FP2&5th.ed

    Check this - http://discussion.forum.nokia.com/fo...37&postcount=8

    And also try to use Notifier API to turn on bluetooth:
    Code:
    // Uses the Notifier API to ask the user to turn on Bluetooth
    // if it's not on already.
    // ----------------------------------------------------------------------------
    
    TBool CBTEngine::TurnBluetoothOnL()
        {  
        RNotifier notifier;
        User::LeaveIfError( notifier.Connect() );
        TPckgBuf<TBool> dummy(ETrue);
        TPckgBuf<TBool> reply(EFalse);
        TRequestStatus status;
        notifier.StartNotifierAndGetResponse(status, 
            KPowerModeSettingNotifierUid, dummy, reply);
        User::WaitForRequest(status);
        notifier.CancelNotifier(KPowerModeSettingNotifierUid);
        notifier.Close();
     
        return reply();
        }

  12. #12
    Regular Contributor
    Join Date
    May 2006
    Posts
    79

    Re: Bluetooth Engine API fails to load on the N79 device

    Hi A.A.M


    Thanks a lot.

    But i dont like to show the notifier to the user. Because i need to do it without user interaction.

    Let me try your code.
    Keep update the result here.

    Thanks,
    karthikeyan.B

  13. #13
    Regular Contributor
    Join Date
    May 2006
    Posts
    79

    Re: Bluetooth Engine API fails to load on the N79 device

    Hi A.A.M

    I tested the Central Repository method to turn on/off the bluetooth power state on N79 but it didnt work.

    Could you please help me on this?

    Thanks in Advance,
    Karthikeyan.B

  14. #14
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Bluetooth Engine API fails to load on the N79 device

    Make sure that you have WriteDeviceData capability.

  15. #15
    Regular Contributor
    Join Date
    May 2006
    Posts
    79

    Re: Bluetooth Engine API fails to load on the N79 device

    Hi A.A.M

    Thanks ...

    After added the WriteDeviceData capability , my app able to change the status of the bluetooth powerstate but the bluetooth Icon is not yet displayed on the device.

    Its just change the bluetooth device power state as On nothing else it done.

    Could you please help me out of this?


    Thanks,

    Karthikeyan.B

Similar Threads

  1. Device Connectivity Tool fails to connect to Debug Agent
    By valichid in forum Bluetooth Technology
    Replies: 1
    Last Post: 2010-06-18, 20:06
  2. Problems with Bluetooth Engine API
    By mobilesolid in forum Bluetooth Technology
    Replies: 0
    Last Post: 2007-12-24, 16:32
  3. Bluetooth Security: What exactly is an untrusted device?
    By rahulmcs in forum Bluetooth Technology
    Replies: 1
    Last Post: 2005-12-02, 06:26
  4. Bluetooth discovery with device scanning
    By arto_koskela in forum Symbian
    Replies: 2
    Last Post: 2004-09-10, 08:40

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×