Browse Source

Update console_httpd to new libwebsockets

Make a few servers conditional on ctrl file
Improve some socket logging.
jeroen
Jeroen Vreeken 5 years ago
parent
commit
a9121c8af2
40 changed files with 140 additions and 65 deletions
  1. +3
    -3
      common/log/log.c
  2. +34
    -37
      console/console/console_httpd.c
  3. +2
    -0
      controller/block/block_bridge_pwm.test.ctrl
  4. +2
    -0
      controller/block/block_command_bool.test.ctrl
  5. +2
    -0
      controller/block/block_command_float.test.ctrl
  6. +2
    -0
      controller/block/block_command_uint32.test.ctrl
  7. +1
    -0
      controller/block/block_filter_iir.test.ctrl
  8. +2
    -0
      controller/block/block_gain.test.ctrl
  9. +2
    -0
      controller/block/block_gain_ratio_abs.test.ctrl
  10. +2
    -0
      controller/block/block_i2t.test.ctrl
  11. +2
    -0
      controller/block/block_limit.test.ctrl
  12. +2
    -0
      controller/block/block_limit_switch.test.ctrl
  13. +2
    -0
      controller/block/block_limit_var.test.ctrl
  14. +2
    -0
      controller/block/block_log.test.ctrl
  15. +2
    -0
      controller/block/block_matrix_2x2.test.ctrl
  16. +2
    -0
      controller/block/block_motor_model_dc_v.test.ctrl
  17. +2
    -0
      controller/block/block_not.test.ctrl
  18. +2
    -0
      controller/block/block_oneshot.test.ctrl
  19. +2
    -0
      controller/block/block_pid_aw.test.ctrl
  20. +1
    -1
      controller/block/block_quadrature_decoder.c
  21. +2
    -0
      controller/block/block_quadrature_decoder.test.ctrl
  22. +2
    -0
      controller/block/block_quantize.test.ctrl
  23. +2
    -0
      controller/block/block_rangecheck.test.ctrl
  24. +2
    -0
      controller/block/block_servo_state.test.ctrl
  25. +2
    -0
      controller/block/block_setpoint_generator_1d.test.ctrl
  26. +2
    -0
      controller/block/block_setpoint_generator_3d.test.ctrl
  27. +1
    -0
      controller/block/block_state_machine.test.ctrl
  28. +3
    -3
      controller/controller/controller_command.c
  29. +7
    -0
      controller/controller/controller_load.h
  30. +3
    -3
      controller/controller/controller_trace.c
  31. +18
    -9
      controller/dt_ctrl.c
  32. +9
    -5
      controller/dt_ctrl.ctrl
  33. +4
    -4
      controller/shell/shell.c
  34. +2
    -0
      controller/test/test.test.ctrl
  35. +2
    -0
      controller/test/test_import.test.ctrl
  36. +2
    -0
      controller/test/test_link.test.ctrl
  37. +2
    -0
      controller/test/test_module.test.ctrl
  38. +2
    -0
      controller/test/test_multifrequency.test.ctrl
  39. +1
    -0
      controller/test/test_multifrequency_fail.ctrl
  40. +1
    -0
      controller/test/test_variables.test.ctrl

+ 3
- 3
common/log/log.c View File

