pub struct FakeCameraBuilder { /* private fields */ }Expand description
Builder for configuring and starting a fake GigE Vision camera.
Implementations§
Source§impl FakeCameraBuilder
impl FakeCameraBuilder
Sourcepub fn pixel_format(self, code: u32) -> Self
pub fn pixel_format(self, code: u32) -> Self
Sourcepub fn zip_xml(self, enable: bool) -> Self
pub fn zip_xml(self, enable: bool) -> Self
Serve the GenApi XML as a ZIP archive (default: plain XML).
Many real cameras (Basler, FLIR, Hikrobot, …) publish their register-description XML zipped; enable this to exercise that path.
Sourcepub fn enforce_heartbeat(self, enable: bool) -> Self
pub fn enforce_heartbeat(self, enable: bool) -> Self
Release control privilege when the controller stops sending GVCP commands
for longer than GevHeartbeatTimeout (default: off).
See registers::RegisterMap::enforce_heartbeat for why this is not the
default even though every real device behaves this way.
Sourcepub fn max_packet_size(self, max: u32) -> Self
pub fn max_packet_size(self, max: u32) -> Self
Clamp GevSCPSPacketSize to max, the way a real camera caps it.
A request above max is acknowledged and silently reduced, so the
register reads back lower than what was written. Off by default: the
fake accepts any size, which is what every existing test expects.
The fake accepted anything until 0.4.1, so it could not express the camera behind #112 and no test could have caught that defect — the ADR-0019 failure mode of a fake that only ever agrees with its client.
Sourcepub fn max_on_wire(self, max: u32) -> Self
pub fn max_on_wire(self, max: u32) -> Self
Silently drop any GVSP datagram larger than max, as a network path
with a smaller frame ceiling than either endpoint believes does.
Different from FakeCameraBuilder::max_packet_size, and the
difference is the whole of
#112: that
camera accepts and stores 16114, then streams nothing, because the
link tops out at a 9216-byte frame. No register read can find that —
only a test packet can.
Sourcepub fn heartbeat_timeout_ms(self, timeout_ms: u32) -> Self
pub fn heartbeat_timeout_ms(self, timeout_ms: u32) -> Self
Report a different GevHeartbeatTimeout than the 3 000 ms default.
A shorter window keeps a test that has to wait one out from dominating the suite’s runtime.
Sourcepub async fn build(self) -> Result<FakeCamera, Error>
pub async fn build(self) -> Result<FakeCamera, Error>
Start the fake camera and return a handle.