def onDevRescan(self, event): berry = bb_usb.find_berry(None, None) if berry != None: if berry.handle==None: berry.open_handle() prefs=bb_prefs.get_prefs() prefs.remove_section(bb_prefs.SECTION_SCANNED_EP) #Note: will replace prefs with sanedd values bb_usb.read_bb_endpoints(berry, None)
def onDevRescan(self, event): berry = bb_usb.find_berry(None, None) if berry != None: if berry.handle == None: berry.open_handle() prefs = bb_prefs.get_prefs() prefs.remove_section(bb_prefs.SECTION_SCANNED_EP) #Note: will replace prefs with sanedd values bb_usb.read_bb_endpoints(berry, None)
def __init__(self, parent, ID, title): global icon self.bbtether=None sys.stdout = SysOutListener() wx.Frame.__init__(self, parent, ID, title, wx.DefaultPosition) self.SetIcon(get_icon()) self.CreateStatusBar() self.SetStatusText("") menuBar = wx.MenuBar() menu_file = wx.Menu() menu_file.Append(MENU_PREFS, "&Preferences", "Preferences") menu_file.Append(MENU_CLEAR_CONSOLE, "&Clear Log Console", "Clear the log console.") menu_file.AppendSeparator() menu_file.Append(MENU_EXIT, "E&xit", "Terminate the program") #item = wx.MenuItem(menu, 0, "Some Item") #item.Enable(False) menuBar.Append(menu_file, "&File"); menu_dev = wx.Menu() #menu_dev.Append(MENU_DEV_CHARGE, "&Charge", "Put in charge mode (If the BB complains about low voltage)") menu_dev.AppendSeparator() menu_dev.Append(MENU_DEV_RESCAN, "Re&scan", "Force rescan of device endpoints") menu_dev.AppendSeparator() #menu_dev.Append(MENU_DEV_RESET, "&Reset", "Force device reset(if stuck)") menuBar.Append(menu_dev, "&Device"); menu_modem = wx.Menu() menu_modem.Append(MENU_CONNECT, "&Connectar", "Conectar modem") menu_modem.Append(MENU_DISCONNECT, "&Desconectar", "Desconectar modem") menuBar.Append(menu_modem, "&Modem"); #menu_todo = wx.Menu() #menu_todo.Append(MENU_CONNECT, "&Upload App", "COB / JAD") #menu_todo.Append(MENU_DISCONNECT, "&Backup", "") #menuBar.Append(menu_todo, "&Firmware"); menu_help = wx.Menu() menu_help.Append(MENU_ABOUT, "&About", "More information about this program") menuBar.Append(menu_help, "&Help"); self.SetMenuBar(menuBar) # Menu events wx.EVT_MENU(self, MENU_ABOUT, self.onAbout) wx.EVT_MENU(self, MENU_EXIT, self.onQuit) wx.EVT_MENU(self, MENU_CONNECT, self.onStart) wx.EVT_MENU(self, MENU_DISCONNECT, self.onStop) wx.EVT_MENU(self, MENU_DEV_CHARGE, self.onCharge) wx.EVT_MENU(self, MENU_DEV_RESET, self.onDevReset) wx.EVT_MENU(self, MENU_DEV_RESCAN, self.onDevRescan) wx.EVT_MENU(self, MENU_PREFS, self.onPrefs) wx.EVT_MENU(self, MENU_CLEAR_CONSOLE, self.onClearConsole) # close button self.Bind(wx.EVT_CLOSE, self.onQuit) sizer=wx.BoxSizer(wx.VERTICAL) self.modem_panel=ModemPanel(self) self.log_pane = wx.TextCtrl(self, wx.ID_ANY, "", (4, 4), (700, 300), style=wx.TE_MULTILINE | wx.TE_READONLY) sizer.Add(self.modem_panel,0,wx.EXPAND) sizer.Add(self.log_pane,0,wx.EXPAND) self.SetSizer(sizer) self.Fit() self.CenterOnScreen() # Binding custom events self.Bind(EVT_LOG_APPEND, self.onLogEvent) self.Bind(EVT_STATUS, self.onStatus) self.Bind(EVT_WARN, self.onWarn) self.Bind(EVT_ASK, self.onAsk) self.Bind(EVT_INFO, self.onInfo) self.Bind(EVT_NETWORK_STATS, self.onStats) berry = bb_usb.find_berry(None, None) if berry != None: if berry.handle==None: berry.open_handle() prefs=bb_prefs.get_prefs() prefs.remove_section(bb_prefs.SECTION_SCANNED_EP) #Note: will replace prefs with sanedd values bb_usb.read_bb_endpoints(berry, None) dlg = wx.MessageDialog(self, "You should Disconnect before quitting!\nOtherwise your Blackberry might need a reboot\n\nDo you want to Quit anyway ?\n", "Warning !", wx.OK | wx.CANCEL) result = wx.ID_OK dlg.Destroy() if result != wx.ID_OK: return if self.prefs != None: try: self.prefs.Destroy() except: pass try: self.Destroy() except: pass
import base64 import bb_messenging import bb_prefs import bb_tether import bb_usb import threading berry = bb_usb.find_berry(None, None) if berry != None: if berry.handle==None: berry.open_handle() prefs=bb_prefs.get_prefs() prefs.remove_section(bb_prefs.SECTION_SCANNED_EP) #Note: will replace prefs with sanedd values bb_usb.read_bb_endpoints(berry, None) if self.prefs != None: try: self.prefs.Destroy() except: pass try: self.Destroy() except: pass
def read_endpoints(self,interface): ''' read endpoints (data & modem) and store them in this data structure''' bb_usb.read_bb_endpoints(self,interface)
def read_endpoints(self, interface): ''' read endpoints (data & modem) and store them in this data structure''' bb_usb.read_bb_endpoints(self, interface)