You have to create a PACKET definition for the files you are decoding.
This goes in the p_phone.p file.
The PACKET gets compiled by the protogen.py utility and it generates code
that makes breaking up the files into their individual fields much easier,
assuming that the data types in the file are supported (you can create your
own data types if they are not).
The next step is to add code to your phone class to allow bitpim to access
the SMS (or memo etc) message on your phone.
For each type of data bitpim retrieves there is a get and a save function
defined, so there is a getsms() and savesms(). You need to implement these
functions to read the SMS on your phone.
Your phone also has a Profile class (in the same file typically), in this
you define the features supported by the phone, look for _supportedsyncs,
you need to add SMS to this, note that SMS write only allows the user to
change the prewritten presponses at the moment. This is the _supportedsync ,
from the lgvx4400, it supports everything except todo. This list determines
what options are greyed out in the get/send data dialog boxes.
_supportedsyncs=(
('phonebook', 'read', None), # all phonebook reading
('calendar', 'read', None), # all calendar reading
('wallpaper', 'read', None), # all wallpaper reading
('ringtone', 'read', None), # all ringtone reading
('call_history', 'read', None),# all call history list reading
('sms', 'read', None), # all SMS list reading
('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook
('calendar', 'write', 'OVERWRITE'), # only overwriting calendar
('wallpaper', 'write', 'MERGE'), # merge and overwrite
wallpaper
('wallpaper', 'write', 'OVERWRITE'),
('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone
('ringtone', 'write', 'OVERWRITE'),
('sms', 'write', 'OVERWRITE'), # all SMS list writing
)
The contents of the getsms() function in your phone will decode the
proprietary contents of files on your phone and convert them into a standard
format understood by bitpim. The data is stored in records in a python
dictionary data type. I don't know how familiar you are with python, but the
easiest way to do this is to copy code from another phone. I would recommend
the 4400 as it is file based like your phone and I wrote a lot of it so it
obviously rocks :), just ignore the stuff that unpacks the 7-bit ascii as it
sounds like your phone stores in plain text. Many other phones also
implement this, most of the LG family uses the code in the 4400, but the
other models contain other implmentations you can copy. Just search for
getsms to find them.
The same procedure applies to the memo and todo data. I would recommend
starting with the memo or the todo, it is probably simpler to implement than
SMS. The lg phones are a poor example for these two features as they barely
support memos and do not support todo, I think the Samsung phones are good
examples for these. Again the steps are
1) override the getmemo and savememo(if you want to support writing) in the
Phone class,
2) add the feature to the _supportedsyncs in the Profile class,
3) define the file format in the protocol file (p_phone.p).
4) write code to convert the phones file format into the bitpim record for
memos and add it to the getmemo function, do the reverse for savememo.
Simon
-----Original Message-----
Sent: Saturday, December 10, 2005 9:44 PM
Subject: [BitPim-devel] pm-8200 devel
I do not know how the code is setup in bitpim but i am working on
learning the in and outs of it. So I was hoping someone could help me
with implementing the sms code for this phone. If anyone can help me
with implenting this, memos, or todo in bitpim I would appreciate it.
So far I have only studied the files on the phone.
nvm_0021 SMS inbox
nvm_0026 SMS outbox
nvm_0027 SMS deleted
nvm_0028 SMS prewritten responses
nvm_0032 SMS drafts
I then studied nvm_0026 in a hexeditor
01
00 00 repeated
01 01 01(increases by 1 in hex for each msg) 00 00 00 00 00 00 00 02 01 00
6A(leads all msgs) followed by plaintext msg
00 00 repeat
05 08 1C 00 27 38 0A then the phone # of the sender
00 00 repeat
phone # of reciever
00 repeat
01 04 00 00 00 0C(increases by 1 for each msg in hex)
Thank you
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel