Portability + bug fixes
Status: Beta
Brought to you by:
ryankrumins
Bug fixes:
1) Memory corruption in writeAndReadSeq whereby we
overflow the input write buffer and corrupt the
OBEX_init string
2) Inconsistent API usage - lgConnect: change unsigned
long bytesRead to long bytesRead so we can actually
detect error conditions
Portability fixes:
1) Re-define ReadBytes and WriteBytes macros to do the
right thing. Ugly workaround, but works.
2) Open the com port with 'rw+' rather than 'rwb'
I have used this library thus far to successfully list
the images on the device (I'm sure the rest works fine
as well).
Let me know how you prefer your diffs - this one is
quite simple so it's no problem to apply by hand.
diff -ur of the bug/portability fixes
Logged In: YES
user_id=1396008
Hi, I am trying to use this library (version 1.2) on Linux
and after patching it with your fixes (and after adding
some code to change the baudrate to 115200) I can get to
the point where lgConnect() returns -5. I checked the IMEI
number and it's read ok.
The problem seems to be that the phone replies with "ERROR"
to the "at$lgapp=1" command.
You said you tested it, did you test on Linux?
My phone is a U8330.
And, btw, the correct string for opening the port is "r+b",
not "rw+".
Logged In: YES
user_id=20532
Yeah, I've got this working quite nicely
uploading/downloading images, audios, recordings, java etc.
I've also done some simple python bindings for the library
if you're interested in them - makes writing cli tools for
upload/download trivial.
re: the at$lgapp=1 command - sounds like your phone uses a
different connection mechanism to mine. You probably need to
contact the library author for connectivity issues.