mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive Class Reference
Inheritance diagram for mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive:

## Public Member Functions

| __init__ (self, name)
| write_kv (self, key, value)
| Forms and sends Key-Value protocol message.
| read (self, count)
| Read data from DUT.
| write (self, payload, log=False)
| Read data from DUT.
| flush (self)
| Flush read/write channels of DUT.
| reset (self)
| Reset the dut.
| connected (self)
| Check if there is a connection to DUT.
| error (self)
| Returns LAST_ERROR value.
| finish (self)
| Handle DUT dtor like (close resource) operations here.

## Public Attributes

| LAST_ERROR
| logger
| polling_timeout

## Detailed Description

Definition at line 29 of file conn_primitive.py.

## Constructor & Destructor Documentation

## __init__()

mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive.__init__ | ( |  | self,
|  |  | name
| ) |  |

Reimplemented in mbed_host_tests.host_tests_conn_proxy.conn_primitive_fastmodel.FastmodelConnectorPrimitive, mbed_host_tests.host_tests_conn_proxy.conn_primitive_remote.RemoteConnectorPrimitive, and mbed_host_tests.host_tests_conn_proxy.conn_primitive_serial.SerialConnectorPrimitive.

Definition at line 31 of file conn_primitive.py.

## Member Function Documentation

## connected()

mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive.connected | ( |  | self | ) |

Check if there is a connection to DUT.

Returns
  True if there is conenction to DUT (read/write/flush API works)

Reimplemented in mbed_host_tests.host_tests_conn_proxy.conn_primitive_fastmodel.FastmodelConnectorPrimitive, mbed_host_tests.host_tests_conn_proxy.conn_primitive_remote.RemoteConnectorPrimitive, and mbed_host_tests.host_tests_conn_proxy.conn_primitive_serial.SerialConnectorPrimitive.

Definition at line 75 of file conn_primitive.py.

## error()

mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive.error | ( |  | self | ) |

Returns LAST_ERROR value.

Returns
  Value of self.LAST_ERROR

Definition at line 81 of file conn_primitive.py.

## finish()

mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive.finish | ( |  | self | ) |

Handle DUT dtor like (close resource) operations here.

Reimplemented in mbed_host_tests.host_tests_conn_proxy.conn_primitive_fastmodel.FastmodelConnectorPrimitive, mbed_host_tests.host_tests_conn_proxy.conn_primitive_remote.RemoteConnectorPrimitive, and mbed_host_tests.host_tests_conn_proxy.conn_primitive_serial.SerialConnectorPrimitive.

Definition at line 87 of file conn_primitive.py.

## flush()

mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive.flush | ( |  | self | ) |

Flush read/write channels of DUT.

Reimplemented in mbed_host_tests.host_tests_conn_proxy.conn_primitive_fastmodel.FastmodelConnectorPrimitive, mbed_host_tests.host_tests_conn_proxy.conn_primitive_remote.RemoteConnectorPrimitive, and mbed_host_tests.host_tests_conn_proxy.conn_primitive_serial.SerialConnectorPrimitive.

Definition at line 66 of file conn_primitive.py.

## read()

mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive.read | ( |  | self,
|  |  | count
| ) |  |

Read data from DUT.

Parameters

  count | Number of bytes to read

Returns
  Bytes read

Reimplemented in mbed_host_tests.host_tests_conn_proxy.conn_primitive_fastmodel.FastmodelConnectorPrimitive, mbed_host_tests.host_tests_conn_proxy.conn_primitive_remote.RemoteConnectorPrimitive, and mbed_host_tests.host_tests_conn_proxy.conn_primitive_serial.SerialConnectorPrimitive.

Definition at line 51 of file conn_primitive.py.

## reset()

mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive.reset | ( |  | self | ) |

Reset the dut.

Reimplemented in mbed_host_tests.host_tests_conn_proxy.conn_primitive_fastmodel.FastmodelConnectorPrimitive, mbed_host_tests.host_tests_conn_proxy.conn_primitive_remote.RemoteConnectorPrimitive, and mbed_host_tests.host_tests_conn_proxy.conn_primitive_serial.SerialConnectorPrimitive.

Definition at line 70 of file conn_primitive.py.

## write()

mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive.write | ( |  | self,
|  |  | payload,
|  |  | log = `False`
| ) |  |

Read data from DUT.

Parameters

  payload | Buffer with data to send
  log | Set to True if you want to enable logging for this function

Returns
  Payload (what was actually sent - if possible to establish that)

Reimplemented in mbed_host_tests.host_tests_conn_proxy.conn_primitive_fastmodel.FastmodelConnectorPrimitive, mbed_host_tests.host_tests_conn_proxy.conn_primitive_remote.RemoteConnectorPrimitive, and mbed_host_tests.host_tests_conn_proxy.conn_primitive_serial.SerialConnectorPrimitive.

Definition at line 58 of file conn_primitive.py.

## write_kv()

mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive.write_kv | ( |  | self,
|  |  | key,
|  |  | value
| ) |  |

Forms and sends Key-Value protocol message.

On how to parse K-V sent from DUT see KiViBufferWalker::KIVI_REGEX On how DUT sends K-V please see greentea_write_postamble() function in greentea-client

Returns
  Returns buffer with K-V message sent to DUT on success, None on failure

Definition at line 36 of file conn_primitive.py.

## Member Data Documentation

## LAST_ERROR

mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive.LAST_ERROR

Definition at line 32 of file conn_primitive.py.

## logger

mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive.logger

Definition at line 33 of file conn_primitive.py.

## polling_timeout

mbed_host_tests.host_tests_conn_proxy.conn_primitive.ConnectorPrimitive.polling_timeout

Definition at line 34 of file conn_primitive.py.

The documentation for this class was generated from the following file:

- mbed_host_tests/host_tests_conn_proxy/conn_primitive.py