[Q] XDA Facebook app error log - HD2 General

HI and before every one shouts I tried to post this in correct but due to not having enough posts i am restricted in that topic but here is my problem and maybe someone can forward this error log to the right section i would appreciate it...
System.NullReferenceException
NullReferenceException- at XFControls.Utils.ImageHeader.GetDimensions(Byte[] array)
at XFControls.Utils.XFGraphics.DrawMemoryStream(Graphics g, Rectangle recDest, Byte[] pbBuf, Boolean maintainImgRatio, Boolean exception)
at XFControls.Utils.XFGraphics.DrawMemoryStream(Graphics g, Rectangle recDest, Byte[] pbBuf, Boolean maintainImgRatio)
at XFControls.Utils.XFGraphics.DrawMemoryStream(Graphics g, Rectangle recDest, Byte[] pbBuf)
at XFControls.XFPanels.XFPanelItems.XFItemBase.DrawImage(String uri, Graphics g, Rectangle rec)
at XFControls.XFPanels.XFPanelItems.XFItemProfileHead.ItemPaint(Graphics g, Int32 x, Int32 y)
at XFControls.XFPanels.XFPanelList.RenderItemBuffer(IXFItem item, Boolean gc)
at XFControls.XFPanels.XFPanelList.PanelPaint(Graphics g)
at XFControls.XFPanels.XFPanelBase.setupSlideBuffer()
at XFControls.XFPanels.XFPanelBase.panelSlide()
at XFControls.XFPanels.XFPanelBase.EnableSlide()
at XFItemControls.XFPanels.XFPanelItems.XFIconFriend.OnClick()
at XFControls.XFPanels.XFPanelIcon.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
at System.Windows.Forms.Application.Run(Form fm)
at XDAFacebook.Program.Main()
thank you in advance

XDAFacebook Error.log,
Hey there,
the same reason like the post before.
I´m not allowed to post my error.log in the correct thread.
Problem running XDAFacebook and fim, both need .net framework.
I think the problem is caused by .Net Compact Framework 3.5.
I downloaded the actual version at MS, but when installing it stops and i get an error "... a newer version is already installed..."
installed version is 3.5.9198.0 (see attached MS .net.log)
Thanks in advance...

Related

No easy way to send AT commands to COM 2 ?

I'm total newbe to XDA2.
I want to do very simple thing. Send AT command to modem a get OK response. I can set XDA2 into Wireless Modem mode and do it from PC using any terminal client without any problems. But i cannot do it from XDA2 device.
I tried to use some terminal clients for PPC, but when I send AT there was no response.
I also tried http://www.opennetcf.org/samples/SerialCSharp.zip but the result was the same.
I've just wanted to send some string (AT) to serial port and get response (OK) using opennetcf libs or any other which I could find for .dot net.
Opening this port is success. But that's all.
I'm not good in C++ , but there is any simple way to do that ? Or I need to study file gsmdevice.cpp from XDAunlock-src ?
I believe you have to call a IOCTL-function or something to enable the internal COM2-port, before writing to it.
There is an example posted in this forum. Search on DeviceIOControl.
Thanks a lot for tips. I see there is many things to learn for me about XDA :shock:
I wanted to send "AT+CREG?\r" command. I've found that there is a function called RIL_GetRegistrationStatus in ril.dll
So I wrote class in C#
Code:
public class rw
{
[DllImport("ril.dll")]
public static extern IntPtr RIL_Initialize (int dwIndex, IntPtr pfnResult, IntPtr pfnNotify, int dwNotificationClasses, int dwParam, out IntPtr lphRil);
[DllImport("ril.dll")]
public static extern IntPtr RIL_Deinitialize (IntPtr hRil);
[DllImport("ril.dll")]
public static extern IntPtr RIL_GetRegistrationStatus (IntPtr hRil);
}
and use it
Code:
IntPtr hril, res, res2;
res = rw.RIL_Initialize(1, IntPtr.Zero, IntPtr.Zero, -1, 0, out hril);
res2 = rw.RIL_GetRegistrationStatus (hril);
MessageBox.Show (res2.ToString());
rw.RIL_Deinitialize (hril);
But I think that it doesn't work Or maybe I do something wrong
There is no errors but result is -2147024809

