pyecsca.sca.target.simpleserial module¶
Provides an abstract target class communicating using the ChipWhisperer’s SimpleSerial protocol.
- class SimpleSerialMessage(char, data)[source]¶
Bases:
object
A SimpleSerial message consisting of a starting character and a hexadecimal string.
- class SimpleSerialTarget[source]¶
Bases:
SerialTarget
,ABC
A SimpleSerial-ish target, sends and receives SimpleSerial messages over a serial link.
- abstract read(num=0, timeout=0)[source]¶
Read upto
num
bytes or untiltimeout
milliseconds from the target’s serial output.
- recv_msgs(timeout)[source]¶
Receive
SimpleSerialMessage
messages, while waiting uptotimeout
seconds.- Parameters:
timeout¶ (
int
) – How long to wait.- Return type:
Mapping
[str
,SimpleSerialMessage
]- Returns:
The received messages with their char.
- abstract write(data)[source]¶
Write the
data
bytes to the target’s serial input.- Parameters:
data¶ (
bytes
) – The data to write.- Return type:
None
- send_cmd(cmd, timeout)[source]¶
Send a
SimpleSerialMessage
and receive the response messages that the command produces, within atimeout
.- Parameters:
cmd¶ (
SimpleSerialMessage
) – The command message to send.timeout¶ (
int
) – The timeout value to wait for the responses.
- Return type:
Mapping
[str
,SimpleSerialMessage
]- Returns:
A mapping of the starting character of the message to the message.