diff --git a/pigpio.3 b/pigpio.3 index 6fdff76..efe0a80 100644 --- a/pigpio.3 +++ b/pigpio.3 @@ -6936,8 +6936,11 @@ and 611 control blocks on a lite channel. .IP "\fBint gpioCfgPermissions(uint64_t updateMask)\fP" .IP "" 4 -Configures pigpio to only allow updates (writes or mode changes) for the -GPIO specified by the mask. +Configures pigpio to restrict GPIO updates via the socket or pipe +interfaces to the GPIO specified by the mask. Programs directly +calling the pigpio library (i.e. linked with -lpigpio are not +affected). A GPIO update is a write to a GPIO or a GPIO mode +change or any function which would force such an action. .br @@ -6963,7 +6966,7 @@ added to the mask. .br .br -If the board revision is not recognised then GPIO 0-31 are allowed. +If the board revision is not recognised then GPIO 2-27 are allowed. .br @@ -10259,7 +10262,7 @@ A 16-bit word value. .br #define PI_DEFAULT_SOCKET_ADDR_STR "127.0.0.1" .br -#define PI_DEFAULT_UPDATE_MASK_UNKNOWN 0xFFFFFFFF +#define PI_DEFAULT_UPDATE_MASK_UNKNOWN 0x0000000FFFFFFCLL .br #define PI_DEFAULT_UPDATE_MASK_B1 0x03E7CF93 .br diff --git a/pigpio.c b/pigpio.c index 9337595..8b121f9 100644 --- a/pigpio.c +++ b/pigpio.c @@ -205,7 +205,7 @@ bit 0 READ_LAST_NOT_SET_ERROR #define DO_DBG(level, format, arg...) \ { \ if ((gpioCfg.dbgLevel >= level) && \ - (!(gpioCfg.internals & PI_CFG_SIGHANDLER))) \ + (!(gpioCfg.internals & PI_CFG_NOSIGHANDLER))) \ fprintf(stderr, "%s %s: " format "\n" , \ myTimeStamp(), __FUNCTION__ , ## arg); \ } @@ -8135,7 +8135,7 @@ int initInitialise(void) } #ifndef EMBEDDED_IN_VM - if (!(gpioCfg.internals & PI_CFG_SIGHANDLER)) + if (!(gpioCfg.internals & PI_CFG_NOSIGHANDLER)) sigSetHandler(); #endif @@ -8534,7 +8534,7 @@ void gpioTerminate(void) #ifndef EMBEDDED_IN_VM if ((gpioCfg.internals & PI_CFG_STATS) && - (!(gpioCfg.internals & PI_CFG_SIGHANDLER))) + (!(gpioCfg.internals & PI_CFG_NOSIGHANDLER))) { fprintf(stderr, "\n#####################################################\n"); diff --git a/pigpio.h b/pigpio.h index 1cedc09..d1cf3af 100644 --- a/pigpio.h +++ b/pigpio.h @@ -31,7 +31,7 @@ For more information, please refer to #include #include -#define PIGPIO_VERSION 6507 +#define PIGPIO_VERSION 6509 /*TEXT @@ -865,7 +865,7 @@ typedef void *(gpioThreadFunc_t) (void *); #define PI_CFG_ALERT_FREQ 4 /* bits 4-7 */ #define PI_CFG_RT_PRIORITY (1<<8) #define PI_CFG_STATS (1<<9) -#define PI_CFG_SIGHANDLER (1<<10) +#define PI_CFG_NOSIGHANDLER (1<<10) #define PI_CFG_ILLEGAL_VAL (1<<11) @@ -4712,8 +4712,11 @@ D*/ /*F*/ int gpioCfgPermissions(uint64_t updateMask); /*D -Configures pigpio to only allow updates (writes or mode changes) for the -GPIO specified by the mask. +Configures pigpio to restrict GPIO updates via the socket or pipe +interfaces to the GPIO specified by the mask. Programs directly +calling the pigpio library (i.e. linked with -lpigpio are not +affected). A GPIO update is a write to a GPIO or a GPIO mode +change or any function which would force such an action. This function is only effective if called before [*gpioInitialise*]. @@ -4724,7 +4727,7 @@ updateMask: bit (1<= MSG_SIZ: + msgbuf = buf[offset:offset + MSG_SIZ] + offset += MSG_SIZ + seq, flags, tick, level = (struct.unpack('HHII', msgbuf)) if flags == 0: changed = level ^ lastLevel @@ -1147,6 +1149,7 @@ class _callback_thread(threading.Thread): for cb in self.events: if cb.event == event: cb.func(event, tick) + buf = buf[offset:] self.sl.s.close() @@ -4163,7 +4166,7 @@ class pi(): """ Store a script for later execution. - See [[http://abyz.co.uk/rpi/pigpio/pigs.html#Scripts]] for + See [[http://abyz.me.uk/rpi/pigpio/pigs.html#Scripts]] for details. script:= the script text as a series of bytes. diff --git a/pigpiod.1 b/pigpiod.1 index db10b5f..1f7d3d1 100644 --- a/pigpiod.1 +++ b/pigpiod.1 @@ -78,6 +78,11 @@ Disable remote socket interface. . Default enabled . +.IP "\fB-m\fP" +Disable alerts (sampling). +. +Default enabled +. .IP "\fB-n IP address\fP" Allow IP address to use the socket interface. Name (e.g. paul) or dotted quad (e.g. 192.168.1.66).