def onStart(self, event): if self.bbtether!=None and self.bbtether.is_running(): dlg = wx.MessageDialog(self, "The modem is already Connected.", "Warning!", wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy() return # ask config to use pppdconf=bb_prefs.get_def_string(bb_prefs.SECTION_MAIN, "pppd_config", "") # if none picked yet, ask and save in prefs for next time if pppdconf == "": choices=get_ppp_confs() choices.append("--Do not start PPPD--") evt=pickEvent(caption="PPP config to use (EX: tmobile) see conf/ folder.",choices=choices,default=pppdconf) pppconf=self.onPick(evt) print "pppconf:"+str(pppconf) if pppconf==None: # cancelled return if pppconf == "--Do not start PPPD--": pppconf="" bb_prefs.set(bb_prefs.SECTION_MAIN,"pppd_config",pppconf) bb_prefs.save_prefs() fake_args=self.build_args_from_prefs() bb_messenging.log("Will run bbtether with args: "+str(fake_args)) (options,args)=bb_tether.parse_cmd(fake_args) self.bbtether = BBTetherThread(options, args) self.bbtether.start()
def onStart(self, event): if self.bbtether != None and self.bbtether.is_running(): dlg = wx.MessageDialog(self, "The modem is already Connected.", "Warning!", wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy() return # ask config to use pppdconf = bb_prefs.get_def_string(bb_prefs.SECTION_MAIN, "pppd_config", "") # if none picked yet, ask and save in prefs for next time if pppdconf == "": choices = get_ppp_confs() choices.append("--Do not start PPPD--") evt = pickEvent( caption="PPP config to use (EX: tmobile) see conf/ folder.", choices=choices, default=pppdconf) pppconf = self.onPick(evt) print "pppconf:" + str(pppconf) if pppconf == None: # cancelled return if pppconf == "--Do not start PPPD--": pppconf = "" bb_prefs.set(bb_prefs.SECTION_MAIN, "pppd_config", pppconf) bb_prefs.save_prefs() fake_args = self.build_args_from_prefs() bb_messenging.log("Will run bbtether with args: " + str(fake_args)) (options, args) = bb_tether.parse_cmd(fake_args) self.bbtether = BBTetherThread(options, args) self.bbtether.start()
Ex: sudo apt-get install python libusb pppd python-pyusb or yum install python libusb pppd pyusb ----------------------------------- Thibaut Colar - 2009+ tcolar AT colar DOT net http://wiki.colar.net/bbtether Released Under GPL2, COMES WITH ABSOLUTELY NO WARRANTIES OF ANY KIND, USE AT YOUR OWN RISK. If you make fixes or find issues please EMAIL: tcolar AT colar Dot NET ''' import sys import bb_tether # MAIN (options, args) = bb_tether.parse_cmd(sys.argv[1:]) bbtether=bb_tether.BBTether() bbtether.start(options, args) ''' Protocol References: (Used to figure out BBerry protocol) http://www.off.net/cassis/protocol-description.html http://xmblackberry.cvs.sourceforge.net/viewvc/xmblackberry/XmBlackBerry/ http://barry.cvs.sourceforge.net/viewvc/barry/barry/ http://libusb.sourceforge.net/doc/ http://bazaar.launchpad.net/~pygarmin-dev/pygarmin/trunk/annotate/91?file_id=garmin.py-20070323161514-arelz0uc976re3e4-1 http://www.fibble.org/archives/000508.html http://www.wxpython.org/download.php If usb_claim_interface() returns -EBUSY, this means there's already another (possibly kernel) driver bound to that interface. On Linux you
Ex: sudo apt-get install python libusb pppd python-pyusb or yum install python libusb pppd pyusb ----------------------------------- Thibaut Colar - 2009+ tcolar AT colar DOT net http://wiki.colar.net/bbtether Released Under GPL2, COMES WITH ABSOLUTELY NO WARRANTIES OF ANY KIND, USE AT YOUR OWN RISK. If you make fixes or find issues please EMAIL: tcolar AT colar Dot NET ''' import sys import bb_tether # MAIN (options, args) = bb_tether.parse_cmd(sys.argv[1:]) bbtether = bb_tether.BBTether() bbtether.start(options, args) ''' Protocol References: (Used to figure out BBerry protocol) http://www.off.net/cassis/protocol-description.html http://xmblackberry.cvs.sourceforge.net/viewvc/xmblackberry/XmBlackBerry/ http://barry.cvs.sourceforge.net/viewvc/barry/barry/ http://libusb.sourceforge.net/doc/ http://bazaar.launchpad.net/~pygarmin-dev/pygarmin/trunk/annotate/91?file_id=garmin.py-20070323161514-arelz0uc976re3e4-1 http://www.fibble.org/archives/000508.html http://www.wxpython.org/download.php If usb_claim_interface() returns -EBUSY, this means there's already another (possibly kernel) driver bound to that interface. On Linux you can try usb_get_driver_np() to figure out which driver it is, and