Home | History | Annotate | Download | only in servo

Lines Matching refs:port

37         'port': 'Port\s+([\w]+)',
125 def execute_pd_state_cmd(self, port):
130 the dict containing port, polarity, role, pd_state, and flags.
132 @param port: Type C PD port 0 or 1
138 pd_cmd = cmd +" " + str(port) + " " + subcmd
141 ['(Port.*) - (Role:.*)\n'])
154 def get_pd_state(self, port):
157 @param port: Type C PD port 0/1
161 pd_dict = self.execute_pd_state_cmd(port)
164 def get_pd_port(self, port):
165 """Get the current PD port
167 @param port: Type C PD port 0/1
170 pd_dict = self.execute_pd_state_cmd(port)
171 return pd_dict['port']
173 def get_pd_role(self, port):
176 @param port: Type C PD port 0/1
179 pd_dict = self.execute_pd_state_cmd(port)
182 def get_pd_flags(self, port):
185 @param port: Type C PD port 0/1
188 pd_dict = self.execute_pd_state_cmd(port)
231 expected state of a conneciton. Record the port number
234 @returns: dict with params port, connect, and state
237 port = 0;
239 status['port'] = port
240 state = self.get_pd_state(port)
241 # Check port 0 first
246 port = 1
247 status['port'] = port
248 state = self.get_pd_state(port)
249 # Check port 1
256 def swap_power_role(self, port):
266 @param port: pd port number
274 if self.is_pd_connected(port) == False:
277 current_pr = self.get_pd_state(port)
278 swap_cmd = 'pd %d swap power' % port
281 new_pr = self.get_pd_state(port)
283 if self.is_pd_connected(port) == False:
301 def is_pd_flag_set(self, port, key):
307 @param port: Port which has the active PD connection
312 pd_flags = self.get_pd_flags(port)
315 def is_pd_connected(self, port):
318 @param port: port to be used for pd console commands
320 @returns True if port is in connected state
322 state = self.get_pd_state(port)
353 def _verify_plankton_connection(self, port):
357 given port by first verifying if a PD connection is present.
359 If the port is no longer in the connected state, and following
363 @param port: DUT pd port to test
372 if self.dut_console.is_pd_connected(port):
376 # Verify that DUT PD port is no longer connected
377 if self.dut_console.is_pd_connected(port) == False:
380 if self.dut_console.is_pd_connected(port):
381 logging.info('Plankton connection verified on port %d',
382 port)
385 # Could have disconnected other port, allow it to reconnect
391 """Find the PD port which is connected to Plankton
393 @returns DUT pd port number if found, None otherwise
395 for port in xrange(self.dut_console.PD_MAX_PORTS):
396 # Check for DUT to Plankton connection on port
397 if self._verify_plankton_connection(port):
399 return port