Lines Matching refs:conn_socket

164 void write_bad_command_error(int conn_socket, char* command) {  in write_bad_command_error()  argument
168 write(conn_socket, tmp_write_buffer, num); in write_bad_command_error()
171 void write_string(int conn_socket, char* str) { in write_string() argument
175 write(conn_socket, tmp_write_buffer, num); in write_string()
178 void write_vastr(int conn_socket, char* format, ...) { in write_vastr() argument
185 write(conn_socket, tmp_write_buffer, num); in write_vastr()
194 static void write_uuid(int conn_socket, sound_trigger_uuid_t uuid) { in write_uuid() argument
195 …write_vastr(conn_socket, "%08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x\n", uuid.timeLow, uuid.time… in write_uuid()
243 bool parse_socket_data(int conn_socket, struct stub_sound_trigger_device* stdev);
362 static void send_event(int conn_socket, struct stub_sound_trigger_device* stdev, int event_type, in send_event() argument
370 write_string(conn_socket, "Bad sound model handle.\n"); in send_event()
376 write_string(conn_socket, "Not a valid UUID.\n"); in send_event()
473 void list_models(int conn_socket, char* buffer, in list_models() argument
478 write_string(conn_socket, "-----------------------\n"); in list_models()
481 write_string(conn_socket, "Zero models exist.\n"); in list_models()
484 write_vastr(conn_socket, "Model Index: %d\n", model_index); in list_models()
486 write_vastr(conn_socket, "Model handle: %d\n", last_model_context->model_handle); in list_models()
488 write_uuid(conn_socket, last_model_context->model_uuid); in list_models()
493 write_string(conn_socket, "Keyphrase sound Model.\n"); in list_models()
496 write_string(conn_socket, "Generic sound Model.\n"); in list_models()
499 write_vastr(conn_socket, "Unknown sound model type: %d\n", model_type); in list_models()
503 write_string(conn_socket, "Model started.\n"); in list_models()
506 write_string(conn_socket, "Model stopped.\n"); in list_models()
509 write_string(conn_socket, "-----------------------\n\n"); in list_models()
529 bool parse_socket_data(int conn_socket, struct stub_sound_trigger_device* stdev) { in parse_socket_data() argument
533 FILE* input_fp = fdopen(conn_socket, "r"); in parse_socket_data()
538 write_string(conn_socket, "\n>>> "); in parse_socket_data()
544 write_bad_command_error(conn_socket, command); in parse_socket_data()
546 list_models(conn_socket, buffer, stdev); in parse_socket_data()
548 send_event(conn_socket, stdev, EVENT_RECOGNITION, RECOGNITION_STATUS_SUCCESS); in parse_socket_data()
550 send_event(conn_socket, stdev, EVENT_RECOGNITION, RECOGNITION_STATUS_ABORT); in parse_socket_data()
552 send_event(conn_socket, stdev, EVENT_RECOGNITION, RECOGNITION_STATUS_FAILURE); in parse_socket_data()
554 send_event(conn_socket, stdev, EVENT_SOUND_MODEL, SOUND_MODEL_STATUS_UPDATED); in parse_socket_data()
559 write_string(conn_socket, "Closing this connection."); in parse_socket_data()
563 write_string(conn_socket, "End command received. Stopping connection."); in parse_socket_data()
567 write_vastr(conn_socket, "\nBad command %s.\n\n", command); in parse_socket_data()
574 write_string(conn_socket, "\n>>> "); in parse_socket_data()