Include the number of bytes corrected by the FEC when uploading SSDV packets

pull/2/head
Philip Heron 2012-09-16 14:30:38 +01:00
rodzic f949296a64
commit 59a93b2743
2 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -61,7 +61,7 @@ private:
/* Private functions */
void feed_buffer(uint8_t byte, uint8_t erasure);
void clear_buffer();
void upload_packet();
void upload_packet(int fixes);
void save_image(uint8_t *jpeg, size_t length);
void render_image(uint8_t *jpeg, size_t length);

Wyświetl plik

@ -292,13 +292,14 @@ static void *upload_packet_thread(void *arg)
}
/* TODO: HABITAT-LATER upload using habitat */
void ssdv_rx::upload_packet()
void ssdv_rx::upload_packet(int fixes)
{
ssdv_post_data_t *t;
pthread_attr_t attr;
pthread_t thread;
const char *callsign;
char *packet;
char data[10];
struct curl_httppost* post = NULL;
struct curl_httppost* last = NULL;
CURL *curl;
@ -315,6 +316,11 @@ void ssdv_rx::upload_packet()
curl_formadd(&post, &last, CURLFORM_COPYNAME, "encoding",
CURLFORM_COPYCONTENTS, "hex", CURLFORM_END);
/* Include the number of bytes corrected by the FEC */
snprintf(data, 10, "%i", fixes);
curl_formadd(&post, &last, CURLFORM_COPYNAME, "fixes",
CURLFORM_COPYCONTENTS, data, CURLFORM_END);
/* URL-encode the packet */
packet = (char *) malloc((SSDV_PKT_SIZE * 2) + 1);
if(!packet)
@ -401,7 +407,7 @@ void ssdv_rx::put_byte(uint8_t byte, int lost)
image_errors += i;
/* Packet received.. upload to server */
if (dl_fldigi::online()) upload_packet();
if (dl_fldigi::online()) upload_packet(i);
/* Read the header */
ssdv_dec_header(&pkt_info, b);