×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    18

    Vibra function in non-UI application

    Hi,

    Thank you for your attention. I now want to use the CHWRMVibra API in a non-UI application.

    I notice that there is a function:

    "ReserveVibraL (TBool aRestoreState, TBool aForceNoCCoeEnv)

    aForceNoCCoeEnv
    If EFalse, then reservation requires that this client has the keyboard focus at the time of reservation and vibra will be automatically released and re-reserved based on the keyboard focus status of the this client. This also implies that CCoeEnv::Static() != NULL is required. If ETrue, the client will not require CCoeEnv to be present nor does it automatically reserve/release vibra by depending on foreground/background status of the client. Only trusted clients are allowed to set this flag to ETrue. Client is considered trusted if it has nonstandard priority defined in the vibra policy. "

    which means that if I want to use the vibra function within a non-UI application, I must make my application trusted.

    But how can I find the "vibra policy"? And how do I find the "nonstandard priority"?

    Thank you!

  2. #2
    Super Contributor
    Join Date
    Nov 2005
    Location
    London
    Posts
    584

    Re: Vibra function in non-UI application

    It's not totally clear from the documentation, but do you actually have to reserve the vibra? Can you not just start it without reserving it for your application's sole use?

    Just a thought - but perhaps worth trying?

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    18

    Re: Vibra function in non-UI application

    Quote Originally Posted by stichbury View Post
    It's not totally clear from the documentation, but do you actually have to reserve the vibra? Can you not just start it without reserving it for your application's sole use?

    Just a thought - but perhaps worth trying?
    If EFalse, then reservation requires that this client has the keyboard focus at the time of reservation and vibra will be automatically released and re-reserved based on the keyboard focus status of the this client. This also implies that CCoeEnv::Static() != NULL is required. If ETrue, the client will not require CCoeEnv to be present nor does it automatically reserve/release vibra by depending on foreground/background status of the client.

    That means if I don't have a CCoeEnv, the vibra func will auto release = stopped.

    Maybe I need a try, thank you.
    Last edited by WhoKnows; 2008-05-14 at 10:43.

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

    Re: Vibra function in non-UI application

    If you search for *vibra*policy*.* in your SDK (I am not sure if Windows can do that, but most file managers can), you will probably find a file apparently containing priority-SID pairs (though the file is empty in the emulator). So you probably will not be able to push your application as a prioritized one.
    I guess these things are mainly for GUI-less server applications, such as the "famous" ncnlist.exe, needing to be able to use the vibra without being in the foreground (when an SMS arrives for example).

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    3

    Re: Vibra function in non-UI application

    I am also trying to make a S60 3rd edition phone vibrate from a background application. So far without any success.

    wizard_hu: the file you're referring to is called hwrmvibrapolicy.ini and can be found in data/z/private/101f7a02 and release/winscw/udeb/z/private/101f7a02. I tried adding a line containing the priority and the SID of the application to these files:

    10 0xE3BF0000

    I still found no way to make vibra work on the emulator or on the device. I get KErrAccessDenied from the function ReserveVibraL(EFalse, ETrue) or StartVibraL(1000) (if called without ReserveVibraL).

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: Vibra function in non-UI application

    I do not think that vibra support would work in the emulator, I just wrote about that file because it is highly probably that it also exists on the device, and it is not empty.
    So my guess is that only a few applications are capable of reserving the vibra - note that you can not modify that file on the device without having AllFiles capability.

  7. #7
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    85

    Re: Vibra function in non-UI application

    I'm now having problems trying to access the Vibra functions in a console app.

    The problem arrives in ReserveL. Because it is non-GUI, ForceNoCCoeEnv has to be set to ETrue otherwise KErrBadHandle is returned

    But when ForceNoCCoeEnv is ETrue, KErrAccessDenied is returned, which means that my application is not trusted.

    How do I make my application trusted? I tried Opensign but it doesn't work

Similar Threads

  1. Launching a dialog when the application starts
    By Uriah Eisenstein in forum Symbian User Interface
    Replies: 10
    Last Post: 2009-03-31, 09:06
  2. Porting existing application from Sun Wireless tookit 2.3 to Carbide.j 1.5
    By vgps in forum Tools and SDK Feedback (Closed)
    Replies: 3
    Last Post: 2007-06-30, 18:02
  3. Launching a view of a diffrent application
    By nsivach in forum Symbian
    Replies: 3
    Last Post: 2007-03-22, 09:51
  4. Bringing application to foreground
    By ash_bhatia in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-11-02, 13:39
  5. Changing the ordinal position of an exteranl application.
    By Shaikuny in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-12-30, 07:32

Posting Permissions

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