curl seems to work

pull/12/head
Alan Johnston 7 years ago
parent f2f21cea26
commit 7f0ec0d1e8

@ -94,27 +94,27 @@ int ax25_tx_frame(ax25_conf_t *hax25, ax5043_conf_t *hax,
printf("\n"); printf("\n");
char post_data[512]; char post_data[1024];
char hex_data[118]; char hex_data[512];
char hex_octet[4]; char hex_octet[4];
time_t t = time(NULL); time_t t = time(NULL);
struct tm tm = *localtime(&t); struct tm tm = *localtime(&t);
memset(post_data,0,strlen(post_data)); memset(post_data,0,strlen(post_data));
memset(hex_data,0,strlen(hex_data)); memset(hex_data,0,strlen(hex_data));
printf("1:%s\n",post_data); //printf("1:%s\n",post_data);
int jj; int jj;
for(jj = 0; jj < 118; jj++) { for(jj = 0; jj < 118; jj++) {
sprintf(hex_octet, "%02x",__tx_buffer[jj]); sprintf(hex_octet, "%02x",__tx_buffer[jj]);
strcat(hex_data, hex_octet); strcat(hex_data, hex_octet);
} }
memset(post_data,0,strlen(post_data)); //memset(post_data,0,strlen(post_data));
printf("2:%s\n",post_data); //printf("2:%s\n",post_data);
//sprintf(post_data,"curl --data \"noradID=99999&source=KU2Y&timestamp=%d-%d-%dT%d:%d:%d.500Z&frame=%s&locator=longLat&longitude=75.3492W&latitude=40.0376N&&azimuth=360&elevation=90.0\" https://db.satnogs.org/api/telemetry/", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour + 4, tm.tm_min, tm.tm_sec, hex_data); //sprintf(post_data,"curl --data \"noradID=99999&source=KU2Y&timestamp=%d-%d-%dT%d:%d:%d.500Z&frame=%s&locator=longLat&longitude=75.3492W&latitude=40.0376N&&azimuth=360&elevation=90.0\" https://db.satnogs.org/api/telemetry/", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour + 4, tm.tm_min, tm.tm_sec, hex_data);
sprintf(post_data,"noradID=99999&source=KU2Y&timestamp=%d-%d-%dT%d:%d:%d.500Z&frame=%s&locator=longLat&longitude=75.3492W&latitude=40.0376N&&azimuth=360&elevation=90.0", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour + 4, tm.tm_min, tm.tm_sec, hex_data); sprintf(post_data,"noradID=99999&source=KU2Y&timestamp=%d-%d-%dT%d:%d:%d.500Z&frame=%s&locator=longLat&longitude=75.3492W&latitude=40.0376N&&azimuth=360&elevation=90.0", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour + 4, tm.tm_min, tm.tm_sec, hex_data);
//printf("%s&locator=longLat&longitude=75.3492W&latitude=40.0376N&&azimuth=360&elevation=90.0\" https://db.satnogs.org/api/telemetry/\n\n", hex_data); //printf("%s&locator=longLat&longitude=75.3492W&latitude=40.0376N&&azimuth=360&elevation=90.0\" https://db.satnogs.org/api/telemetry/\n\n", hex_data);
printf("3:%s\n",post_data); printf("curl post data: %s\n",post_data);
CURL *curl; CURL *curl;
CURLcode res; CURLcode res;

Loading…
Cancel
Save

Powered by TurnKey Linux.