Program Request - Power Disconnected Alarm - Windows Mobile Development and Hacking General

When I switch off the ignition in my car, I would like my Artemis to play a sound to remind me to remove it from the cradle
Xould anyone write such a thing ?

hays said:
When I switch off the ignition in my car, I would like my Artemis to play a sound to remind me to remove it from the cradle
Xould anyone write such a thing ?
Click to expand...
Click to collapse
How would the program know that you switched off your car? Since PDA is still getting charged from the battery..

Once you remove the ignition key, the batt stops supplying power to the lighter port in the car. (atleast on most cars)

look at my post here... i think you could easily adept the script to your needs...
you need to read a bit about mortscript... google for it... the official manual is good...

test this.... checks every 5 seconds and plays a sound if the power cable is disconnected... you can edit sleep(5000) to a lower value to check more often...
Code:
y = 1
While( y = 1 )
x = ExternalPowered()
if (x = 1)
While( x = 1)
x = ExternalPowered()
sleep(5000)
EndWhile
PlaySound(\Windows\xyz.wav)
EndIf
Sleep(5000)
EndWhile
you need to modify xyz.wav to a soundfile you like in the windowsfolder.
Install Mortscript from here
safe the script in a file called playsound.mscr on your device and run it from there... if it works well move it to \Windows\Startup ......
i have not testet this script... just try it...

Related

Registry hack to turn off flashing LEDs - and phone Vibrate