Detecting SIM card...

Helloooooo
does anyone know how I can find out if a SIM card is installed?
I'm programming for Windows Mobile 2003.
The OpenNETCF only provides methods to get information about the SIM card itself (phone number, provider and so on) but I don't see a possibility to get (for example) a simple boolean value if there's a SIM card installed at all...
Thank you very much in advance.
Alex
the answer is in your post.
you qouted "phone number, provider and so on)"
Try and obtain this information. If it is not there then the only logical conclusion is that there is no SIM card installed.
cheers
steve jubb
Hi Steve,
this is the method I actually use:
Code:
unsafe public static bool isSimInstalled()
{
IntPtr hSim, res;
res = SimInitialize(IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, out hSim);
if (res != IntPtr.Zero)
return false;
Byte[] buffer = new Byte[516];
fixed (byte* pAddr = buffer)
{
res = SmsGetPhoneNumber((IntPtr)pAddr);
if (res != IntPtr.Zero)
return false;
}
return true;
}
There's just one little problem: this method always returns FALSE (doesn't matter if a SIM card is installed or not).
About a week ago I read a thread (in another forum) that discussed a similar problem. People there said that not every SIM card has a phone number... I don't know if it's true but IF it's the truth... I've got the same problem...

FTP Server for Windows Mobile (.NET CF2.0)

Hi,
I just managed to get my ftpServer ready. I was a bit bugged by exchaning Files using ActiveSync or MicroSD Memorycard. So I started to develop this little tool and now that it starts being useable, I would like to share this with you.
http://www.megaupload.com/de/?d=Q0UBFMS4
I tested it with some cheap ftpclients like ftp-Commandline in linux, FireFTP for Firefox or cuteftp.
Notice, that it only supports passive ftp-filetransfers, so windows commandline ftp won't work. It also can't display real filesizes and filedates. The one's xfer'd are fake! There is no authentification needed to login. It just lets in every user.
There is no multithreading support. Once there is one connection estabished, the server is full! Only one data-transmission at a time!
There still might be some little bugs and timingproblems but, like I said before, I think ist kind of usable for small tasks.
I have to add that I take no responsibility for possible loss of data and stuff like that. Of cource, I did'nt make any effords to destroy anything, though. You use this thing on your own risk.
Good job bro, keep on the dev please!
Doesn't work on my HD2 :
ftpServ.exe
SocketException
於 System.Net.Sockets.Socket.Bind(EndPoint localEP)
於 ftpServ.MNsocket..ctor(Int32 port)
於 ftpServ.mnServerThread.mnStartServerThread()
於 ftpServ.Form1.menuItem3_Click(Object sender, EventArgs e)
於 System.Windows.Forms.MenuItem.OnClick(EventArgs e)
於 System.Windows.Forms.Menu.ProcessMnuProc(Control ctlThis, WM wm, Int32 wParam, Int32 lParam)
於 System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam)
於 System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
於 Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
於 System.Windows.Forms.Application.Run(Form fm)
於 ftpServ.Program.Main()

[APP][Discontinued] SSMaPa (Alpha) 0.2.4.3

[size=+2][Discontinued] SSMaPa (Alpha) 0.2.4.3 [/size]
use ssmaho instead:
http://forum.xda-developers.com/showthread.php?t=493810
Hi,
I created a little MAnillaPAtcher. For example this tool is useful if you want start another calendar when clicking in TF3D on a entry.
this version is for Manila3D and Manila2D devices!
Currently implemented EXEs which can be changed:
calendar.exe
tmail.exe
WLANSettings.exe
poutlook.exe
OperaL.exe
Camera.exe
AudioBooster.exe
Click on Time
(Click on alarm)
Phone Settings
Bluetooth Settings
Sound Settings
----
Mod EDIT By MDAIIIUser
If you are HTC HD user or if you can not see all the Dirs in the File Picker then read this post.
http://forum.xda-developers.com/showpost.php?p=2934377&postcount=14
End Mod EDIT
---
If you have further elements, that you would like to change, write it to me and I will test if I'm able to integrate them.
Using is simple:
-> Start application
[size=+2]-> Choose Configuration[/size]
-> Click 'Init' (The Application will now check which patches are available, and make a security backup if your manila. This can take some secoonds)
-> Choose the file you want to change, tick 'Patch' and enter your prefered file. Click on Save.
Note: The '$' in arguments is for using the original commandline from manila. You can enter some other arguments before of this, but not after!
-> Change to the next Tab and click on 'Deploy' (this can take some minutes)
[size=+2]Note for Rom Cookers:[/size]
You can add your own conifurations. Simply add a file named ssmapabaseconf_[smt].xml (for example ssmapabaseconf_ElviraROM.xml) in same folder as ssmapa is, and add there your manila configuration in following format:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<SSMapaBaseConf>
<SSMaPaBaseConfiguration>
<ConfigurationName>Touch Flo 3D</ConfigurationName>
<CustomLibrary></CustomLibrary>
<ManilaFilename>manila.exe</ManilaFilename>
<ManilaTodayStartFilename>manila.exe</ManilaTodayStartFilename>
<ManilaTodayDLLFilename>ManilaToday.dll</ManilaTodayDLLFilename>
<RegistryManilaPluginName>TouchFLO 3D</RegistryManilaPluginName>
<ExtendedInitState>0</ExtendedInitState>
</SSMaPaBaseConfiguration>
<SSMaPaBaseConfiguration>
<ConfigurationName>Manila2D</ConfigurationName>
<CustomLibrary></CustomLibrary>
<ManilaFilename>manila2d.exe</ManilaFilename>
<ManilaTodayStartFilename>manila2d.exe</ManilaTodayStartFilename>
<ManilaTodayDLLFilename>set it</ManilaTodayDLLFilename>
<RegistryManilaPluginName>set it</RegistryManilaPluginName>
<ExtendedInitState>0</ExtendedInitState>
</SSMaPaBaseConfiguration>
</SSMapaBaseConf>
You don't have to softreset your device, simply touch on today and the new manila.exe will start.
Theoretically you should get a warning for every changed file on executing it the first time, but only once. If something will ist not working, make sure your phone is fully applicationunlocked.
The Application doesn't need to be started again, it should work till the next hard-reset.
For all with UnauthorizedAccessException:
Try again with 'Extended Init' ticked. Unfortunatelly I don't have a such phone, and couldn't test if it's really working.. would be happy if you can give a small feedback.
----
If your files are signed, you're asked if you want to unsign them.
Please note, I didn't find a way to remove the signatures in a 'correct' way. I did an exe-based-deactivating. This is ok, as long as you don't want to resign them. If you want to resign them with your own certificate chose no and do it yourself.
I don't think that this tool is able to destroy something on the phone. Never mind, I'm not responsible for any damages.
Sample:
If you want the calendar to start in your favorite view and not in Agendaview, enable patch on calendar.exe an simply remove '$' from arguments.
Please donate for me! I'm a apprentice and use a lot of my free time for working on the computer, to be able to create such tools.
[size=+2]Thank you [/size]
Received Donations:
10 Euro / skw21 / 01.08.2008 / Thank you very much!
10 Euro / J. Thomas / 12.11.2008 / Thank you !
10 Euro / Sachmet / 21.11.2008 / Very nice! Thank you !
10 Euro / HamerPlyr / 08.12.2008 / Thank you !
10 Euro / msalimov / 11.12.2008 / Thank you very much.
10 Euro / A. Caredda / 10.01.2009 / Nice! thank you
10 Euro / ninalee123 / 30.01.2009 / Thank you! I'm happy it helped
10 Euro / M. Harris / 09.02.2009 / Many Thanks
5 Euro / stuartforrest / 14.07.2008 (first donation thank you)
5 Euro / puky69 / 15.07.2008 thank you
5 Euro / Netto2 / 17.07.2008 thank you & greetings to Göttingen
5 Euro / V. Arko / 22.07.2008 / Thank you
5 Euro / S. von Keitz / 06.10.2008 / Thank you
5 Euro / M. Barrotta / 24.01.2009 / Thanks
5 Euro / G. Ryska / 02.02.2009 / Thanks
5 Euro / Trident / 25.02.2009 / thx you
4 Euro / R. Schneider / 09.02.2009 / Thank you
Changelog:
Version 0.2.4.3 (29/01/2009)
- fixed bug when starting from root directory
- fixed bug 'Time click' not shown on Manila2d
- fixed bug 'Could not patch todaydll. That's fatal in alternative mode.' on Manila2d
- extended init should now work for manila2d.
Version 0.2.4.2 (21/01/2009)
- little fix on tabs
- guys, use 'load old settings', should be working now .. otherwise you probably don't have all elements on already patched manilas...
- There are no new replacings! Caller list is too deep connected, links isn't my thing...
Version 0.2.4.1 (20/01/2009)
- Integrated Icon from 12aon
- deploy stability increased
- better search (--> the application became slower...)
- bugfixes
- command line arguments:
-o <Path to your own PatchDef xml file>
-m <manila filename>
-s <manila filename like it is in homelplugin>
-p <manila home plugin dll filename>
-q <manila home plugin name (registry)>
- fully customizable
- much more
[@ ROM Cookers]
You can now customize SSMaPa as you want.
Version 0.2.4.0 (??/??/2009)
- Version in evaluation by ParleyP // Release after OK
Version 0.2.3.0 (30/12/2008)
- Added free filename editing (used for some cooked roms). Untested, I'm watiting for feedbacks...
Version 0.2.2.2 (19/11/2008)
- Corrected a unsign-problem on extended Init.
Version 0.2.2.1 (18/11/2008)
- Added an experimental unsign while patching feature. Needed on new devices.
--> Please check and give a feedback
Version 0.2.2 (20/7/2008)
- Added saving of current settings
- Use FileDialogChanger / gsgetfile.dll for a better filedialog http://www.geocities.co.jp/SiliconValley-Cupertino/2039/
--> I'm sorry, I don't have much time at the moment... There are many other things to do...
Version 0.2.1 (17/7/2008)
- When using 'Extended Init' the HTC TaskManager showed the Manila.exe file, which could be killed. Deploy with version 0.2.1 and softreset the device (or simpler, restart the service 'TaskManager'), then the file will be hidden again.
Version 0.2 (17/7/2008)
- Several bug-fixes
- Complete new includation which shouldn't cause a UnauthorizedAccessException anymore(use 'Extended Init')
- Some UI Changes
- Better deletion of no more used files
- Complete manila restoration function added
Version 0.1.1 (14/7/2008)
- Several bug-fixes
- Adding of alternative init
- Adding of new replacements (Click on Time, [Click on alarm], Phone Settings, Bluetooth Settings, Soundsettings)
- Some UI Changes
Version 0.1 (13/7/2008)
- First release
P.S. Excuse me for my english...
Hi,
thanks for the app.
Can you please add the following apps:
pTravelAlarm - ptravelalarm.exe
Phone Alarm - pasettings.exe and
or better allow the user to add its own files.
Thanks anyway.
Amir.
nice one.
good job
Bad reader... sorry
great app m8!
thx a lot for your work!
is it possible to link the manila clock to spb time?
thx again
I will be testing tonight
Before hand thanks very much!
On the other hand whats a cool calender app, do they integrate with your already created appointments.
Thanks a miLL
amir77a said:
Hi,
thanks for the app.
Can you please add the following apps:
pTravelAlarm - ptravelalarm.exe
Phone Alarm - pasettings.exe and
or better allow the user to add its own files.
Thanks anyway.
Amir.
Click to expand...
Click to collapse
the supported apps are those which are default integrated in manila.exe. you have to provide me that functions you want to replace...
I will try if i can add cpl elements...
you can use every program you want, only the ports are predefined...
Sergio PC said:
I will be testing tonight
On the other hand whats a cool calender app, do they integrate with your already created appointments.
Click to expand...
Click to collapse
yes I know that... I don't now if I can patch this.. this is a little bit harder than the exes if I have too much time, I will have a look at this matter
Sorry I dont fully understand what to type where.
I want Agenda One to work instead of MS Calendar.
Agenda One is in program files\ agenda one and the exe is called agenda one.exe I think.
What should i type where. When I just tried calendar one.exe in the first field it error'd when I tried to start the calendar from the TF3d
Thanks in advance. This will answer my main gripe about the diamond
stuartforrest said:
Sorry I dont fully understand what to type where.
I want Agenda One to work instead of MS Calendar.
Agenda One is in program files\ agenda one and the exe is called agenda one.exe I think.
What should i type where. When I just tried calendar one.exe in the first field it error'd when I tried to start the calendar from the TF3d
Thanks in advance. This will answer my main gripe about the diamond
Click to expand...
Click to collapse
if the destination exe is not in a shellpath folder you have to type the whole path.
this looks smt like this: /program files/agenda one/agenda one.exe
notice the forward slashs ('/') and the beginning slash.
choos calendar, enable patch, type the path in new program and maybe you have to add to the working dir /program files/agenda one/...
if you have further errors, give me the exact error message, then I will have a look on it..
greetings sven
Hi there,
The big one for me would be to have the Audio player section start CorePlayer rather then the built in HTC Player.
And if you could somehow make the FF/RW/Play buttons on the HTC handsfree (RC E100) control, control CorePlayer rather than the built in app then you would be my unconditional hero.
I apologize for my bad English.
I would like to replace the calendar of manila with today agenda to be able to visualize more appointments in a day.
Thanks.
http://todayagenda.softonic.de/pocket
This looks nice, as I want to change some default programs...
When I started the program and I press "INIT" I get the next error:
HTML:
SSMaPa.exe
UnauthorizedAccessException
bij System.IO.__Error.WinIOError(Int32 errorCode, String str)
bij System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
bij SSMaPa.ManilaPatch.Init()
bij SSMaPa.mainFrm.btnInit_Click(Object sender, EventArgs e)
bij System.Windows.Forms.Control.OnClick(EventArgs e)
bij System.Windows.Forms.Button.OnClick(EventArgs e)
bij System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)
bij System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
bij Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
bij System.Windows.Forms.Application.Run(Form fm)
bij SSMaPa.Program.Main()
Caspertje19 said:
When I started the program and I press "INIT" I get the next error:
HTML:
SSMaPa.exe
UnauthorizedAccessException
bij System.IO.__Error.WinIOError(Int32 errorCode, String str)
bij System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
bij SSMaPa.ManilaPatch.Init()
bij SSMaPa.mainFrm.btnInit_Click(Object sender, EventArgs e)
bij System.Windows.Forms.Control.OnClick(EventArgs e)
bij System.Windows.Forms.Button.OnClick(EventArgs e)
bij System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)
bij System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
bij Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
bij System.Windows.Forms.Application.Run(Form fm)
bij SSMaPa.Program.Main()
Click to expand...
Click to collapse
ugly. don't know exactly where the problem is... Try version 0.1.1 with alternative init activated. If it's not working you'll have a problem with device security or a better protected manila.exe..
Can you please try and post the result?
salada2k said:
The big one for me would be to have the Audio player section start CorePlayer rather then the built in HTC Player.
And if you could somehow make the FF/RW/Play buttons on the HTC handsfree (RC E100) control, control CorePlayer rather than the built in app then you would be my unconditional hero.
Click to expand...
Click to collapse
I don't use coreplayer personally. but if I find some time, I will do a try... I could already start the wmplayer, but it wasn't playing anything. The Problem is that audiomanager_eng.exe is very hardcoded in manila.. Also the interfaces are not exactly definded.
I unfortunatelly dont have a rc e100, so its a little bit difficile..
Mike73 said:
I apologize for my bad English.
I would like to replace the calendar of manila with today agenda to be able to visualize more appointments in a day.
Thanks.
http://todayagenda.softonic.de/pocket
Click to expand...
Click to collapse
I think this is not possible as long as tf3d runs... Maybe I will check if I find smt to display more elements.
leopardone said:
is it possible to link the manila clock to spb time?
Click to expand...
Click to collapse
Implemented
greetings sven
svenso said:
I think this is not possible as long as tf3d runs... Maybe I will check if I find smt to display more elements.
Click to expand...
Click to collapse
Thanks, I attend!
Thx a lot for Spb Time!
Thanks for this. I got Agenda One to be my default calendar with a bit of messing about.
I just needed to put the full path to my app
/internal storage/program files/agenda one/agenda one.exe
and the full path in the working directory
/internal storage/program files/agenda one/
and it all worked fine. No more rubbish MS calendar! I will post you a donation.
Caspertje19 said:
HTML:
SSMaPa.exe
UnauthorizedAccessException
bij System.IO.__Error.WinIOError(Int32 errorCode, String str)
bij System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
bij SSMaPa.ManilaPatch.Init()
bij SSMaPa.mainFrm.btnInit_Click(Object sender, EventArgs e)
bij System.Windows.Forms.Control.OnClick(EventArgs e)
bij System.Windows.Forms.Button.OnClick(EventArgs e)
bij System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)
bij System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
bij Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
bij System.Windows.Forms.Application.Run(Form fm)
bij SSMaPa.Program.Main()
Click to expand...
Click to collapse
Same problem here but when I apply the mod
leopardone said:
Same problem here but when I apply the mod
Click to expand...
Click to collapse
EDIT: excuse me, I had read wrong..
can you copy /windows/manila.exe to /manila.exe, kill manila.exe with a taskmanager and copy back /manila.exe to /windows/manila.exe with totalcomander?
what failure do you get?
thx you, Sven
EDIT2:
Download this app: http://www.microsoft.com/downloads/...8c-d587-47e0-908b-09fee6ea517a&DisplayLang=en
Start 'Security Configuration Manager' and provide me the right side, maybe we discover some differences in security configuration... BUT BE CAREFUL: Don't provision anything! If you provision the locked security scheme you'll have a real problem...
needs a better system to browse and select files !

