예제 #1
0
 def enable_radio(self, enable):
     """
     Enables/disable radio stack
     """
     cmd = ATCmd("AT+CFUN=%d" % int(enable), name='enable_radio')
     cmd.timeout = 30
     return self.queue_at_cmd(cmd)
예제 #2
0
    def get_phonebook_size(self):
        """
        Returns the phonebook size of the SIM card

        :raise General: When the SIM is not ready.
        :raise SimBusy: When the SIM is not ready.
        :raise CMSError500: When the SIM is not ready.
        """
        cmd = ATCmd('AT+CPBR=?', name='get_phonebook_size')
        cmd.timeout = 15
        return self.queue_at_cmd(cmd)
예제 #3
0
 def send_at(self, at_str, name='send_at', timeout=None):
     """Send an arbitrary AT string to the SIM card"""
     cmd = ATCmd(at_str, name=name)
     if timeout:
         cmd.timeout = timeout
     return self.queue_at_cmd(cmd)
예제 #4
0
 def send_ussd(self, ussd):
     """Sends the USSD command ``ussd``"""
     dcs = 15
     cmd = ATCmd('AT+CUSD=1,"%s",%d' % (ussd, dcs), name='send_ussd')
     cmd.timeout = 30
     return self.queue_at_cmd(cmd)
예제 #5
0
 def register_with_netid(self, netid, mode=1, _format=2):
     """Registers with ``netid``"""
     atstr = 'AT+COPS=%d,%d,"%s"' % (mode, _format, netid)
     cmd = ATCmd(atstr, name='register_with_netid')
     cmd.timeout = 30
     return self.queue_at_cmd(cmd)
예제 #6
0
 def get_network_names(self):
     """Returns a tuple with the network info"""
     cmd = ATCmd('AT+COPS=?', name='get_network_names')
     cmd.timeout = 300
     return self.queue_at_cmd(cmd)