Screen off

Pachuquin

Member
Licensed User
Longtime User
Hi joel2009

Here you are a simple library to suspend your ppc.

Simply, call "Suspend" method.

Best Regards
 

Attachments

  • pachPower.zip
    2.2 KB · Views: 265

Ida

Member
Licensed User
Longtime User
Hello Pachuquin,

Hi joel2009

Here you are a simple library to suspend your ppc.

Simply, call "Suspend" method.

Best Regards[/QUOTE

Can you please show a little sample in Basic4PPC?
How can I implement your "pachPower" in a Basic4PPC-program?

I am a beginning programmer, so I don't know.


Ida
 

Cableguy

Expert
Licensed User
Longtime User
Go to "Tools" -> "Components".
Then locate the .dll file and add it, note that this is a device only dll...
After this go to "Tools" -> " Add Object"
An object called "pachPower" show be shown...
select it and insert a name to use it in b4p enviroment..

In your code you will first have to initialize the dll component..

Imagine that you nemed the object as "Power"...
Typing "Power." will sho the available method for the dll, and a "new" method should be present...
This is the initialization method..

"Power.new"

Then, anywere on your code, inside the same module, you can call any other method from the dll...

the available methods are:

SoftReset() Will soft reset the device
PowerOn() Will turn the device ON
PowerOff() Will turn the device OFF
PowerSuspend() Will put the device in Suspend mode


Hope this helps
 

Ida

Member
Licensed User
Longtime User
@Paulo:
thank you for your help!

Go to "Tools" -> "Components".
Then locate the .dll file and add it, note that this is a device only dll...

I do this -ok.

[/QUOTE]
After this go to "Tools" -> " Add Object"
An object called "pachPower" show be shown...
[/QUOTE]

"Add Object" is grey and I cannot select it.

[/QUOTE]
select it and insert a name to use it in b4p enviroment..

In your code you will first have to initialize the dll component..

Imagine that you nemed the object as "Power"...
Typing "Power." will sho the available method for the dll, and a "new" method should be present...
This is the initialization method..

"Power.new"

Then, anywere on your code, inside the same module, you can call any other method from the dll...

the available methods are:

SoftReset() Will soft reset the device
PowerOn() Will turn the device ON
PowerOff() Will turn the device OFF
PowerSuspend() Will put the device in Suspend mode


Hope this helps[/QUOTE]

The other points I cannot do so.

What's wrong at my program?

Please excuse my questions!

Ida:sign0085:
 

agraham

Expert
Licensed User
Longtime User
Ida;24722[/QUOTE said:
"Add Object" is grey and I cannot select it.
Even though the dll only works on the device it will need adding to the desktop as well in order for the IDE to be able to see the objects inside it. This is the reason that, for example, the Hardware and Outlook libraries have desktop dummy equivalents that (mainly) do nothing but do have the same objects and methods so that the IDE and the optimising compiler know about them.
 

Ida

Member
Licensed User
Longtime User
@Agraham

"Add Object" is grey and I cannot select it.
Even though the dll only works on the device it will need adding to the desktop as well in order for the IDE to be able to see the objects inside it. This is the reason that, for example, the Hardware and Outlook libraries have desktop dummy equivalents that (mainly) do nothing but do have the same objects and methods so that the IDE and the optimising compiler know about them.[/QUOTE]


thank you very much for your help!
I have explore many hours. but nothing helps, but after I take pachpower also to Desktop ( like you write), now "Add Object" is not grey and I can take it.
Thank you very much. I was so irritated.

Ida
 
Last edited:

Ida

Member
Licensed User
Longtime User
@Pachuquin:
Thank you for your nice dll!
What's the difference between PowerSuspend and PowerOff?

@Paulo and @Andrew:

Thank you for your helping! Now I have make a little sample.
It's all ok?

Ida
 

Attachments

  • Power.sbp
    1.2 KB · Views: 188

eww245

Member
Licensed User
I haven't tried this yet but PowerOn??

Does this library allow for unattended mode.

I'm just a bit confused on how it will turn on the device.
 

Zenerdiode

Active Member
Licensed User
I haven't tried this yet but PowerOn??

Does this library allow for unattended mode.

I'm just a bit confused on how it will turn on the device.

As 'devices' were essentially PDAs (before the OS was ported to telephones) they would switch on when an alarm was due. This library is exploiting that as it places a switch-on event on the notification queue. When off, the device isn't really off, just puts the CPU to sleep and can be prodded into action again from the Power button or the Notification queue.
 
Top