accelerometer(lg gm750) method signatures

attached the.dll of the lg gm750 in case they serve of something
USER iamspv
First take a look at the Unified Sensor Api at codeplex.
My solution is based on the Samsung sensor class, modified to meet the peculiarities of the LG GM750.
First of all, the import of the DeviceIoControl in NativeMethods.cs must be modified such way dwIoControlCode is type uint, and the buffers are byte:
Code:
[DllImport("coredll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool DeviceIoControl(IntPtr hDevice, uint dwIoControlCode, [In] byte[] inBuffer, int nInBufferSize, [Out] byte[] outBuffer, int nOutBufferSize, ref int pBytesReturned, IntPtr lpOverlapped);
After a long time dissassembling the accelsensor.dll and and a lot of trial and error testing I came to this conclusion that works:
The constant that starts/stops data output becomes:
Code:
const uint ACCOnRot = 0x1014EE8;
const uint ACCOffRot = 0x1014EE8;
and for reading values:
Code:
const uint ACCReadValues = 0x1014F10;
The difference between start and stop comes from the input given in DeviceIoControl method as follows:
Code:
Code:
public static LGAccSensor Create()
{
DeviceIoControl(ACCOnRot, new byte[1] {1}, new byte[4] );
return new LGAccSensor();
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
DeviceIoControl(ACCOffRot, new byte[1] {0}, new byte[1] );
}
The DeviceIoControl inside the accelerometer class becomes
Code:
Code:
public static void DeviceIoControl(uint controlCode, byte[] inBuffer, byte[] outBuffer)
{
IntPtr file = NativeMethods.CreateFile("ACC1:", 0, 0, IntPtr.Zero, ECreationDisposition.OpenExisting, 0, IntPtr.Zero);
if (file == (IntPtr)(-1))
throw new InvalidOperationException("Unable to Create File");
try
{
int bytesReturned = 0;
int inSize = sizeof(byte) * inBuffer.Length;
int outSize = sizeof(byte) * outBuffer.Length;
if (!NativeMethods.DeviceIoControl(file, controlCode, inBuffer, inSize, outBuffer, outSize, ref bytesReturned, IntPtr.Zero))
throw new InvalidOperationException("Unable to perform operation.");
}
finally
{
NativeMethods.CloseHandle(file);
}
}
Note that the accelerometer device is called ACC1:.
Further the method that returns the three component vector becomes
Code:
Code:
public override GVector GetGVector()
{
byte[] outBuffer = new byte[4];
DeviceIoControl(ACCReadValues, new byte[1] {1}, outBuffer);
GVector ret = new GVector();
int accx = outBuffer[2];
if (accx <=31)
ret.X = accx/2.17;
else
ret.X = (accx-64)*0.47;
ret.X = -ret.X;
int accy = outBuffer[1] ;
if (accy <=31)
ret.Y = accy/2.17;
else
ret.Y = (accy - 64) * 0.47;
int accz = outBuffer[0] ;
if (accz <=31)
ret.Z = accz/2.17;
else
ret.Z = (accz - 64) * 0.47;
double somefactor = 1; return ret.Scale(somefactor);
}
Note that the when called with AccReadValues parameter, the DeviceIoControl returns three bytes each of them containing a signed 6 bit 2's complement value.Basicly there are values on 6 bit ranging from -32 to +31. In the docs below there are tables that put in correspondence these values with acceleration in range -1.5g +1.5g which are the limits of the device. The code I wrote returns acceleration in meters/second2 where 1g=9.8 m/s2. That information I extracted from the technical specifications of the MMA7660FC accelerometer, as found at(try a google search). Also, the type of the accelerometer circuit is found in the service manual (I only found the service manual for LG GM730 which is pretty close).The same thing I also posted at codeplex.
Reply With Quote
It already works! There is nothing more to do about it than use the code in your applications (I speak as a programmer and for programmers). I only showed everyone interested in developing for LG GM750 the steps to modify the SamsungGSensor class from "Unified Sensor Api" at codeplex to work with a LG. Just get the rest of the code from there and put it toghether.
Now there are two directions:
Direction #1
If you want to develop applications that aim to be portable between HTC, Samsung, LG, Toshiba, etc, and you want to use Unified Sensor Api then..
the person responsible for the unified api project at codeplex should make the update to the library as soon as possible such way the library should keep compatibility with the adressed devices. I'm just contributing with some results. That's because the initial code was not very general (ie. the initial parameter types to deviceiocontrol invoked from coredll didn't work with this solution) I had to make some modifications to the code that work with the LG but affect other devices' sensor classes. Now, if the update doesn't come up soon, no problem, anyone just gets the code from codeplex, adds a new class for LG, copies code from Samsung, renames Samsung with LG, adds my modifications, corrects syntax errors, compiles, et voila . . the library is updated to support LG GM750.
Direction #2
If you develop only for LG, just write a LG class as presented above and don't care about other devices.
If you don't know how to use your new class, the project at codeplex has some examples and you'll easily see inside the code how to instantiate sensors, how to read data at certain moments using a timer, and how to capture screen rotation events.
And for your long awaited joy to see it working, I attached the sensor test program along with a version of sensors.dll compiled by me, that works for GM750.
Now get your fingers toghether on the keyboard and start developing for LG
now should work in an emulator as that one of htc in omnia splitting of what we arrange
great work!
thanks much!
htcemu v0.91 /sensors.dll Problems
Hello all,
when I last November asked for a htcemu for LG750, I have not expected that there will be a emu dll so soon.
Thanks to iamspv and others, we now can use g-sensor apps as normal.
Nearly - some apps does not work or crash.
So my favorite alarm clock, klaxon crashes when alarm is activated. Waterlevel also does not work. It looks that both apps use the managed code dll sensors.dll. Even if I exchange the original dll with the one posted here from beginning of february, it does not work. Does anybody has a solution for this ?
For using landscape mode in app I now got best results with changescreen which works almost perfect. It is also possible to exclude some programs like some LG apps which do not support landscape mode.
how did you make other apps work? on my layla only test works and nothing else
creative232 said:
attached the.dll of the lg gm750 in case they serve of something
Click to expand...
Click to collapse
Did you create a running VS 2008 solution for this?. I'm interested.
Will this work on other LG's?

Categories

Resources