File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8787 REQ_GCFG_GRAB , /* get device grabbing: R[0] state R[6] status */
8888 REQ_SCFG_SERDEV , /* set serial device path: Q[0-5] next 24 bytes Q[6] remaining length - R[6] status */
8989 REQ_GCFG_SERDEV , /* get serial device path: R[0-5] next 24 bytes R[6] remaining length or -1 for failure */
90+ REQ_SCFG_REPEAT , /* set repeat interval: Q[0] interval (msec) - R[6] status */
91+ REQ_GCFG_REPEAT , /* get repeat interval: R[0] interval (msec) R[6] status */
9092 /* TODO ... more */
9193 REQ_CFG_SAVE = 0x3ffe , /* save config file: R[6] status */
9294 REQ_CFG_RESTORE , /* load config from file: R[6] status */
@@ -174,7 +176,9 @@ const char *spnav_reqnames_3000[] = {
174176 "SCFG_GRAB" ,
175177 "GCFG_GRAB" ,
176178 "SCFG_SERDEV" ,
177- "GCFG_SERDEV"
179+ "GCFG_SERDEV" ,
180+ "SCFG_REPEAT" ,
181+ "GCFG_REPEAT"
178182};
179183
180184const int spnav_reqnames_1000_size = sizeof spnav_reqnames_1000 / sizeof * spnav_reqnames_1000 ;
Original file line number Diff line number Diff line change 11/*
22This file is part of libspnav, part of the spacenav project (spacenav.sf.net)
3- Copyright (C) 2007-2022 John Tsiombikas <nuclear@member.fsf.org>
3+ Copyright (C) 2007-2023 John Tsiombikas <nuclear@member.fsf.org>
44
55Redistribution and use in source and binary forms, with or without
66modification, are permitted provided that the following conditions are met:
@@ -1094,3 +1094,23 @@ int spnav_cfg_get_serial(char *buf, int bufsz)
10941094{
10951095 return request_str (REQ_GCFG_SERDEV , buf , bufsz , TIMEOUT );
10961096}
1097+
1098+ int spnav_cfg_set_repeat (int msec )
1099+ {
1100+ struct reqresp rr = {0 };
1101+
1102+ if (msec < 0 ) msec = -1 ;
1103+
1104+ rr .data [0 ] = msec ;
1105+ return request (REQ_SCFG_REPEAT , & rr , TIMEOUT );
1106+ }
1107+
1108+ int spnav_cfg_get_repeat (void )
1109+ {
1110+ struct reqresp rr = {0 };
1111+
1112+ if (request (REQ_GCFG_REPEAT , & rr , TIMEOUT ) == -1 ) {
1113+ return -1 ;
1114+ }
1115+ return rr .data [0 ];
1116+ }
Original file line number Diff line number Diff line change 11/*
22This file is part of libspnav, part of the spacenav project (spacenav.sf.net)
3- Copyright (C) 2007-2022 John Tsiombikas <nuclear@member.fsf.org>
3+ Copyright (C) 2007-2023 John Tsiombikas <nuclear@member.fsf.org>
44
55Redistribution and use in source and binary forms, with or without
66modification, are permitted provided that the following conditions are met:
@@ -376,6 +376,9 @@ int spnav_cfg_get_grab(void); /* returns 0:no-grab/1:grab, or -1 on error */
376376int spnav_cfg_set_serial (const char * devpath );
377377int spnav_cfg_get_serial (char * buf , int bufsz );
378378
379+ int spnav_cfg_set_repeat (int msec );
380+ int spnav_cfg_get_repeat (void );
381+
379382#ifdef __cplusplus
380383}
381384#endif
You can’t perform that action at this time.
0 commit comments