# `gammu.smsd` – SMSD access

## `SMSD`

class gammu.smsd.SMSD(Config)

  SMSD main class, that is used for communication with phone.

  You don’t need to run the SMS daemon in the python script to control or ask it for status, this can be also done on separately running instances (`gammu-smsd`). All you need to do for this is to give same configuration file as that instance is using. For more infos look into Gammu SMSD Overview.

  Parameters:

    Config (str) – Path to SMSD configuration file.

  MainLoop(MaxFailures)

    Runs SMS daemon main loop.

    Please note that this will run until some serious error occurs or until terminated by `Shutdown()`.

    Parameters:

      MaxFailures (int) – After how many init failures SMSD ends. Defaults to 0, what means never.

    Returns:

      None

    Return type:

      None

  Shutdown()

    Signals SMS daemon to stop.

    Returns:

      None

    Return type:

      None

  GetStatus()

    Returns SMSD status.

    The following values are set in resulting dictionary:

    Client

    > Client software name.

    PhoneID

    > PhoneID which can be used for multiple SMSD setup.

    IMEI

    > IMEI of currently connected phone.

    Sent

    > Number of sent messages.

    Received

    > Number of received messages.

    Failed

    > Number of failed messages.

    BatterPercent

    > Last battery state as reported by connected phone.

    NetworkSignal

    > Last signal level as reported by connected phone.

    Returns:

      Dict with status values

    Return type:

      dict

  InjectSMS(Message)

    Injects SMS message into outgoing messages queue in SMSD.

    Parameters:

      Message (list of SMS Object) – Message to inject (can be multipart)

    Returns:

      ID of inserted message

    Return type:

      str