![]() |
Get ismi from dbus and python
Hi guys , how can i convert the following statement to python + dbus ?
dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.SIM /com/nokia/phone/SIM Phone.Sim.get_imsi |
Re: Get ismi from dbus and python
Check the current Healthcheck code ;) - it was done in python and uses dbus as well as terminal commands :)
(It will be replaced with a c++ version shortly though!) But here's an example of using dbus from within python Code:
def funcDevOri(): Or..... (This is the one you want, as it gets the IMEI, so not too far from what you need!!) Code:
def funcIMEI(): Code:
def FMTxPropertiesInterfaceConnect(): |
Re: Get ismi from dbus and python
Quote:
isn't there a way to conver this statement to a python+dbus call... Calling dbus-send sometimes blocks and i get zombie proccesses. dbus-send --system --print-reply --type=method_call --dest=com.nokia.phone.SIM /com/nokia/phone/SIM/security Phone.Sim.Security.get_imei |
Re: Get ismi from dbus and python
Hi colchaodemola,
not sure what you mean? There are 3 different ways to do it above and the middle one will output the imei exactly as yuo want it in python? |
Re: Get ismi from dbus and python
Hi noobmonkey, it is better i explain with examples:
i can turn this dbus-send call dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"message" IN import dbus bus = dbus.SystemBus() iface = dbus.Interface(bus.get_object('org.freedesktop.Not ifications', '/org/freedesktop/Notifications'), 'org.freedesktop.Notifications') iface.SystemNoteInfoprint('message') but how can i convert bus-send --system --print-reply --type=method_call --dest=com.nokia.phone.SIM /com/nokia/phone/SIM/security Phone.Sim.Security.get_imei' in to that second way ? |
Re: Get ismi from dbus and python
Quote:
bus = dbus.SystemBus() iface = dbus.Interface(bus.get_object('com.nokia.phone.SIM ', '/com/nokia/phone/SIM/security Phone.Sim.Security.get_imei'), iface.SystemNoteInfoprint('get_imei') i think, not sure though, will take alook tonight :) |
Re: Get ismi from dbus and python
import dbus
bus = dbus.SystemBus() imsiObj = bus.get_object('com.nokia.phone.SIM', '/com/nokia/phone/SIM') imsiiface = dbus.Interface(imsiObj, 'Phone.Sim') print imsiiface.get_imsi()[0] |
All times are GMT. The time now is 02:13. |
vBulletin® Version 3.8.8