To turn off all of the flashing LEDs (Blue LED from coming on with Bluetooth, Green for phone signal, Yellow for charging, etc), go to:
1. Hkey_Local_Machine/Drivers/Builtin/AllLEDMgr
1a. Change the Index value below it to "0" (by default it is set to "1")
Soft Reset and the LEDs will not turn on.
There is also an "LEDMgr" key at the same level, but it does not seem to have any effect.
This is a variant for the Magician of the original Blue angel thread:
http://forum.xda-developers.com/viewtopic.php?t=18861
Enjoy! (Finally, I can sleep with the jam on the end-table next to me at night ;-) )
I'm waiting for the hack/program that makes my LED pulsate instead of blink, like some laptops when in suspend mode.
Trick included in version 3.6.0 of Tweaks2k2 released today!
More info at www.tweaks2k2.com/downloads.htm
That's how I like it... grabbing the infos for free and integrating it into a commercial product.
The same has been with NetFilter code already in hardware appliances - they've been charged for it!
You should at least offer the original poster a license free of charge for gaining from his efforts.
Actually he did
Chatty,
I contacted Ctitanic to let him know about this key. He offered me a free license days ago, and I have been testing the new version for him. I wanted those who were uncomfortable hacking the registry to have access to this.
Sorry we didn't let you know first. Open mouth, remove foot ;-)
*ClickEditSelectAllDeleteSave*
Did I say anything? I always said, ctitanic is such a nice and humble person. I deeply honor his work.
Chatty said:
*ClickEditSelectAllDeleteSave*
Did I say anything? I always said, ctitanic is such a nice and humble person. I deeply honor his work.
Click to expand...
Click to collapse
jajajaja
it´s a no written policy of me to give free copies to those sending me hacks that are included in Tweaks2k2. If I find a little time I will write it down at my site so every body knows about it. But for now let me write it here
I GIVE FREE COPIES OF MY PROGRAM TO THOSE WHO SEND ME REGISTRY HACKS IF THOSE HACKS ARE APPROVED TO BE INCLUDED IN FUTURE VERSION OF THE PROGRAM.
:twisted:
Bummer :-(
I just verified that this registry hack also disables the vibrate function on my phone also :-(
Due to this, I'm backing off the hack (vibrate is more important to me). Doen't ask me why AllLEDMgr is controllling the vibrate function, but it is. I played with this area of the registry for a while, and couln't find a way to disable the LEDs, and have vibrate working. If anyone else does, let me know. Otherwise, I guess it's time for black electrical tape over the LED for me.
I'll let ctitanic know.
dschur said:
Bummer :-(
I just verified that this registry hack also disables the vibrate function on my phone also :-(
Due to this, I'm backing off the hack (vibrate is more important to me). Doen't ask me why AllLEDMgr is controllling the vibrate function, but it is. I played with this area of the registry for a while, and couln't find a way to disable the LEDs, and have vibrate working. If anyone else does, let me know. Otherwise, I guess it's time for black electrical tape over the LED for me.
I'll let ctitanic know.
Click to expand...
Click to collapse
Well, I´ll add this to the list of known issues. I think that for some people the hack is good even when it disables the vibration. In another hand, you can apply the hack during the night and activate the LEDs back in the morning
Is it possible to turn of LEDs/vibrate without a soft reset?
Technically yes... you have to end the service via a system call. One would have to implement this in a tiny program. Could be useful in apps like PZP - so go and tell zendrui
I'm using the Wizard with WM5 (Norwegian ROM), and I can't seem to find the AllLEDMgr key in the registry. Is this tweak for WM5?
@pborthwick: It is for the Magician... you posted in the Magician forum! The Magician is WM2003 btw.

enable / disable bluetooth when on power / battery ?

is there an application that can do this already?
Basicaly when I get in my car I need blutooth on, the first thing I do is put the phone into the car charger. I also use bluetooth when the phone is charging at home, the rest of the timwe i dont need it but if i forget to turn it off then it burns battery power.
so I want an app that can enable bluetoth when a charger is connected and disable it when a charger has been disconnected for X amount of time.
Thanks
hey =)))
wow.... i created such an "app" and posted it here..... but there was absolutely NO response.... i thought noone would need it =)....
the app i created is just a little script for MortScript...
so you have to install Mortscript first...
get it from google.... Version 4 is the newest...
then extract the atached file...
1. place blue.exe in \storage card\Programme\blue.exe (or change the path in the blue.mscr file its just a simple text file)
2. copy autoblue.mscr in \windows\startup
softreset
the script checks every 5 seconds if the power cable is plugged in... if it is it switches on bluetooth..... then it checks every 5 seconds if its plugged out and turn bluetooth off... and this goes on and on and on ......... =)
P.S: blue.exe is not my program... but i cannot find out where i have it from so i atached it in the zip file...
btw.... this is the original post
http://forum.xda-developers.com/showthread.php?t=316747
nice 1 m8 ile try it tonight,
This is uery usefull, thank you!
I tested and works ok for my qtek 8500, but doesn't work for my ipaq hx2490.
dancer_69 said:
This is uery usefull, thank you!
I tested and works ok for my qtek 8500, but doesn't work for my ipaq hx2490.
Click to expand...
Click to collapse
The blue.exe file turns on or off bluetooth... maybe its not possible on ipaq hx2490?!?!?! if you find a similar application witch works for your device you can simply change to it in the script...
This sounds good but do we want something checking on our PPC's every 5 seconds? Can't mortscript tell when the phone is in charge mode THEN turn on BT?
Also I think there is a program by the SKTools people called SKshedule or something that will run a prog when the power is plugged in. For all I know though it also checks every 5 seconds...

Hp Ipaq 6965 totally no sound.

there is no sound coming out from my phone, unless i plug in my handsfree.
can anyone help?
tried http://forums11.itrc.hp.com/service...47626+1210087650634+28353475&threadId=1069124 but it doesnt work.
please help.
Hi
The problem is tha there is a mechanical switch that disables your pda's speaker when you plug in the handsfree
This switch gets stuck! A light bump to the pda might correct this, but might also do other damage! OWN RISK!!!
Plugging an removing the handsfree might also let it come unstuck . . .
yup tried that b4. plug in my handsfree and quicky give it a quick tug. still the same though.
try slowly?
i found a thread http://forum.xda-developers.com/showthread.php?p=2122475
but i cannot rename btcore.dll using my windows explorer from my activesync.
how to rename them??? or jambongo can u send me the 2 files from ur phone?
admin22 said:
i found a thread http://forum.xda-developers.com/showthread.php?p=2122475
but i cannot rename btcore.dll using my windows explorer from my activesync.
how to rename them??? or jambongo can u send me the 2 files from ur phone?
Click to expand...
Click to collapse
use a trial of : RESCO EXPLORER
files name changed. problem still persist. still no sound.
Go to electronic shop and ask for spray of "contact renew "
Take the battery out
See if the spray attacks the plastic or paint at a hidden corner on the device then if ok
Spry just a bit in the hole of the plug
If you can only have drops of it into the hole then play with the headset plug
Let it stay for 5-6 min then insert battery and have a look into it
If it did not help repet the process of spry &play but do not have lots of liquid in one time it may cause a short circuit
good luck
ps - you can consult with the store (can not remember the name but in the us i think like "radio shek" or something)
undo the file games by hr your device
For the next time (god forbidden) to be on the safe side that it is the switch just go to your headset settings on start/settings/sys
If you can enter the settings and do not have a note that your headset mast be plugged in first -then it is that switch
If you get that note you must search for a 3part app like profile or speaker failure
okie icic...i have a can of CO2 it can clean contact...works like zippo fluid but evporate faster. will try it tonight. never occured to me to try tt. i tot its my speaker problem. Thanks EREZYAD's

TVout Reg hack-correction

I am not sure how this happened, Ive also tried to find and make a hack myself. But this is beyond my abilities.
Mt problem is with the Tvout on my TP2 (Rhodium).
I've tried:
1) Disabling the HKLM> Software> HTC> H2W> TVoutCablein "0" .
But every time I restart my phone it goes back to "1".
2)b I've Task29 twice and tried 3 different ROMs. There results are mostly the same. Bit that value always returns to "1".
3) I also tried to disabling Tvout "0" and TVoutPopUp "0", both in the HTC reg folder. I've tried many different combos also. Still no love from my phone.
4)I also tried enabling the Software> OEM> Tvoutsettings. Changed Hiddenconnectset value to "1"
What's happening is this; When I boot my phone I can hear the boot wav file. Then a few seconds later the TV out pop-up asks for the type. What I have been doing is hitting the Win menu hard button and killing the tvoutpopup with task manager. I would think everything would return to normal. But it does not. I get no sound from my speaker. No rings, music, nothing. I can talk to people but I cant hear through the ear piece either. However, if I connect the a set of headphone to the 3.5 jack I can hear and talk. But the sound quality suck like a brand new Hoover vacuum.
I believe my problem is in one or both of the following places.
1) It might be the OEM_Misc.dll file that has some Tvout stuff going to it. I am not sure what else is contained in the file.
2) It might also be in the HTCTVout.exe
It seems to me like after the boot, the phone scans the mini usb and it thinks there is a TV out cable connected. I have check the port for trash or anything that might make a connection, but its clean. But I should still be able to force a new value in the reg and make it stick. But it returns every time. I cant delete the reg. folder it seems protected. Nor can I delete the .exe file or .dll file. They also seem to be protected.
Any help?
Thanks
Nick

[WIP] Headset buttons detection

