From a3b4ffc76dac115586a99c62b11beb977adca683 Mon Sep 17 00:00:00 2001 From: torque Date: Thu, 18 Jul 2024 23:35:32 -0700 Subject: [PATCH] rotctl: only support long quit command gpredict actually sends either q or Q when disconnecting. This is not actually a supported command according to my reading of the rotctld documentation. `q`/`Q` for quitting is limited to the interactive rotctl prompt. For autoparking, we don't want to quit when gpredict disconnects. Also in general, we probably don't want to quit when gpredict disconnects. I still want to have a quit command when using this via netcat or whatever, so make them a form gpredict probably does not send. --- src/RotCtl.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/RotCtl.zig b/src/RotCtl.zig index 3dffebc..4520205 100644 --- a/src/RotCtl.zig +++ b/src/RotCtl.zig @@ -177,7 +177,6 @@ fn handleHamlibCommand( if (first.len == 1 or first[0] == '\\') { switch (first[0]) { // NOTE: this is not technically supported by rotctld. - 'q', 'Q' => try self.quit(first, &tokens), 'S' => try self.stop(first, &tokens), 'K' => try self.park(first, &tokens), 'p' => try self.getPosition(first, &tokens), @@ -248,8 +247,8 @@ const HamlibCommand = struct { }; const rotctl_commands = [_]HamlibCommand{ - .{ .short = 'q', .callback = quit }, // quit - .{ .short = 'Q', .callback = quit }, // quit + .{ .long = "quit", .callback = quit }, + .{ .long = "exit", .callback = quit }, .{ .long = "AOS", .callback = blindAck }, .{ .long = "LOS", .callback = blindAck }, .{ .short = 'P', .long = "set_pos", .callback = setPosition }, // azimuth: f64, elevation: f64