def get_phonebook_size(self): """ Returns the phonebook size of the SIM card @return: A C{re.MatchObject} with the size of the phonebook @raise common.exceptions.CMEErrorSIMBusy: When the SIM is not ready. @raise common.exceptions.CMSError500: When the SIM is not ready. @raise common.exceptions.ATError: When the SIM is not ready. """ cmd = ATCmd('AT+CPBR=?', name='get_phonebook_size') cmd.timeout = 30 return self.queue_at_cmd(cmd)
def check_pin(self): """ Checks what's necessary to authenticate against the SIM card @return: If everything goes well, it will return one of the following 1. +CPIN: READY 2. +CPIN: SIM PIN 3. +CPIN: SIM PUK 4. +CPIN: SIM PUK2 @raise common.exceptions.CMEErrorSIMBusy: When the SIM is not ready @raise common.exceptions.CMEErrorSIMNotStarted: When the SIM is not ready @raise common.exceptions.CMEErrorSIMFailure: This exception is raised by GlobeTrotter's 3G cards (without HSDPA) when PIN authentication is disabled """ cmd = ATCmd('AT+CPIN?', name='check_pin') cmd.timeout=5 return self.queue_at_cmd(cmd)
def check_pin(self): """ Checks what's necessary to authenticate against the SIM card @return: If everything goes well, it will return one of the following 1. +CPIN: READY 2. +CPIN: SIM PIN 3. +CPIN: SIM PUK 4. +CPIN: SIM PUK2 @raise common.exceptions.CMEErrorSIMBusy: When the SIM is not ready @raise common.exceptions.CMEErrorSIMNotStarted: When the SIM is not ready @raise common.exceptions.CMEErrorSIMFailure: This exception is raised by GlobeTrotter's 3G cards (without HSDPA) when PIN authentication is disabled """ cmd = ATCmd('AT+CPIN?', name='check_pin') cmd.timeout = 5 return self.queue_at_cmd(cmd)
def get_network_names(self): """Returns a tuple with the network info""" cmd = ATCmd('AT+COPS=?', name='get_network_names') cmd.timeout = 40 return self.queue_at_cmd(cmd)