Compare commits
3 Commits
d4bc537cbd
...
a3b4ffc76d
Author | SHA1 | Date | |
---|---|---|---|
a3b4ffc76d | |||
c295c941e9 | |||
de487d18c5 |
@ -37,7 +37,8 @@ pub fn run(allocator: std.mem.Allocator) !void {
|
||||
const client = try server.accept();
|
||||
defer {
|
||||
log.info("disconnecting client", .{});
|
||||
interface.rotator.stop();
|
||||
if (!config.rotctl.autopark)
|
||||
interface.rotator.stop();
|
||||
client.stream.close();
|
||||
}
|
||||
|
||||
@ -60,10 +61,11 @@ 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 {
|
||||
@ -175,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),
|
||||
@ -246,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
|
||||
|
Loading…
x
Reference in New Issue
Block a user