Lines Matching full:self
78 def __init__(self,ifname,wpas_dbus_interface,addr, argument
81 self.ifname = ifname
82 self.wpas_dbus_interface = wpas_dbus_interface
83 self.wps_method = wps_method
84 self.go_intent = go_intent
85 self.addr = addr
86 self.pin = pin
89 self.wpas_dbus_opath = \
90 "/" + self.wpas_dbus_interface.replace(".","/")
91 self.wpas_wpas_dbus_interfaces_opath = \
92 self.wpas_dbus_opath + "/Interfaces"
93 self.wpas_dbus_interfaces_interface = \
94 self.wpas_dbus_interface + ".Interface"
95 self.wpas_dbus_interfaces_p2pdevice = \
96 self.wpas_dbus_interfaces_interface + ".P2PDevice"
100 self.bus = dbus.SystemBus()
101 self.wpas_object = self.bus.get_object(
102 self.wpas_dbus_interface,
103 self.wpas_dbus_opath)
104 self.wpas = dbus.Interface(
105 self.wpas_object, self.wpas_dbus_interface)
108 self.path = None
110 self.path = self.wpas.GetInterface(ifname)
113 self.wpas_dbus_interface + \
117 path = self.wpas.CreateInterface(
123 self.wpas_dbus_interface + \
128 self.interface_object = self.bus.get_object(
129 self.wpas_dbus_interface,self.path)
130 self.p2p_interface = dbus.Interface(
131 self.interface_object,
132 self.wpas_dbus_interfaces_p2pdevice)
135 self.bus.add_signal_receiver(GONegotiationSuccess,
136 dbus_interface=self.wpas_dbus_interfaces_p2pdevice,
138 self.bus.add_signal_receiver(GONegotiationFailure,
139 dbus_interface=self.wpas_dbus_interfaces_p2pdevice,
141 self.bus.add_signal_receiver(GroupStarted,
142 dbus_interface=self.wpas_dbus_interfaces_p2pdevice,
144 self.bus.add_signal_receiver(WpsFailure,
145 dbus_interface=self.wpas_dbus_interfaces_p2pdevice,
150 def constructArguements(self): argument
152 self.p2p_connect_arguements = {'wps_method':self.wps_method,
153 'peer':dbus.ObjectPath(self.path+'/Peers/'+self.addr)}
156 if (self.wps_method == 'display'):
157 if (self.pin != None):
158 self.p2p_connect_arguements.update({'pin':self.pin})
164 if (self.go_intent != None and int(self.go_intent) != 15):
167 self.go_intent = '15'
170 elif (self.wps_method == 'keypad'):
171 if (self.pin != None):
172 self.p2p_connect_arguements.update({'pin':self.pin})
178 if (self.go_intent != None and int(self.go_intent) == 15):
187 elif (self.wps_method == 'pin'):
188 if (self.pin != None):
192 elif (self.wps_method == 'pbc'):
193 if (self.pin != None):
202 if (self.go_intent != None):
203 self.p2p_connect_arguements.update(
204 {'go_intent':dbus.Int32(self.go_intent)})
207 def run(self): argument
209 result_pin = self.p2p_interface.Connect(
210 self.p2p_connect_arguements)
215 if (self.wps_method == 'pin' and \
216 not self.p2p_connect_arguements.has_key('pin') ):