Discussion:
[BitPim-devel] new brew filesystem protocol
Simon C
2005-10-13 05:05:53 UTC
Permalink
The 8100 supports a new brew protocol for accessing the filesystem in
addition to the old way. I expect other new phones with the same chipset
will support this as well.
The advantage to the user is that it lets them overwrite NVM files,
currently not possible.

I had a look at the way the DebugBrewProtocol was implemented. I'd like to
do something similar for the new protocol that tests an attribute in the
protocol to decide to adjust the class hierarchy to use file functions from
the new protocol class, only implemented functions would be overridden. The
new class and packets would go into the com_brew and p_brew files.

The code to would look something like:
class BrewProtocol(RealBrewProtocol):
"""This is just a wrapper class that allows the manipulation between
RealBrewProtocol and DebugBrewProtocol classes.
"""
def __init__(self):
# if the env var PHONE_FS is set, we're debugging!
phone_path=os.environ.get('PHONE_FS', None)
if __debug__ and phone_path:
print 'Debug Phone File System:',phone_path
# we probably need to do this only once for the whole class,
# but what the heck!
DebugBrewProtocol._fs_path=os.path.normpath(phone_path)
self._update_base_class(self.__class__)
elif getattr(self.protocolclass, "BREW_FILE_SYSTEM", 0) == 2:
self._set_new_brew(self.__class__)

def _set_new_brew(self, klass):
# update the class hierachy to include RealBrewProtocol2 so that
# it's functions override RealBrewProtocol's ones.
_bases=[]
found=False
for e in klass.__bases__:
if e==RealBrewProtocol:
_bases.append(RealBrewProtocol2)
found=True
_bases.append(e)
if found:
klass.__bases__=tuple(_bases)
else:
for e in _bases:
self._set_new_brew(e)

Simon
Stephen Wood
2005-10-13 12:45:26 UTC
Permalink
Simon:

Do you have some examples of packet definitions for the new brew protocol.
The Sanyo MM-8300 does not appear to support the filesystem protocol, so I
am hoping that it supports this new protocol.

Thanks, Stephen
Post by Simon C
The 8100 supports a new brew protocol for accessing the filesystem in
addition to the old way. I expect other new phones with the same chipset
will support this as well.
The advantage to the user is that it lets them overwrite NVM files,
Simon C
2005-10-13 14:12:16 UTC
Permalink
Stephen,



I've attached what I've got so far, it allows the filesystem to be queried
and stat works.

It is contained in the RealBrewProtocol2 class and packets named starting
with 'new_'.

Add BREW_FILE_SYSTEM=2 to the top of the phone's protocol file to cause the
new protocol to be used. If the function is not implemented in the new class
the existing implementation/protocol will be used.



Simon







_____

From: bitpim-devel-***@lists.sourceforge.net
[mailto:bitpim-devel-***@lists.sourceforge.net] On Behalf Of Stephen Wood
Sent: Thursday, October 13, 2005 5:45 AM
To: bitpim-***@lists.sourceforge.net
Subject: Re: [BitPim-devel] new brew filesystem protocol



Simon:

Do you have some examples of packet definitions for the new brew protocol.
The Sanyo MM-8300 does not appear to support the filesystem protocol, so I
am hoping that it supports this new protocol.

Thanks, Stephen



On 10/13/05, Simon C <***@sbcglobal.net> wrote:

The 8100 supports a new brew protocol for accessing the filesystem in
addition to the old way. I expect other new phones with the same chipset
will support this as well.
The advantage to the user is that it lets them overwrite NVM files,
Joe Pham
2005-10-14 00:41:19 UTC
Permalink
If I understand this correctly, these protocols only apply to newer phones, some of which can work with both protocols. If that's the case, you might want to keep it simple and just extend the existing class with methods to support specific new protocols.

-Joe Pham




______________________________________________________________________
Revolutionize the way you surf the Web!
Try NetZero HiSpeed 3G.
Visit http://www.netzero.com to sign up today!
Simon C
2005-10-14 01:44:04 UTC
Permalink
This would involve adding code to the existing functions to test whether to
use the old or new method for a particular function, I wanted to minimize
the change to existing code like what you did with the debug file system.

Simon
-----Original Message-----
Sent: Thursday, October 13, 2005 5:41 PM
Subject: Re: [BitPim-devel] new brew filesystem protocol
If I understand this correctly, these protocols only apply to newer
phones, some of which can work with both protocols. If that's the case,
you might want to keep it simple and just extend the existing class with
methods to support specific new protocols.
-Joe Pham
______________________________________________________________________
Revolutionize the way you surf the Web!
Try NetZero HiSpeed 3G.
Visit http://www.netzero.com to sign up today!
-------------------------------------------------------
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Simon C
2005-10-15 22:30:57 UTC
Permalink
Stephen,



Did the new protocol work with the 8300?

I have file read working if you want an update.



Simon
Stephen Wood
2005-10-16 03:14:33 UTC
Permalink
It did not work, but I copied the packet defintions into my own code rather
than using your updated com_brew, so maybe I did something wrong. Send me
your latest and I'll try it again,

Thanks, Stephen
Post by Simon C
Stephen,
Did the new protocol work with the 8300?
I have file read working if you want an update.
Simon
Simon C
2005-10-16 04:44:15 UTC
Permalink
Here is what I have so far.
It requires "BREW_FILE_SYSTEM=2" in the phone's protocol file and it works
in debug mode only.

Simon
Stephen Wood
2005-10-17 03:51:23 UTC
Permalink
I tried this. Unfortunately it looks like the MM-8300 does not support
either file system. Bummer!

Thanks, Stephen
Post by Simon C
Here is what I have so far.
It requires "BREW_FILE_SYSTEM=2" in the phone's protocol file and it works
in debug mode only.
Simon
Loading...