diff --git a/src/proto.h b/src/proto.h index c61c3a9..a852f7f 100644 --- a/src/proto.h +++ b/src/proto.h @@ -89,6 +89,8 @@ enum { REQ_GCFG_GRAB, /* get device grabbing: R[0] state R[6] status */ REQ_SCFG_SERDEV, /* set serial device path: Q[0-5] next 24 bytes Q[6] remaining length - R[6] status */ REQ_GCFG_SERDEV, /* get serial device path: R[0-5] next 24 bytes R[6] remaining length or -1 for failure */ + REQ_SCFG_REPEAT, /* set repeat interval: Q[0] interval (msec) - R[6] status */ + REQ_GCFG_REPEAT, /* get repeat interval: R[0] interval (msec) R[6] status */ /* TODO ... more */ REQ_CFG_SAVE = 0x3ffe, /* save config file: R[6] status */ REQ_CFG_RESTORE, /* load config from file: R[6] status */ @@ -176,7 +178,9 @@ const char *spnav_reqnames_3000[] = { "SCFG_GRAB", "GCFG_GRAB", "SCFG_SERDEV", - "GCFG_SERDEV" + "GCFG_SERDEV", + "SCFG_REPEAT", + "GCFG_REPEAT" }; const int spnav_reqnames_1000_size = sizeof spnav_reqnames_1000 / sizeof *spnav_reqnames_1000; diff --git a/src/proto_unix.c b/src/proto_unix.c index 3caa484..20a3334 100644 --- a/src/proto_unix.c +++ b/src/proto_unix.c @@ -615,6 +615,16 @@ static int handle_request(struct client *c, struct reqresp *req) spnav_send_str(c->sock, req->type, cfg.serial_dev); break; + case REQ_SCFG_REPEAT: + cfg.repeat_msec = req->data[0]; + sendresp(c, req, 0); + break; + + case REQ_GCFG_REPEAT: + req->data[0] = cfg.repeat_msec; + sendresp(c, req, 0); + break; + case REQ_CFG_SAVE: sendresp(c, req, write_cfg(cfgfile, &cfg)); break;