Update main.c check c2cStatus each time

beta-ft2
Alan Johnston 1 year ago committed by GitHub
parent bb3a9da6d3
commit 4aa8febd55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -81,7 +81,7 @@ int main(int argc, char * argv[]) {
}
FILE * command_file = fopen("/home/pi/CubeSatSim/command_control", "r");
if (command_file == NULL) {
if (command_file == NULL) {
fprintf(stderr,"Command and control is OFF\n");
c2cStatus = 0;
} else {
@ -94,7 +94,8 @@ int main(int argc, char * argv[]) {
c2cStatus = 2;
}
}
printf("c2cStatus: %d", c2cStatus);
printf("c2cStatus: %d", c2cStatus);
char resbuffer[1000];
// const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//' | grep '9000'";
const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//'";
@ -1567,7 +1568,28 @@ void get_tlm_fox() {
(i2c_bus0 == OFF) * 16 + (i2c_bus1 == OFF) * 32 + (i2c_bus3 == OFF) * 64 + (camera == OFF) * 128 + groundCommandCount * 256;
encodeA(b, 51 + head_offset, status);
printf("c2cStatus: %d \n", c2cStatus);
FILE * command_file = fopen("/home/pi/CubeSatSim/command_control", "r");
if (command_file == NULL) {
if (c2cStatus != 0) {
fprintf(stderr,"Command and control is OFF\n");
c2cStatus = 0;
}
} else {
command_file = fopen("/home/pi/CubeSatSim/command_control_direwolf", "r");
if (command_file == NULL) {
if (c2cStatus != 1) {
fprintf(stderr,"Command and control Carrier (squelch) is ON\n");
c2cStatus = 1;
}
} else {
if (c2cStatus != 2) {
fprintf(stderr,"Command and control DTMF or APRS is ON\n");
c2cStatus = 2;
}
}
}
printf("c2cStatus: %d", c2cStatus);
encodeB(b, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4);
if (txAntennaDeployed == 0) {

Loading…
Cancel
Save

Powered by TurnKey Linux.