diff --git a/owlps-udp-to-http/owlps-udp-to-http.c b/owlps-udp-to-http/owlps-udp-to-http.c index 98cae3a..0048abc 100644 --- a/owlps-udp-to-http/owlps-udp-to-http.c +++ b/owlps-udp-to-http/owlps-udp-to-http.c @@ -16,12 +16,14 @@ * * The only HTTP request currently implemented is "ReadSimpleResults". * Answer in case of error: - * SimpleResults;NOK + * SimpleResults;NOK;Explanation * Normal answer: * SimpleResults;OK;Nb_results;Result_1;…;Result_n - * Nb_results is the number of results in the answer. + * Nb_results is the number of results in the answer (number of mobiles). * Result_i follows this format: - * Mobile_MAC;Algorithm_name;X;Y;Z;Area_name + * Mobile_MAC;X;Y;Z;Area_name + * Area_name is the name of the area or room in which the mobile is (may + * be empty). * * If a unknown request is received, the answer format is: * UnknownRequest;NOK @@ -298,7 +300,7 @@ void* tcp_server(void *NULL_value) answer_len += answer_begin_len ; answer_buf_len = - answer_len + answer_begin_len + + answer_len + nb_results * OWL_CSV_RESULT_STRLEN ; answer = realloc(answer, answer_buf_len) ; @@ -307,7 +309,7 @@ void* tcp_server(void *NULL_value) { char result_str[OWL_CSV_RESULT_STRLEN] ; size_t result_len ; - owl_result_to_csv(result_str, result->result) ; + owl_result_to_csv_simple(result_str, result->result) ; result_len = strlen(result_str) ; answer[answer_len++] = ';' ; strncpy(answer + answer_len, result_str,