Class v.c.p.SIMCardConnection(SIMProtocol):

Part of vmc.common.protocol View In Hierarchy

Known subclasses: vmc.common.middleware.SIMCardConnAdapter

SIMCardConnection provides several methods to interact with the SIM card
Method __init__ Undocumented
Method add_contact Adds a contact to the SIM card
Method add_sms Adds sms to the SIM and returns the index
Method change_pin Changes oldpin to newpin in the SIM card
Method check_pin Checks what's necessary to authenticate against the SIM card
Method delete_all_contacts Deletes all the contacts in SIM card, function useful for tests
Method delete_all_sms Deletes all the messages in SIM card, function useful for tests
Method delete_contact Deletes the contact specified by index
Method delete_sms Deletes the message specified by index
Method disable_echo Disables echo of AT cmds
Method disable_pin Disables pin authentication at startup
Method enable_pin Enables pin authentication at startup
Method find_contacts Returns a list of contacts that match the given pattern
Method get_contact_by_index Undocumented
Method get_contacts Returns a list with all the contacts stored in the SIM card
Method get_available_charset Returns the available character sets
Method get_card_version Returns the SIM card version
Method get_card_model Returns the SIM card model
Method get_charset Returns the current character set name
Method get_imei Returns the IMEI number of the SIM card
Method get_imsi Returns the IMSI number of the SIM card
Method get_manufacturer_name Returns the manufacturer name of the SIM card
Method get_netreg_status Returns the network registration status
Method get_network_info Returns a tuple with the network info
Method get_network_names Returns a tuple with the network info
Method get_roaming_ids Returns a list with the networks we can register with
Method get_free_contact_ids Returns a deque with the not used contact ids
Method get_next_contact_id Returns the next free contact id
Method get_signal_level Returns a tuple with the RSSI and BER of the connection
Method get_sms Returns a list with all the messages stored in the SIM card
Method get_sms_by_index Returns the message stored at index
Method get_smsc Undocumented
Method get_phonebook_size Returns the phonebook size of the SIM card
Method get_pin_status Checks wether the pin is enabled or disabled
Method get_used_contact_ids Returns a list with the used contact ids
Method get_used_sms_ids Returns a list with used SMS ids in the SIM card
Method register_with_network Registers with the given netid
Method reset_settings Resets the settings to factory settings
Method send_at Send an arbitrary AT string to the SIM card
Method send_pin Sends the PIN to the SIM card
Method send_puk Sends PUK and PIN to the SIM card
Method send_sms Sends the given pdu and returns the index
Method set_charset Sets the character set used on the SIM
Method set_netreg_notification Sets CREG unsolicited notification
Method set_network_info_format Undocumented
Method set_sms_format Sets the format of the SMS
Method set_sms_indication Sets the SMS indication mode
Method set_smsc Sets the SMSC

Inherited from SIMProtocol:

Method __repr__ Undocumented
Method transition_to_idle Transitions to idle and processes next queued ATCmd
Method send_splitcmd Used to send the second part of a split command after prompt appears
Method _process_at_cmd Undocumented
Method _check_queue Undocumented
Method queue_at_cmd Queues an ATCmd and returns a deferred

Inherited from BufferingStateMachine (via SIMProtocol):

