From f68ac4909508aece6c8a8285f8498660ff6921d3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 28 Feb 2026 20:23:12 -0500 Subject: [PATCH] Update main.c start and stop pacsatsim.service --- main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 42e07e43..174a3bbb 100644 --- a/main.c +++ b/main.c @@ -236,7 +236,7 @@ int main(int argc, char * argv[]) { printf("Mode is Transmit Command\n"); } else if ( mode_string == 'p') { mode = PACSAT; - printf("Mode is Pacsat\n"); + printf("Mode is Pacsat\n"); } else if ( mode_string == 'P') { mode = PACSATGND; printf("Mode is Pacsat Ground Station\n"); @@ -246,6 +246,15 @@ int main(int argc, char * argv[]) { } } + if ( mode == PACSAT) { + FILE * pacsat_file = popen("sudo systemctl start cubesatsim", "r"); + pclose(pacsat_file); + } + else { + FILE * pacsat_file = popen("sudo systemctl stop cubesatsim", "r"); + pclose(pacsat_file); + } + // Open telemetry file with STEM Payload Data telem_file = fopen("/home/pi/CubeSatSim/telem.txt", "a"); if (telem_file == NULL)