Compare commits
2 Commits
a3b4ffc76d
...
d4bc537cbd
Author | SHA1 | Date | |
---|---|---|---|
d4bc537cbd | |||
8037568f38 |
@ -37,8 +37,7 @@ pub fn run(allocator: std.mem.Allocator) !void {
|
||||
const client = try server.accept();
|
||||
defer {
|
||||
log.info("disconnecting client", .{});
|
||||
if (!config.rotctl.autopark)
|
||||
interface.rotator.stop();
|
||||
interface.rotator.stop();
|
||||
client.stream.close();
|
||||
}
|
||||
|
||||
@ -61,11 +60,10 @@ pub fn run(allocator: std.mem.Allocator) !void {
|
||||
}
|
||||
|
||||
// loop ended due to client disconnect
|
||||
if (interface.running and config.rotctl.autopark)
|
||||
if (interface.running and config.rotctl.autopark) {
|
||||
interface.rotator.startPark();
|
||||
}
|
||||
}
|
||||
|
||||
interface.rotator.control_thread.join();
|
||||
}
|
||||
|
||||
fn write(self: *RotCtl, buf: []const u8) !void {
|
||||
@ -177,6 +175,7 @@ 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),
|
||||
@ -247,8 +246,8 @@ const HamlibCommand = struct {
|
||||
};
|
||||
|
||||
const rotctl_commands = [_]HamlibCommand{
|
||||
.{ .long = "quit", .callback = quit },
|
||||
.{ .long = "exit", .callback = quit },
|
||||
.{ .short = 'q', .callback = quit }, // quit
|
||||
.{ .short = 'Q', .callback = quit }, // quit
|
||||
.{ .long = "AOS", .callback = blindAck },
|
||||
.{ .long = "LOS", .callback = blindAck },
|
||||
.{ .short = 'P', .long = "set_pos", .callback = setPosition }, // azimuth: f64, elevation: f64
|
||||
|
Loading…
x
Reference in New Issue
Block a user