Hi,
I wrote a patch to make the Moto G recognize the buttons of headsets/headphones. The hardware is capable of detecting the buttons, Motorola simply didn't write the code for it because at the time Android was not able to make use of them.
I have a minor problem that I can't easily overcome without help.
The chip that takes care of the detection simply reports some value when a button is pressed and this value depends on the specific headset used. It's up to the kernel decide what to do with that value. Each headset implements the buttons in a different way, so I need to gather some data. I think there's some sort of standard in the industry, so probably it will be possible to implement a generic solution (how can other devices do that otherwise?).
At the following address, you can find a simple patch that makes the kernel print that value whenever a button is pressed. It really does nothing other than that.
Code:
https://pastebin.com/raw.php?i=h9dnhmKr
To get the data I need, run from Terminal Emulator/adb the following (as root):
Code:
cat /proc/kmsg | grep TPA
(the command must be stopped manually: close Terminal Emulator/Ctrl+C/Vol down+C etc...)
Now, every time you press a button, you should see a new line (maybe more), for instance:
Code:
<6>[ 97.148228,0] TPA: value: 67
I'm interested in those values and their corresponding button, i.e. the button you pressed to get the line.
The value is not constant, you'll get different values for the same button. It's not a problem.
EDIT: I forgot to mention that the prebuilt kernel here below is for falcon. If you are using CM made for falcon, then this image is OK.
At the following address you can find a prebuilt kernel image made for the current CyanogenMod 12.1, anything not too distant from the currently nightly should be fine (I built the kernel three days ago) (do whatever you want with this prebuilt image, mirror it, repackages it etc...):
Code:
https://mega.nz/#!7A4SjQqZ!DPzO18k56e9364PciH7RC6rVCbrkuuUyqAcX9eFyd4I
Sources:
Code:
https://github.com/CyanogenMod/android_kernel_motorola_msm8226/ at acfe66c6fee + patch linked here above
If you want to test the prebuilt kernel image without flashing it, use fastboot:
Code:
fastboot boot path/to/the/boot.img
In this way, all you need to go back to your kernel is rebooting the phone.
PS: Most likely headsets made by Apple won't be recognized.
Any chance of doing the same work for Peregrine (XT1040)? Very interesting reading by the way...
If you want to know whether peregrine can detect these buttons or not, the answer is yes. Peregrine uses the same chip, if I saw things correctly (which also means it uses the same kernel driver).
If you want a bootable image, I might be able to provide one, but it would be better if someone with a peregrine does that. The patch can be applied as is.
@tpa-moto great work
i personally feel this thread suppose to be in development sub forum.
Hi, great work! This is a sore spot for me because I want to use one of those selfie sticks that plug in as a headset
I followed your instructions and pressing the button of the selfie stick gave no output. It does, however, work normally on another phone I have access to (LG G3 Beat).
I plugged in a headset with a microphone, but no volume buttons. Holding the mic button on the headset activates voice search as it should, but pressing it logs no lines.
While plugging the headset in and out however, I get some erroneous triggers. The jack has 3 black bands, and a sample of the keycodes I'm getting by plugging the jack in and out two times is below.
I know this is not exactly the data you're seeking but it's all I can generate right now, I don't have a headset with a volume button, other than the selfie stick (which is supposed to emulate a volume button, and does so, on the other phone). I'm posting in the hopes that it's useful somehow. Thank you for your hard work and best of luck!
<6>[ 615.271014,0] TPA: value: 13
<6>[ 615.370970,0] TPA: value: 23
<6>[ 615.470890,0] TPA: value: 25
<6>[ 615.570900,0] TPA: value: 26
<6>[ 620.080889,0] TPA: value: 13
<6>[ 620.181147,0] TPA: value: 14
<6>[ 620.280899,0] TPA: value: 14
<6>[ 620.380899,0] TPA: value: 24
<6>[ 620.480906,0] TPA: value: 24
<6>[ 620.580912,0] TPA: value: 24
<6>[ 620.690932,0] TPA: value: 24
<6>[ 620.790923,0] TPA: value: 24
<6>[ 620.890936,0] TPA: value: 26
<6>[ 620.990932,0] TPA: value: 25
<6>[ 621.090917,0] TPA: value: 24
<6>[ 621.191007,0] TPA: value: 25
<6>[ 621.290872,0] TPA: value: 24
<6>[ 621.390886,1] TPA: value: 24
<6>[ 621.500946,0] TPA: value: 24
<6>[ 621.600897,0] TPA: value: 12
<6>[ 621.700952,1] TPA: value: 13
I followed your instructions and pressing the button of the selfie stick gave no output. It does, however, work normally on another phone I have access to (LG G3 Beat).
Click to expand...
Click to collapse
I didn't even know these existed. I just looked it up and it seems that selfie sticks simply send a volume up/down keypress. If nothing gets printed, then the stick is most likely not detected. I see some comments in the code mentioning workarounds for some accessories (e.g. Paypal card reader, Jawbone), probably your selfie stick needs something similar. Needless to say it's really hard to debug the problem without actually owning the stick.
You could try to see if something gets printed when you insert the jack:
Code:
cat /proc/kmsg
(this will print a lot of stuff and then stops. Insert the jack once no lines/almost no lines are printed).
Debug messages are disabled, so it's unlikely you'll see something useful.
I plugged in a headset with a microphone, but no volume buttons. Holding the mic button on the headset activates voice search as it should, but pressing it logs no lines.
Click to expand...
Click to collapse
The chip detects two types of buttons presses and the kernel driver currently does something only for one of them.
If the phone is responding to button presses, the patch I wrote should make no difference as the kernel is already doing what's supposed to do. Most of the headsets with a single button work (e.g. the ones Motorola shipped with this device in some countries). If they have multiple buttons, at most one of them work.
If the phone does not respond to button presses, then this patch should make the kernel print lines similar to the ones you posted.
Also, the patch I posted/applied to the kernel is very simple and doesn't try to avoid spurious events.
I merged this patch to my kernel, however the compiler gave me this while building:
Code:
sound/soc/codecs/tpa6165a2.c:836:13: warning: 'tpa6165_detect_multi_button' defined but not used [-Wunused-function]
static void tpa6165_detect_multi_button(struct tpa6165_data *tpa6165)
^
Is this normal? I'm using GCC 5.2.1 + a modified Uber 5.2 toolchain to build my kernel
That's definitely not normal. Did you use patch to apply the patch? If not, check again what you did.
tpa-moto said:
That's definitely not normal. Did you use patch to apply the patch? If not, check again what you did.
Click to expand...
Click to collapse
Actually i had edited the file manually but i've reverted my commit and then used patch to apply the patch. No more build warnings
Did anyone send him some values privately atleast? I personally did, honestly, i can keep doing what i do right know, building the kernel myself with the patch from gerrit and values for my current headset and i get all the buttons working perfectly, he is just doing you a favor and he is asking just a 1 minute of your life to get those values from /kmsg, because the official implementation of this feature on CM or any other ROM, depends on how much users will report those numbers, i really don't care about this, because, i repeat, that i already did my job and sent him the values of my headsets and i can still compile the kernel myself with the working patch for my headsets. I don't believe there is no one that owns an headset with buttons, just do something useful, instead of flashing 4 different ROMs in 2 hours, flash this kernel and report those values, thanks.
It's also true that probably not many saw this. In any case, I'm not sure we will be able to collect enough values to have anything that can be made "official".
@zackwire Sorry, I didn't bother making an image for peregrine yet.
tpa-moto said:
It's also true that probably not many saw this. In any case, I'm not sure we will be able to collect enough values to have anything that can be made "official".
@zackwire Sorry, I didn't bother making an image for peregrine yet.
Click to expand...
Click to collapse
I don't really understand what you're supposed to do to get the values. Are you able to elaborate a bit more? I'd really like to help out, but I'm not sure what I'm supposed to do.
Also, how many values do you need?
ahmad.o said:
I don't really understand what you're supposed to do to get the values. Are you able to elaborate a bit more? I'd really like to help out, but I'm not sure what I'm supposed to do.
Also, how many values do you need?
Click to expand...
Click to collapse
There isn't much to add to what I already wrote.
Boot the kernel using fastboot and use adb or Terminal Emulator to run the followings:
Code:
su
cat /proc/kmsg | grep TPA
The second command should print a line each you press a button of you headset.
Each button is ideally associated to a value, in practice you'll get different values all close to each other, one per button press. You shouldn't get many different values, once you notice that you can't get anything you didn't get before, you can stop.
Note: I'm also interested in knowing which button generated which line.

Categories

Resources