s5vi's Motorola p2k phone page
February 10, 2012, 07:06:16 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Over 30000 member ! Under heavy spammer attack ! Cleaning in progress !
V-6.0.0 with CDMA support is available now.
To become VIP: you can do it via PayPal: http://www.el-co.hu/p2k05/paypal.html
 
   Home   Help Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: A few bugs and suggestions  (Read 1697 times)
0 Members and 1 Guest are viewing this topic.
DHowett
Newbie
*
Offline Offline

Posts: 1


Email
« on: November 07, 2008, 02:48:59 pm »

I'd like to say that I love p2k-core; but it has some things that could be fixed.
I'd love to be able to help, but I'm not sure which version to start with.

1) Filenames with spaces don't work. The input code splits on spaces and ignores quotes and escapes (at least for spaces) and therefore "file u Chord low.mid /a/" tries to upload "Chord" as "low.mid".

2) "file u blah /a/dir" uploads blah as /a/dirblah.

3) Program crashes if you file u or file d without a file l, at least with my Motorola V9m.

4) info *.utf (as per file d /blah/blah/blah.utf) crashes.

5) "file a blah xx" creates empty files.

6) "file u nonexistent_file /a/" creates empty files (I believe.)

Suggestion:
The input interface is not very robust; It already uses readline but that's barely a start. Check for existence of files immediately upon argument parsing. Possibly use a tokenize function, treat each command as its own function (lookup table), pass arguments as argc/v combo just like the OS does to main(). Store file list in tab completion to tab-complete mobile phone paths.

7) I think it leaves a junk file called ~/P2KFILELIST.

8) p2kc leaves files in the homedir as well.

Suggestion:
Global variables.

9) p2k-core cannot switch my phone into p2k mode (It's exported as a Class 0xFF device instead of the Communication class and obviously has specific PIDs.)

10) seem d x x doesn't allow length, some seems at length 00 hang all p2k programs.

11) p2kc has to interface with p2k-core in a specific manner.

Suggestion:
Break the p2k-specific stuff out into a separate library, possibly named libp2k, with a well-defined API. It'll contain code to interface with given USB devices, upload and download files, get file lists, seems. p2k-core can be a text interface to the library, and p2kc can be a graphical interface to the same library. e.g. in p2kc instead of being like "send 'file u blah blah' to p2k-core and hope it works and parse its reply", just "if(!p2k_send(file, dest))" or something. All other programs wanting p2k support can just link with this library.

Ancillary:
Scripting interface. I already do this with saved command lists and then just p2k-core < script. If comments were supported, e.g., ignoring lines starting with #, one could make a script, prefix it with #!/path/to/p2k-core and then run it as ./script to automatically perform some actions on a phone. Another plus? Supporting the P2KCommander scripting language.

Let me know your plans and if it's not on your implementation radar, I'd love to do any and/or all of these. I'm well-versed in C and various other languages.
Logged
s5vi
Administrator
Hero Member
*****
Offline Offline

Posts: 769



WWW Email
« Reply #1 on: November 07, 2008, 06:11:36 pm »

DHowett,

Thanks for your interest. I will be happy if you want to cooperate/help to make p2k-core code better.
For this time i'm quite busy with win32 version. I must support new moto linux phones. http://www.el-co.hu/smf/index.php/topic,294.0.html

pls contact me at s5vi.hu@gmail.com

My answers to your observations:
1. yes its a bug
2. you must use a trailing slash: File u blah /a/dir/
3. yes, getting filelist is needed for file operations, but technically possible to do them, without "file l"
4. Huh? maybe the syntax is "info /a/*.utf"
5. this is normal. there is no such thing as "p2k file create". instead "p2k file open" will open existing file or create a new file if not exist.
6. same as 5.
7. yes i leave this file,  can be deleted on exit.
8. same as 7.  (file MODEM)
9. there is option -d (device)  you can specify your phones PID  see readme.txt
device mode  p2k-core -d xxxx (22b8 is Motorola Vendor Id, by default without -d)

Thanks again.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!

Bad Behavior has blocked 128 access attempts in the last 7 days.



Google visited last this page January 27, 2012, 11:32:30 am