umarniz / TouchPlusLib

Code to access video stream for Ractiv Touch+
https://medium.com/@Rapchik/hacking-the-ractiv-touch-79a02aa003e
19 stars 4 forks source link

Led light control? #1

Closed shadowmite closed 9 years ago

shadowmite commented 9 years ago

Have you determined how to control the LED lights yet? Figured I'd ask before I load up Ida. or perhaps you have a Ida database you would be willing to share?

shadowmite commented 9 years ago

Nevermind, I got "around to it" and launched IDA myself. So I'll go ahead and give you the details in case you want it also:

int GetGPIOValue(int param, uint* value); int SetGPIOValue(int param, uint value); int ret = 0; uint GPIOValue = 0; ret = _GetGPIOValue(1, &GPIOValue);

Will get you the current GPIO lines in the range of the LEDs (1)(who knows how many more ranges there are, I tried a few...)

byte lo = b.LoByte(b.LoWord(GPIOValue)); lo = (byte)(lo & 0xF7);
// & F7 will turn off bit 3 in the LoByte, bit 3 seems to be our IR LEDs ret = _SetGPIOValue(1, lo);

lo = (byte)(lo | 8);
// | 8 will turn on bit 3 in the LoByte, bit 3 seems to be our IR LEDs ret = _SetGPIOValue(1, lo);

bit 3 is our magic bit turn it on/off to control the leds. Hope this helps you.

shadowmite commented 9 years ago

Accelerometer data is:

int GetAccMeterValue(int* x, int* y, int* z); int x = 0, y = 0, z = 0; ret = _GetAccMeterValue(&x, &y, &z);

umarniz commented 9 years ago

Hey Matthew,

Good to see you adding features to the library.

Ill gladly merge them into the core library if you can send a patch.

Cheers!

On Fri, Mar 13, 2015 at 9:29 PM, Matthew Fogle notifications@github.com wrote:

Accelerometer data is:

int GetAccMeterValue(int* x, int* y, int* z); int x = 0, y = 0, z = 0; ret = _GetAccMeterValue(&x, &y, &z);

— Reply to this email directly or view it on GitHub https://github.com/umarniz/TouchPlusLib/issues/1#issuecomment-79103778.

Regards, Umar Nizamani www.nerdiacs.com

shadowmite commented 9 years ago

Sorry I actually am writing my code in C#, so a patch would do you little good. Just wanted to give you the function prototypes in case you wanted to add them for your own purposes at some point. :)