.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
.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
.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
#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); \
}
}
#ifndef EMBEDDED_IN_VM
- if (!(gpioCfg.internals & PI_CFG_SIGHANDLER))
+ if (!(gpioCfg.internals & PI_CFG_NOSIGHANDLER))
sigSetHandler();
#endif
#ifndef EMBEDDED_IN_VM
if ((gpioCfg.internals & PI_CFG_STATS) &&
- (!(gpioCfg.internals & PI_CFG_SIGHANDLER)))
+ (!(gpioCfg.internals & PI_CFG_NOSIGHANDLER)))
{
fprintf(stderr,
"\n#####################################################\n");
#include <stdint.h>
#include <pthread.h>
-#define PIGPIO_VERSION 6507
+#define PIGPIO_VERSION 6509
/*TEXT
#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)
/*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*].
The default setting depends upon the Pi model. The user GPIO are
added to the mask.
-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.
Unknown board @ PI_DEFAULT_UPDATE_MASK_UNKNOWN @ 0xFFFFFFFF
Type 1 board @ PI_DEFAULT_UPDATE_MASK_B1 @ 0x03E6CF93
#define PI_DEFAULT_SOCKET_PORT 8888
#define PI_DEFAULT_SOCKET_PORT_STR "8888"
#define PI_DEFAULT_SOCKET_ADDR_STR "127.0.0.1"
-#define PI_DEFAULT_UPDATE_MASK_UNKNOWN 0xFFFFFFFF
+#define PI_DEFAULT_UPDATE_MASK_UNKNOWN 0x0000000FFFFFFCLL
#define PI_DEFAULT_UPDATE_MASK_B1 0x03E7CF93
#define PI_DEFAULT_UPDATE_MASK_A_B2 0xFBC7CF9C
#define PI_DEFAULT_UPDATE_MASK_APLUS_BPLUS 0x0080480FFFFFFCLL
the pigpio daemon to allow control of the general purpose
input outputs (GPIO).
-[http://abyz.co.uk/rpi/pigpio/python.html]
+[http://abyz.me.uk/rpi/pigpio/python.html]
*Features*
import os
import atexit
-VERSION = "1.38"
+VERSION = "1.39"
exceptions = True
lastLevel = self.lastLevel
+ RECV_SIZ = 4096
MSG_SIZ = 12
+ buf = bytes()
while self.go:
- buf = self.sl.s.recv(MSG_SIZ)
+ buf += self.sl.s.recv(RECV_SIZ)
+ offset = 0
- while self.go and len(buf) < MSG_SIZ:
- buf += self.sl.s.recv(MSG_SIZ-len(buf))
-
- if self.go:
- seq, flags, tick, level = (struct.unpack('HHII', buf))
+ while self.go and (len(buf) - offset) >= 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
for cb in self.events:
if cb.event == event:
cb.func(event, tick)
+ buf = buf[offset:]
self.sl.s.close()
"""
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.
.
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).