forked from M-Labs/artiq
tweak moninj to allow old dashboard with new firmware
This commit is contained in:
parent
04cbc3237b
commit
6fc8439399
|
@ -56,15 +56,15 @@ class CommMonInj:
|
|||
self._writer.write(packet)
|
||||
|
||||
def monitor_injection(self, enable, channel, overrd):
|
||||
packet = struct.pack(">bblb", 1, enable, channel, overrd)
|
||||
packet = struct.pack(">bblb", 3, enable, channel, overrd)
|
||||
self._writer.write(packet)
|
||||
|
||||
def inject(self, channel, override, value):
|
||||
packet = struct.pack(">blbb", 2, channel, override, value)
|
||||
packet = struct.pack(">blbb", 1, channel, override, value)
|
||||
self._writer.write(packet)
|
||||
|
||||
def get_injection_status(self, channel, override):
|
||||
packet = struct.pack(">blb", 3, channel, override)
|
||||
packet = struct.pack(">blb", 2, channel, override)
|
||||
self._writer.write(packet)
|
||||
|
||||
async def _receive_cr(self):
|
||||
|
|
|
@ -54,17 +54,17 @@ impl HostMessage {
|
|||
channel: reader.read_u32()?,
|
||||
probe: reader.read_u8()?
|
||||
},
|
||||
1 => HostMessage::MonitorInjection {
|
||||
enable: if reader.read_u8()? == 0 { false } else { true },
|
||||
channel: reader.read_u32()?,
|
||||
overrd: reader.read_u8()?
|
||||
},
|
||||
2 => HostMessage::Inject {
|
||||
1 => HostMessage::Inject {
|
||||
channel: reader.read_u32()?,
|
||||
overrd: reader.read_u8()?,
|
||||
value: reader.read_u8()?
|
||||
},
|
||||
3 => HostMessage::GetInjectionStatus {
|
||||
2 => HostMessage::GetInjectionStatus {
|
||||
channel: reader.read_u32()?,
|
||||
overrd: reader.read_u8()?
|
||||
},
|
||||
3 => HostMessage::MonitorInjection {
|
||||
enable: if reader.read_u8()? == 0 { false } else { true },
|
||||
channel: reader.read_u32()?,
|
||||
overrd: reader.read_u8()?
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue