Skip to content

Commit

Permalink
add can messges for lld testing
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj committed Mar 15, 2024
1 parent d0c2b5c commit 5c1c040
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
3 changes: 3 additions & 0 deletions hardware/opentrons_hardware/firmware_bindings/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class MessageId(int, Enum):
execute_move_group_request = 0x18
clear_all_move_groups_request = 0x19
home_request = 0x20
add_sensor_move_request = 0x23
move_completed = 0x13

motor_position_request = 0x12
Expand Down Expand Up @@ -249,6 +250,7 @@ class MessageId(int, Enum):
peripheral_status_request = 0x8C
peripheral_status_response = 0x8D
baseline_sensor_response = 0x8E
send_accumulated_pressure_data = 0x8F

set_hepa_fan_state_request = 0x90
get_hepa_fan_state_request = 0x91
Expand Down Expand Up @@ -402,6 +404,7 @@ class MoveStopCondition(int, Enum):
stall = 0x10
ignore_stalls = 0x20
limit_switch_backoff = 0x40
sensor_report = 0x80


@unique
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,19 @@ class AddLinearMoveRequest(BaseMessage): # noqa: D101
message_id: Literal[MessageId.add_move_request] = MessageId.add_move_request


@dataclass
class AddSensorLinearMoveRequest(BaseMessage): # noqa: D101
"""Sensor Linear Move Request."""

payload: payloads.AddSensorLinearMoveBasePayload
payload_type: Type[
payloads.AddSensorLinearMoveBasePayload
] = payloads.AddSensorLinearMoveBasePayload
message_id: Literal[
MessageId.add_sensor_move_request
] = MessageId.add_sensor_move_request


@dataclass
class GetMoveGroupRequest(BaseMessage): # noqa: D101
payload: payloads.MoveGroupRequestPayload
Expand Down Expand Up @@ -977,3 +990,16 @@ class GetHepaUVStateResponse(BaseMessage):
message_id: Literal[
MessageId.get_hepa_uv_state_response
] = MessageId.get_hepa_uv_state_response


@dataclass
class SendAccumulatedPressureDataRequest(BaseMessage):
"""Send all the saved sensor data."""

payload: payloads.SendAccumulatedPressureDataPayload
payload_type: Type[
payloads.SendAccumulatedPressureDataPayload
] = payloads.SendAccumulatedPressureDataPayload
message_id: Literal[
MessageId.send_accumulated_pressure_data
] = MessageId.send_accumulated_pressure_data
14 changes: 14 additions & 0 deletions hardware/opentrons_hardware/firmware_bindings/messages/payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,13 @@ class BindSensorOutputResponsePayload(SensorPayload):
binding: SensorOutputBindingField


@dataclass(eq=False)
class AddSensorLinearMoveBasePayload(AddLinearMoveRequestPayload):
"""A request to add a linear move that also requires sensor reading for its duration."""

sensor_id: SensorIdField


@dataclass(eq=False)
class PipetteInfoResponsePayload(EmptyPayload):
"""A response carrying data about an attached pipette."""
Expand Down Expand Up @@ -668,3 +675,10 @@ class GetHepaUVStatePayloadResponse(EmptyPayload):
uv_duration_s: utils.UInt32Field
uv_light_on: utils.UInt8Field
remaining_time_s: utils.UInt32Field


@dataclass(eq=False)
class SendAccumulatedPressureDataPayload(EmptyPayload):
"""Send queued readings from a sensor."""

sensor_id: SensorIdField
2 changes: 0 additions & 2 deletions hardware/opentrons_hardware/hardware_control/tool_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ async def liquid_probe(
):
return await sensor_runner.run(can_messenger=messenger)

return positions


async def check_overpressure(
messenger: CanMessenger,
Expand Down

0 comments on commit 5c1c040

Please sign in to comment.