@ -212,7 +212,7 @@ static void *log_server(void *arg)
fd_accept = socket(AF_INET, SOCK_STREAM, 0);
if (fd_accept < 0) {
perror("socket() failed");
printf("ERROR: log_server: socket() failed: %d\n", errno);
return NULL;
}
@ -224,13 +224,13 @@ static void *log_server(void *arg)
if (bind(fd_accept,
(struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) {
perror("bind() failed");
printf("ERROR: log_server: bind() failed: %d\n", errno);
close(fd_accept);
fd_accept = -1;
}
if (fd_accept >= 0 && listen(fd_accept, 4) < 0) {
perror("listen() failed");
printf("ERROR: log_server: listen() failed: %d\n", errno);
close(fd_accept);
fd_accept = -1;
}


+ 34
- 37
console/console/console_httpd.c View File

@ -46,8 +46,7 @@ struct writebuf {
};
struct ws_client {
struct libwebsocket_context *context;
struct libwebsocket *wsi;
struct lws *wsi;
struct writebuf *writeq;
@ -102,7 +101,7 @@ struct writebuf *writebuf_next(struct ws_client *client)
struct ws_client *ws_client_list = NULL;
struct ws_client *ws_client_add(struct libwebsocket_context *context, struct libwebsocket *wsi)
struct ws_client *ws_client_add(struct lws *wsi)
{
struct ws_client *client;
@ -110,7 +109,6 @@ struct ws_client *ws_client_add(struct libwebsocket_context *context, struct lib
if (!client)
return NULL;
client->context = context;
client->wsi = wsi;
client->next = ws_client_list;
@ -137,7 +135,7 @@ void ws_client_remove(struct ws_client *client)
}
}
struct ws_client *ws_client_get_by_wsi(struct libwebsocket *wsi)
struct ws_client *ws_client_get_by_wsi(struct lws *wsi)
{
struct ws_client *entry;
@ -159,13 +157,13 @@ void ws_client_flush(struct ws_client *client)
wb = writebuf_next(client);
libwebsocket_write(client->wsi, (unsigned char *)wb->msg, wb->msg_len, LWS_WRITE_TEXT);
lws_write(client->wsi, (unsigned char *)wb->msg, wb->msg_len, LWS_WRITE_TEXT);
writebuf_free(wb);
}
if (client->writeq) {
libwebsocket_callback_on_writable(client->context, client->wsi);
lws_callback_on_writable(client->wsi);
}
}
@ -213,7 +211,7 @@ static void poll_set(int fd, short events)
#define LINEBUF_SIZE 8192
struct status {
char *ident;
struct libwebsocket *wsi;
struct lws *wsi;
int fd;
char *host;
int port;
@ -230,7 +228,7 @@ struct status {
struct status *status_list;
static void start_status(struct libwebsocket *wsi, char *ident)
static void start_status(struct lws *wsi, char *ident)
{
struct status *status = calloc(sizeof(struct status), 1);
char *host;
@ -338,7 +336,7 @@ static int status_reconnect(struct status *status)
return 0;
}
static int status_remove(struct libwebsocket *wsi)
static int status_remove(struct lws *wsi)
{
struct status **status;
struct status **next;
@ -366,7 +364,7 @@ static int status_remove(struct libwebsocket *wsi)
struct trace *traces[MAX_TRACE_ELEMENTS];
int count_traces = 0;
static int trace_remove(struct libwebsocket *wsi)
static int trace_remove(struct lws *wsi)
{
int n;
for (n = 0; n < count_traces; n++) {
@ -388,7 +386,7 @@ static int trace_remove(struct libwebsocket *wsi)
static void handler_trace_value(struct trace *trace, int channel,
struct trace_value *value)
{
struct libwebsocket *wsi;
struct lws *wsi;
struct ws_client *ws_client;
struct writebuf *wb;
@ -442,7 +440,7 @@ static void handler_trace_value(struct trace *trace, int channel,
ws_client_flush(ws_client);
}
static void start_trace(struct libwebsocket *wsi, int freq, char *variable)
static void start_trace(struct lws *wsi, int freq, char *variable)
{
struct trace *trace;
struct timespec t_int;
@ -593,7 +591,7 @@ err:
#define READ_SIZE 4096
int exec_cgi(struct libwebsocket *wsi, char *requested_uri, char *resource_path)
int exec_cgi(struct lws *wsi, char *requested_uri, char *resource_path)
{
FILE *fpipe;
unsigned char *outdata = NULL;
@ -617,7 +615,7 @@ int exec_cgi(struct libwebsocket *wsi, char *requested_uri, char *resource_path)
} while (r > 0);
if (!lws_send_pipe_choked(wsi))
libwebsocket_write(wsi, outdata, pos, LWS_WRITE_HTTP);
lws_write(wsi, outdata, pos, LWS_WRITE_HTTP);
pclose(fpipe);
free(outdata);
@ -626,31 +624,31 @@ int exec_cgi(struct libwebsocket *wsi, char *requested_uri, char *resource_path)
return -1;
}
int list_dir(struct libwebsocket_context *context, struct libwebsocket *wsi, char *requested_uri, char *resource_path)
int list_dir(struct lws *wsi, char *requested_uri, char *resource_path)
{
unsigned char *outdata = malloc(1000);
size_t pos = 0;
struct dirent **namelist;
int n, i;
unsigned char *h = outdata;
char *server = "console_httpd libwebsockets";
char *server = "console_httpd lws";
char *type = "text/html";
if (lws_add_http_header_status(context, wsi, 200, &h, outdata + 1000))
if (lws_add_http_header_status(wsi, 200, &h, outdata + 1000))
return 1;
if (lws_add_http_header_by_token(context, wsi,
if (lws_add_http_header_by_token(wsi,
WSI_TOKEN_HTTP_SERVER,
(unsigned char *)server, strlen(server), &h, outdata + 1000))
return 1;
if (lws_add_http_header_by_token(context, wsi,
if (lws_add_http_header_by_token(wsi,
WSI_TOKEN_HTTP_CONTENT_TYPE,
(unsigned char *)type, strlen(type), &h, outdata + 1000))
return 1;
if (lws_finalize_http_header(context, wsi, &h, outdata + 1000))
if (lws_finalize_http_header(wsi, &h, outdata + 1000))
return 1;
pos += h - outdata;
libwebsocket_write(wsi, outdata, pos, LWS_WRITE_HTTP_HEADERS);
lws_write(wsi, outdata, pos, LWS_WRITE_HTTP_HEADERS);
free(outdata);
outdata = NULL;
pos = 0;
@ -677,7 +675,7 @@ int list_dir(struct libwebsocket_context *context, struct libwebsocket *wsi, cha
free(namelist);
if (!lws_send_pipe_choked(wsi))
libwebsocket_write(wsi, outdata, pos, LWS_WRITE_HTTP);
lws_write(wsi, outdata, pos, LWS_WRITE_HTTP);
free(outdata);
@ -686,9 +684,8 @@ int list_dir(struct libwebsocket_context *context, struct libwebsocket *wsi, cha
static int callback_http(struct libwebsocket_context *context,
struct libwebsocket *wsi,
enum libwebsocket_callback_reasons reason, void *user,
static int callback_http(struct lws *wsi,
enum lws_callback_reasons reason, void *user,
void *in, size_t len)
{
int r = 0;
@ -701,7 +698,7 @@ static int callback_http(struct libwebsocket_context *context,
ws_client = ws_client_get_by_wsi(wsi);
if (!ws_client) {
ws_client = ws_client_add(context, wsi);
ws_client = ws_client_add(wsi);
}
if (!strncmp(rcv, "status ", 7)) {
@ -814,7 +811,7 @@ static int callback_http(struct libwebsocket_context *context,
stat(resource_path, &statbuf);
if (S_ISDIR(statbuf.st_mode)) {
r = list_dir(context, wsi, requested_uri, resource_path);
r = list_dir(wsi, requested_uri, resource_path);
} else if (!strcmp(
resource_path + strlen(resource_path) - strlen(".cgi"),
".cgi")) {
@ -832,7 +829,7 @@ static int callback_http(struct libwebsocket_context *context,
if (!mime)
mime = "application/octet-stream";
r = libwebsockets_serve_http_file(context, wsi,
r = lws_serve_http_file(wsi,
resource_path, mime, NULL, 0);
}
@ -841,19 +838,19 @@ static int callback_http(struct libwebsocket_context *context,
}
case LWS_CALLBACK_ADD_POLL_FD: {
struct libwebsocket_pollargs *args = in;
struct lws_pollargs *args = in;
poll_add(args->fd, args->events);
break;
}
case LWS_CALLBACK_DEL_POLL_FD: {
struct libwebsocket_pollargs *args = in;
struct lws_pollargs *args = in;
poll_remove(args->fd);
break;
}
case LWS_CALLBACK_CHANGE_MODE_POLL_FD: {
struct libwebsocket_pollargs *args = in;
struct lws_pollargs *args = in;
poll_set(args->fd, args->events);
break;
@ -878,7 +875,7 @@ static int callback_http(struct libwebsocket_context *context,
return r;
}
static struct libwebsocket_protocols protocols[] = {
static struct lws_protocols protocols[] = {
// first protocol must always be HTTP handler
{
"http-only", // name
@ -895,7 +892,7 @@ int main(void) {
if (magic_load(magic, NULL))
printf("magic_load failed\n");
struct libwebsocket_context *context;
struct lws_context *context;
struct lws_context_creation_info creation_info = {
.port = dt_host_htdocs_port(),
.iface = NULL,
@ -904,7 +901,7 @@ int main(void) {
.uid = -1,
};
context = libwebsocket_create_context(&creation_info);
context = lws_create_context(&creation_info);
if (context == NULL) {
fprintf(stderr, "libwebsocket init failed\n");
@ -947,7 +944,7 @@ int main(void) {
break;
}
}
libwebsocket_service_fd(context, &pollfds[n]);
lws_service_fd(context, &pollfds[n]);
}
now = time(NULL);
@ -970,7 +967,7 @@ int main(void) {
}
}
libwebsocket_context_destroy(context);
lws_context_destroy(context);
magic_close(magic);
return 0;


+ 2
- 0
controller/block/block_bridge_pwm.test.ctrl View File

@ -82,3 +82,5 @@ params {
}
}
}
set trace_server false

+ 2
- 0
controller/block/block_command_bool.test.ctrl View File

@ -42,3 +42,5 @@ params {
(int) { $[COMMAND_ID_NONE], 123, 234, 567, 666, 777, $[COMMAND_ID_NONE], $[COMMAND_ID_NONE], $[COMMAND_ID_NONE], $[COMMAND_ID_NONE] }
}
}
set trace_server false

+ 2
- 0
controller/block/block_command_float.test.ctrl View File

@ -43,3 +43,5 @@ params {
(int) { $[COMMAND_ID_NONE], 123, 234, 567, 666, 777, $[COMMAND_ID_NONE], $[COMMAND_ID_NONE], $[COMMAND_ID_NONE], $[COMMAND_ID_NONE] }
}
}
set trace_server false

+ 2
- 0
controller/block/block_command_uint32.test.ctrl View File

@ -42,3 +42,5 @@ params {
(int) { $[COMMAND_ID_NONE], 123, 234, 567, 666, 777, $[COMMAND_ID_NONE], $[COMMAND_ID_NONE], $[COMMAND_ID_NONE], $[COMMAND_ID_NONE] }
}
}
set trace_server false

+ 1
- 0
controller/block/block_filter_iir.test.ctrl View File

@ -44,3 +44,4 @@ params {
{ "gain", "gain", (float) 0.1 }
}
set trace_server false

+ 2
- 0
controller/block/block_gain.test.ctrl View File

@ -23,3 +23,5 @@ params {
(float) { 0.0, 0.0, 0.0, 0.0 }
}
}
set trace_server false

+ 2
- 0
controller/block/block_gain_ratio_abs.test.ctrl View File

@ -30,3 +30,5 @@ params {
(float) { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }
}
}
set trace_server false

+ 2
- 0
controller/block/block_i2t.test.ctrl View File

@ -67,3 +67,5 @@ params {
}
}
}
set trace_server false

+ 2
- 0
controller/block/block_limit.test.ctrl View File

@ -29,3 +29,5 @@ params {
(float) { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }
}
}
set trace_server false

+ 2
- 0
controller/block/block_limit_switch.test.ctrl View File

@ -87,3 +87,5 @@ params {
}
}
}
set trace_server false

+ 2
- 0
controller/block/block_limit_var.test.ctrl View File

@ -35,3 +35,5 @@ params {
(float) { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }
}
}
set trace_server false

+ 2
- 0
controller/block/block_log.test.ctrl View File

@ -25,3 +25,5 @@ params {
false, false, false, false, false
}}
}
set trace_server false

+ 2
- 0
controller/block/block_matrix_2x2.test.ctrl View File

@ -42,3 +42,5 @@ params {
(float) { 0.0, 0.0, 0.0, 0.0 }
}
}
set trace_server false

+ 2
- 0
controller/block/block_motor_model_dc_v.test.ctrl View File

@ -34,3 +34,5 @@ params {
(float) { 0.0, 0.0, 0.0001, 0.0 }
}
}
set trace_server false

+ 2
- 0
controller/block/block_not.test.ctrl View File

@ -19,3 +19,5 @@ params {
{ "test_input", "value", 2, (int) { false, true } }
{ "test_output", "value", 2, (int) { true, false } }
}
set trace_server false

+ 2
- 0
controller/block/block_oneshot.test.ctrl View File

@ -43,3 +43,5 @@ params {
}
}
}
set trace_server false

+ 2
- 0
controller/block/block_pid_aw.test.ctrl View File

@ -59,3 +59,5 @@ params {
(float) { 0.0, 0.0, 0.0, 0.0, inf, inf, inf, inf, inf, 0.0}
}
}
set trace_server false

+ 1
- 1
controller/block/block_quadrature_decoder.c View File

@ -117,7 +117,7 @@ static void calculate(struct controller_block *block)
if ((INPUT(home) == true) && (VAR(last_home) == false)) {
// rising edge on 'home' input
if (pos != 0) {
log_send(LOG_T_DEBUG, "homing @ %d\n", pos);
log_send(LOG_T_DEBUG, "homing @ %d", pos);
}
pos = 0;
}


+ 2
- 0
controller/block/block_quadrature_decoder.test.ctrl View File

@ -49,3 +49,5 @@ params {
}
}
}
set trace_server false

+ 2
- 0
controller/block/block_quantize.test.ctrl View File

@ -27,3 +27,5 @@ params {
(float) { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }
}
}
set trace_server false

+ 2
- 0
controller/block/block_rangecheck.test.ctrl View File

@ -33,3 +33,5 @@ params {
{ false, true, false, false, false, false, true }
}
}
set trace_server false

+ 2
- 0
controller/block/block_servo_state.test.ctrl View File

@ -67,3 +67,5 @@ params {
{ "reset", "value", 5, (int) { true, true, true, false, true } }
{ "enable", "value", 5, (int) { false, false, true, true, false } }
}
set trace_server false

+ 2
- 0
controller/block/block_setpoint_generator_1d.test.ctrl View File

@ -71,3 +71,5 @@ params {
(int)0xffffffff, 201,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff,(int)0xffffffff}
}
}
set trace_server false