Method _timeout_eb Undocumented
Method cancel_current_delayed_call Cancels current ATCmd dellayed call if active
Method notify_success Notify success to current ATCmd callbacks
Method notify_failure Notify failure to current ATCmd errbacks
Method set_cmd Sets self.cmd to cmd
Method set_state Sets and logs the new state
Method enque_notification Enqueues a notification
Method dataReceived See twisted.internet.protocol.Protocol.dataReceived
Method process_notifications Processes unsolicited notifications in buffer
Method handle_idle See the method comments
Method handle_waiting Undocumented
def __init__(self, device):
Undocumented
def add_contact(self, name, number, index):
Adds a contact to the SIM card
def add_sms(self, pdu_len, pdu):
Adds sms to the SIM and returns the index
def change_pin(self, oldpin, newpin):
Changes oldpin to newpin in the SIM card
Parametersoldpin (type: str )
newpin (type: str )
ReturnsIf everything goes well, it will return an 'OK' through the callback, otherwise it will raise an exception.
Raisescommon.exceptions.ATErrorWhen the password is incorrect.
common.exceptions.CMEErrorIncorrectPasswordWhen the password is incorrect.
common.exceptions.InputValueErrorWhen the PIN != \d{4}
def check_pin(self):
Checks what's necessary to authenticate against the SIM card
ReturnsIf 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
Raisescommon.exceptions.CMEErrorSIMBusyWhen the SIM is not ready
common.exceptions.CMEErrorSIMNotStartedWhen the SIM is not ready
common.exceptions.CMEErrorSIMFailureThis exception is raised by GlobeTrotter's 3G cards (without HSDPA) when PIN authentication is disabled
def delete_all_contacts(self):
Deletes all the contacts in SIM card, function useful for tests
def delete_all_sms(self):
Deletes all the messages in SIM card, function useful for tests
def delete_contact(self, index):
Deletes the contact specified by index
def delete_sms(self, index):
Deletes the message specified by index
def disable_echo(self):
Disables echo of AT cmds
def disable_pin(self, pin):
Disables pin authentication at startup
Parameterspin (type: int )
ReturnsIf everything goes well, it will return an 'OK' through the callback, otherwise it will raise an exception.
Raisescommon.exceptions.ATErrorWhen the PIN is incorrect.
common.exceptions.CMEErrorIncorrectPasswordWhen the PIN is incorrect.
common.exceptions.InputValueErrorWhen the PIN != \d{4}
def enable_pin(self, pin):
Enables pin authentication at startup
Parameterspin (type: int )
ReturnsIf everything goes well, it will return an 'OK' through the callback, otherwise it will raise an exception.
Raisescommon.exceptions.ATErrorWhen the PIN is incorrect.
common.exceptions.CMEErrorIncorrectPasswordWhen the PIN is incorrect.
common.exceptions.InputValueErrorWhen the PIN != \d{4}
def find_contacts(self, pattern):
Returns a list of contacts that match the given pattern
def get_contact_by_index(self, index):
Undocumented
def get_contacts(self):
Returns a list with all the contacts stored in the SIM card
ReturnsReturns a list of re.MatchObject with the contacts.
Raisescommon.exceptions.ATErrorWhen no contacts are found.
common.exceptions.CMEErrorNotFoundWhen no contacts are found.
common.exceptions.CMEErrorSIMBusyWhen the SIM is not ready.
common.exceptions.CMEErrorSIMNotStartedWhen the SIM is not ready.
def get_available_charset(self):
Returns the available character sets
def get_card_version(self):
Returns the SIM card version
def get_card_model(self):
Returns the SIM card model
def get_charset(self):
Returns the current character set name
def get_imei(self):
Returns the IMEI number of the SIM card
def get_imsi(self):
Returns the IMSI number of the SIM card
def get_manufacturer_name(self):
Returns the manufacturer name of the SIM card
def get_netreg_status(self):
Returns the network registration status
def get_network_info(self):
Returns a tuple with the network info
def get_network_names(self):
Returns a tuple with the network info
def get_roaming_ids(self):
Returns a list with the networks we can register with
def get_free_contact_ids(self):
Returns a deque with the not used contact ids
def get_next_contact_id(self):
Returns the next free contact id
def get_signal_level(self):
Returns a tuple with the RSSI and BER of the connection
def get_sms(self):
Returns a list with all the messages stored in the SIM card
ReturnsReturns a list of re.MatchObject with the messages.
Raisescommon.exceptions.ATErrorWhen no messages are found.
common.exceptions.CMEErrorNotFoundWhen no messages are found.
common.exceptions.CMEErrorSIMBusyWhen the SIM is not ready.
common.exceptions.CMEErrorSIMNotStartedWhen the SIM is not ready.
common.exceptions.CMSError500When the SIM is not ready.
def get_sms_by_index(self, index):
Returns the message stored at index
def get_smsc(self):
Undocumented
def get_phonebook_size(self):
Returns the phonebook size of the SIM card
ReturnsA re.MatchObject with the size of the phonebook
Raisescommon.exceptions.CMEErrorSIMBusyWhen the SIM is not ready.
common.exceptions.CMSError500When the SIM is not ready.
common.exceptions.ATErrorWhen the SIM is not ready.
def get_pin_status(self):
Checks wether the pin is enabled or disabled
def get_used_contact_ids(self):
Returns a list with the used contact ids
def get_used_sms_ids(self):
Returns a list with used SMS ids in the SIM card
def register_with_network(self, netid, mode=1, format=2):
Registers with the given netid
def reset_settings(self):
Resets the settings to factory settings
def send_at(self, at_str):
Send an arbitrary AT string to the SIM card
def send_pin(self, pin):
Sends the PIN to the SIM card
def send_puk(self, puk, pin):
Sends PUK and PIN to the SIM card
ReturnsTrue if everything went ok
Raisescommon.exceptions.ATErrorException raised by Nozomi when the PUK is incorrect.
common.exceptions.CMEErrorIncorrectPasswordException raised when the PUK is incorrect.
def send_sms(self, pdu, pdu_len):
Sends the given pdu and returns the index
def set_charset(self, charset):
Sets the character set used on the SIM
def set_netreg_notification(self, val=1):
Sets CREG unsolicited notification
def set_network_info_format(self, mode=0, format=2):
Undocumented
def set_sms_format(self, format=1):
Sets the format of the SMS
def set_sms_indication(self, mode=2, mt=1, bm=0, ds=0, bfr=0):
Sets the SMS indication mode
def set_smsc(self, number):
Sets the SMSC
API Documentation for vodafone-mobile-connect-card-driver-for-linux, generated by pydoctor at 2008-01-10 13:06:31.