check tlm each channel

pull/1/head
Alan Johnston 7 years ago
parent c6f82ca0bf
commit b520230ea5

@ -89,7 +89,19 @@ int main(void)
int channel; // AO-7 telemetry format has 6 channels, 4 sub channels in each int channel; // AO-7 telemetry format has 6 channels, 4 sub channels in each
int msg_length; int msg_length;
while(1) { // loop forever
for (channel = 0; channel < 7; channel++) {
if (channel == 0) { // start with telemetry header "hi hi" plus a few chars to help CW decoding software sync
msg_length = encode_header(&packet[0], MAX_MESSAGE_LENGTH + 1);
printf("\nINFO: Sending TLM header\n");
} else {
FILE* file = popen("mpcmd show data 2>&1", "r"); FILE* file = popen("mpcmd show data 2>&1", "r");
char cmdbuffer[1000]; char cmdbuffer[1000];
fgets(cmdbuffer, 1000, file); fgets(cmdbuffer, 1000, file);
pclose(file); pclose(file);
@ -97,7 +109,6 @@ int main(void)
char mopower[64][14]; char mopower[64][14];
char * data; char * data;
int i = 0; int i = 0;
data = strtok (cmdbuffer," "); data = strtok (cmdbuffer," ");
@ -111,23 +122,12 @@ int main(void)
printf("Battery voltage = %s ADC5 = %s ADC6 = %s ADC7 = %s ADC8 %s \n", printf("Battery voltage = %s ADC5 = %s ADC6 = %s ADC7 = %s ADC8 %s \n",
mopower[VBATT],mopower[ADC5],mopower[ADC6],mopower[ADC7],mopower[ADC8]); mopower[VBATT],mopower[ADC5],mopower[ADC6],mopower[ADC7],mopower[ADC8]);
float vbat; float vbat;
//char s[100] ="7.0800" ;
vbat = strtof(mopower[VBATT], NULL); vbat = strtof(mopower[VBATT], NULL);
printf(" vbat: %f \n", vbat); printf(" vbat: %f \n", vbat);
int tlm_3a = (int)((vbat * 10) - 65.5); int tlm_3a = (int)((vbat * 10) - 65.5);
printf("TLM 3A = %d \n", tlm_3a); printf("TLM 3A = %d \n", tlm_3a);
while(1) { // loop forever
for (channel = 0; channel < 7; channel++) {
if (channel == 0) { // start with telemetry header "hi hi" plus a few chars to help CW decoding software sync
msg_length = encode_header(&packet[0], MAX_MESSAGE_LENGTH + 1);
printf("\nINFO: Sending TLM header\n");
} else {
msg_length = encode_tlm(&packet[0], channel, // add a channel with dummy data to buffer msg_length = encode_tlm(&packet[0], channel, // add a channel with dummy data to buffer
tlm_3a, channel+1, channel+2, channel+3, tlm_3a, channel+1, channel+2, channel+3,
(MAX_MESSAGE_LENGTH + 1)); (MAX_MESSAGE_LENGTH + 1));

Loading…
Cancel
Save

Powered by TurnKey Linux.