9 usage_obj = bus.get_object("org.freesmartphone.ousaged", "/org/freesmartphone/Usage")
10 usage_iface = dbus.Interface(usage_obj, "org.freesmartphone.Usage")
11 usage_iface.RequestResource("GSM")
13 gsm_device_obj = bus.get_object("org.freesmartphone.ogsmd", "/org/freesmartphone/GSM/Device")
14 gsm_sim_iface = dbus.Interface(gsm_device_obj, "org.freesmartphone.GSM.SIM")
16 if gsm_sim_iface.GetAuthStatus() == 'SIM PIN':
17 gsm_sim_iface.SendAuthCode(pin)
18 if gsm_sim_iface.GetAuthStatus() == 'READY':
21 usage_iface.ReleaseResource("GSM")
23 if __name__ == "__main__":
25 if len(sys.argv) != 2:
26 sys.stderr.write("usage: %s <pin>\n")