PM-8200 Todo Support Added

Jordan Foley <[email protected]>
Newsgroups gmane.comp.mobile.bitpim.devel
Message-ID <[email protected]>
com_sanyonewer.py
import todo

    def gettodo(self, result):
        gtodo = {}
        self.log("Getting todo entries")
        req=self.protocolclass.todorequest()
        for slot in range(20):
            req.slot=slot
            res=self.sendpbcommand(req, self.protocolclass.todoresponse)
            entry=todo.TodoEntry()
            entry.summary=res.entry.todo
            if res.entry.priority==2:
                entry.status=4
            if res.entry.priority==0:
                    entry.priority=5
            if res.entry.priority==1:
                    entry.priority=1     
            gtodo[entry.id]=entry
            result['todo']=gtodo
        return result


p_sanyonewer.p
PACKET todorequest:
    * sanyoheader {'packettype': 0x0c,
        'command': 0x25} +header
    1 UINT slot
    501 UNKNOWN +pad

PACKET todoentry:
    1 UINT slot
    1 UINT flag "0: Not used, 1: Used"
    14 STRING {'raiseonunterminatedread': False} todo
    7 UNKNOWN +pad1
    1 UINT todo_len
    1 UINT priority "0: Normal, 1: Urgent, 2: Done"
    1 UINT +dunno "Maybe always zero"
    1 UINT order "Gets sorted on screen in this order"

PACKET todoresponse:
    * sanyoheader header
    * todoentry entry
    472 UNKNOWN pad


I did not make a diff for this one since it is a simple copy and paste 
but this grabs the todo list off of the pm-8200. The phone only has two 
fields, the name of the item and its priority so this was very easy to 
implement. You can also mark a task completed so I added that also. I 
did not add support to write back to the phone as i dont know how to do 
that yet. Also I hardcoded the value of 20 into my subroutine because 
that is the max on my phone. Is this different on different phones and 
does this need to be a variable that is defined for each phone?

Question time. What are the commands to access different parts of the 
phone, most importantly I am looking for a command that will allow me to 
access the other sms folders since the command i have (0xe1) only gets 
the inboxs and I have tried ones around it without success. Is there a 
way to find them or is it trial and error? And if anyone would like to 
give me a tutorial on writing write support to the phone that would be 
great.


-------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.