<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>可可熊的窝 &#187; E680</title>
	<atom:link href="http://cocobear.info/blog/tag/e680/feed/" rel="self" type="application/rss+xml" />
	<link>http://cocobear.info/blog</link>
	<description>K.I.S.S</description>
	<lastBuildDate>Sat, 10 Dec 2011 16:11:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>读取E680(i,g)的native.db文件-续</title>
		<link>http://cocobear.info/blog/2009/02/01/data-of-e680-native-db-1/</link>
		<comments>http://cocobear.info/blog/2009/02/01/data-of-e680-native-db-1/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 02:49:45 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[编程相关]]></category>
		<category><![CDATA[E680]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=485</guid>
		<description><![CDATA[上次写到读E680联系人，后来又增加了读短信，并且做了一些代码上的修改，代码放在了google code里，使用的方法是需要读数据库（native.db）中的什么内容就在databases这个list中添加相应的数据库名，获取数据库名的方法也在代码的首部给出了。 地址 PyFetion也放在了这里，以后Python的脚本就统一用google code管理，这样就方便我在多台电脑修改代码了。 前几天看到一篇文章比较SQLite与Bdb的文章，提到了Bdb中数据存放是使用的原始数据，所以在读到短信中的日期时需要使用struct.unpack来进行处理。 本来以为Bdb也应该是代码很小七的，类似与SQLite，没想到竟然有十多兆的代码:-( 可可熊的Python仓库： http://code.google.com/p/pytool &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-google code 中svn使用&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- svn checkout https://pytool.googlecode.com/svn/trunk/ pytool &#8211;username cocobear.cn svn status ? cang.py svn add cang.py A cang.py svn ci -m&#8221;add cang.py&#8221;]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2009/02/01/data-of-e680-native-db-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>读取E680(i,g)的native.db文件</title>
		<link>http://cocobear.info/blog/2009/01/13/data-of-e680-native-db/</link>
		<comments>http://cocobear.info/blog/2009/01/13/data-of-e680-native-db/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 08:51:35 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[XylFTP]]></category>
		<category><![CDATA[bsddb]]></category>
		<category><![CDATA[E680]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=462</guid>
		<description><![CDATA[E680手机使用了Berkeley DB，关于这个数据库的一些信息可以看我给的链接。 很早以前就有打算要写个Python读取native.db（不知道这个的请G之）中联系人，短信的程序，不过没能成功，这两天又接触到了bsddb，于是今天分析了下这个native.db，没想到原来挺简单的。Berkeley DB本来就是一个很简单的数据库，只是在E680中系统把多个数据库同时存放在了一个文件中native.db，所以不可以直接使用bsddb.btopen来直接打开这个文件。由于Berkeley DB中只是一种类似Python中dict的数据库（key=value）所以要存放手机联系人（有很多字段，如地址，电话&#8230;），就需要使用多个数据库，然后每个数据库使用索引来与其它数据库建立联系。按照一般的想法应该是多个数据库的key是作为索引，然后value分别存放各种信息，但E680中的native.db恰好相反。 其实这样的结构也是很简单的，但是我在写代码的时候遇到一个问题，从某个数据库中读取一个key，然后使用bsddb中的get方法去取这个key对应的value，结果确是None，以前好像就是卡在了这一块，似乎与这个value的值有关系，这个value是二进制数据：“< x03x00x00”，不理解为什么这里不直接用整数作为索引而用这么奇怪的数据，或者这里是某种编码？ 先不理这个，不管这个value是什么，使用sorted把每个数据库按照其value排序,下面是所有代码: 读取E680联系人: #!/usr/bin/env python # -*- coding=utf-8 -*- #Using GPL v2 #Author: cocobear.cn@gmail.com &#34;&#34;&#34; 获取数据库名: db = bsddb.db.DB() db.open('native.db',bsddb.db.DB_UNKNOWN,bsddb.db.DB_RDONLY) db.keys() &#34;&#34;&#34; import bsddb db_file = 'native.db' databases = [('姓名','780_contact_table.first name'),('手机1','780_contact_table.mobile1'),('手机2','780_contact_table.mobile2'),('家庭1','780_contact_table.home1'),('家庭2','780_contact_table.home2'),('工作1','780_contact_table.work1'),('工作1','780_contact_table.work1'),] databases = [('姓名','780_contact_table.first name'),('手机1','780_contact_table.mobile1')] out = [] for database in databases: #进行单文件多数据库操作 需要每次新建一个环境 #因此下面这行在for循环里 db =bsddb.db.DB() db.open(db_file,database[1],bsddb.db.DB_UNKNOWN,bsddb.db.DB_RDONLY) #每次读一个数据库 [...]]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2009/01/13/data-of-e680-native-db/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fedora 9 通过E680G/I手机实现GPRS上网</title>
		<link>http://cocobear.info/blog/2008/10/16/e680-gprs-linux/</link>
		<comments>http://cocobear.info/blog/2008/10/16/e680-gprs-linux/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 02:43:06 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[E680]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[GPRS]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=316</guid>
		<description><![CDATA[电脑通过E680G/I手机实现GPRS上网 E680是一款摩托的Linux系统手机，在Windows下可以通过自带的MPT工具包实现与电脑连接的GPRS上网，在Linux下也是比较方便的，以前我也用过，只是没记下来，今天再用的时候还得看别人写的文章，还是自己记一下。 我用的是Fedora 9，一般的Linux系统都应该可以，大同小异。首先是手机端设置连接模式为调制解调器(Modem)，通过数据线连接到电脑后(也可以用蓝牙，我这里没有环境)，Fedora 9会识别到有新的调制解调器： 发现新硬件: usb 4-3: new full speed USB device using ohci_hcd and address 2 usb 4-3: configuration #1 chosen from 1 choice usb 4-3: New USB device found, idVendor=22b8, idProduct=3802 usb 4-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 usb 4-3: Product: Motorola USB Modem usb 4-3: Manufacturer: Motorola cdc_acm 4-3:1.0: [...]]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2008/10/16/e680-gprs-linux/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Linux系统下E680使用USB网模式</title>
		<link>http://cocobear.info/blog/2008/03/31/e680-use-usb-lan/</link>
		<comments>http://cocobear.info/blog/2008/03/31/e680-use-usb-lan/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 14:19:32 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[E680]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=253</guid>
		<description><![CDATA[草儿同学写了一篇关于在Win下面E680的USB网模式使用，俺就说一说Linux下的使用吧。 对于目前主流的发型版来说驱动问题应该不会有的，2.6.12以后的内核应该都可以直接识别E680的，首先在手机上把连接电脑的模式设计为USB网，然后连接数据线，系统会识别到有新的网卡，在我的网络配置中可以看到： Motorola PCS EZX GSM Phone(USBLAN)，设备名一般是usb0，我们先激活它， [cocobear@cocobear ~]$ sudo ifconfig usb0 192.168.1.1 然后ping一下手机： [cocobear@cocobear ~]$ ping 192.168.1.2 PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data. 64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=3.59 ms 接下来我们就可以对E680进行操作了，可以使用telnet登录，用户名root，密码为空： [cocobear@cocobear ~]$ telnet 192.168.1.2 Trying 192.168.1.2&#8230; Connected to 192.168.1.2. Escape character is &#8216;^]&#8217;. MontaVista Linux Consumer Electronics Edition 3.0 Linux/armv5tel 2.4.20_mvlcee30-mainstone [...]]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2008/03/31/e680-use-usb-lan/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