+ 2
- 0
controller/block/block_setpoint_generator_3d.test.ctrl View File

@ -118,3 +118,5 @@ params {
301, (int)0xffffffff }
}
}
set trace_server false

+ 1
- 0
controller/block/block_state_machine.test.ctrl View File

@ -102,3 +102,4 @@ params {
1, 0, 1, 0, 1, 0, 1, 0, 0, 1 } }
}
set trace_server false

+ 3
- 3
controller/controller/controller_command.c View File

@ -221,7 +221,7 @@ static void *controller_command_server(void *arg)
listen_sock = socket(AF_INET, SOCK_STREAM, 0);
if (listen_sock < 0) {
perror("socket() failed");
log_send(LOG_T_ERROR, "controller_command_server: socket() failed: %d", errno);
return NULL;
}
@ -234,13 +234,13 @@ static void *controller_command_server(void *arg)
if (bind(listen_sock,
(struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) {
perror("bind() failed");
log_send(LOG_T_ERROR, "controller_command_server: bind() failed: %d", errno);
close(listen_sock);
return NULL;
}
if (listen(listen_sock, 8) < 0) {
perror("listen() failed");
log_send(LOG_T_ERROR, "controller_command_server: listen() failed: %d", errno);
close(listen_sock);
return NULL;
}


+ 7
- 0
controller/controller/controller_load.h View File

@ -30,4 +30,11 @@ int controller_load(char *filename);
int controller_load_check_arg(char **expected_types, int supplied_argc,
char **supplied_types);
char * controller_load_variable_string_get(char *varname);
void controller_load_variable_string_set(char *varname, char *val);
int controller_load_variable_int_get(char *varname);
void controller_load_variable_int_set(char *varname, int i);
#endif /* _INCLUDE_CONTROLLER_LOAD_H_ */

+ 3
- 3
controller/controller/controller_trace.c View File

@ -387,7 +387,7 @@ static void *controller_trace_server(void *arg)
listen_sock = socket(AF_INET, SOCK_STREAM, 0);
if (listen_sock < 0) {
perror("socket() failed");
log_send(LOG_T_ERROR, "controller_trace: socket() failed: %d", errno);
return NULL;
}
@ -400,13 +400,13 @@ static void *controller_trace_server(void *arg)
if (bind(listen_sock,
(struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) {
perror("bind() failed");
log_send(LOG_T_ERROR, "controller_trace: bind() failed: %d", errno);
close(listen_sock);
return NULL;
}
if (listen(listen_sock, 8) < 0) {
perror("listen() failed");
log_send(LOG_T_ERROR, "controller_trace: listen() failed: %d", errno);
close(listen_sock);
return NULL;
}


+ 18
- 9
controller/dt_ctrl.c View File

@ -1,5 +1,5 @@
/*
Copyright Jeroen Vreeken (pe1rxq@amsat.org), 2007 - 2013
Copyright Jeroen Vreeken (pe1rxq@amsat.org), 2007 - 2016
Copyright Stichting C.A. Muller Radioastronomiestation, 2007 - 2013
This program is free software: you can redistribute it and/or modify
@ -17,7 +17,7 @@
*/
/*
dt_ctr.c
dt_ctrl.c
Main loop for the DT controller.
Here the controller network is initialized.
@ -74,6 +74,12 @@ int main(int argc, char **argv)
ctrl_filename = argv[1];
controller_load_variable_int_set("shell", 0);
controller_load_variable_string_set("shell_intro", shell_intro);
controller_load_variable_string_set("shell_prompt", shell_prompt);
controller_load_variable_int_set("trace_server", 1);
/* Create and link blocks */
log_send(LOG_T_DEBUG, "Going to load controller file '%s'",
ctrl_filename);
@ -91,17 +97,20 @@ int main(int argc, char **argv)
for (i = 0; i < blocks; i++) {
outputs += controller_block_get(i)->outputs;
}
controller_trace_server_start(CTRL_TRACE_PORT, outputs);
if (controller_load_variable_int_get("trace_server"))
controller_trace_server_start(CTRL_TRACE_PORT, outputs);
/* Start command shell */
controller_sample_shell_add();
controller_load_shell_add();
if (controller_load_variable_int_get("shell")) {
controller_sample_shell_add();
controller_load_shell_add();
shell_intro = "Dwingeloo Telescope controller\n";
shell_prompt = "DT>";
shell_intro = controller_load_variable_string_get("shell_intro");
shell_prompt = controller_load_variable_string_get("shell_prompt");
shell_server_start(CTRL_SHELL_PORT, 10);
shell_server_start(CTRL_SHELL_PORT, 10);
}
asprintf(&dot_filename, "%s.dot", ctrl_filename);
controller_dumpdot(dot_filename);


+ 9
- 5
controller/dt_ctrl.ctrl View File

@ -25,13 +25,13 @@ trigger {
# Uncomment either the real network, or the sim network.
# But never both!
import "dt_ctrl_el.ctrl"
#import "dt_ctrl_el_sim.ctrl"
#import "dt_ctrl_el.ctrl"
import "dt_ctrl_el_sim.ctrl"
import "dt_ctrl_az.ctrl"
#import "dt_ctrl_az_sim.ctrl"
#import "dt_ctrl_az.ctrl"
import "dt_ctrl_az_sim.ctrl"
#import "dt_ctrl_ec_sim.ctrl"
import "dt_ctrl_ec_sim.ctrl"
@ -468,6 +468,10 @@ params {
{ "elevation_safety_hw_bottom", "init", true }
}
set shell true
set shell_intro "Dwingeloo Telescope controller"
set shell_prompt "DT>"
# Load file with calibration parameters.
# All parameters above should not be subject to calibration.
include "dt_ctrl.param"

+ 4
- 4
controller/shell/shell.c View File

@ -172,7 +172,7 @@ static void *shell_handle(void *arg)
shell_hdl[i].outsize = sprintf(
shell_hdl[i].outbuf,
"%s", shell_intro);
"%s\n", shell_intro);
shell_hdl[i].state = SHELL_OUTPUT;
}
if (shell_hdl[i].outsize) {
@ -285,7 +285,7 @@ static void *shell_server(void *arg)
fd_accept = socket(AF_INET, SOCK_STREAM, 0);
if (fd_accept < 0) {
perror("socket() failed");
log_send(LOG_T_ERROR, "shell: socket() failed: %d", errno);
return NULL;
}
@ -297,13 +297,13 @@ static void *shell_server(void *arg)
if (bind(fd_accept,
(struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) {
perror("bind() failed");
log_send(LOG_T_ERROR, "shell: bind() failed: %d", errno);
close(fd_accept);
return NULL;
}
if (listen(fd_accept, 4) < 0) {
perror("listen() failed");
log_send(LOG_T_ERROR, "shell: listen() failed: %d", errno);
close(fd_accept);
return NULL;
}


+ 2
- 0
controller/test/test.test.ctrl View File

@ -54,3 +54,5 @@ params {
#empty params
params{}
set trace_server 0

+ 2
- 0
controller/test/test_import.test.ctrl View File

@ -34,3 +34,5 @@ params {
(float) { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }
}
}
set trace_server 0

+ 2
- 0
controller/test/test_link.test.ctrl View File

@ -24,3 +24,5 @@ links {
#empty links
links{}
set trace_server false

+ 2
- 0
controller/test/test_module.test.ctrl View File

@ -98,3 +98,5 @@ params {
(float) { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }
}
}
set trace_server false

+ 2
- 0
controller/test/test_multifrequency.test.ctrl View File

@ -82,3 +82,5 @@ params {
3, 13, 23, 33, 39 }
}
}
set trace_server false

+ 1
- 0
controller/test/test_multifrequency_fail.ctrl View File

@ -29,3 +29,4 @@ blocks (200.0, 0.0) {
{ "value_bool", "b200" }
}
set trace_server false

+ 1
- 0
controller/test/test_variables.test.ctrl View File

@ -1,3 +1,4 @@
set trace_server false
trigger {
{ "immediate" }


Loading…
Cancel
Save