diff --git a/CFG/permits b/CFG/permits index 52407f1..b431b13 100644 --- a/CFG/permits +++ b/CFG/permits @@ -30,10 +30,10 @@ test2=n test3=y [serial] -default=serial0 -test1=serial*:ttyUSB*:ttyS* -test2=ttyUSB1:tty0:ttyS0 -test3=null +default=/dev/serial0 +test1=/dev/serial*:/dev/ttyUSB*:/dev/ttyS* +test2=/dev/ttyUSB1:/dev/tty0:/dev/ttyS0 +test3=/dev/null [spi] default=0.* diff --git a/DOC/dbase/lg.sqlite b/DOC/dbase/lg.sqlite index 6f8f902..b2deb01 100644 Binary files a/DOC/dbase/lg.sqlite and b/DOC/dbase/lg.sqlite differ diff --git a/DOC/src/defs/permits.def b/DOC/src/defs/permits.def index 149e62c..db28fab 100644 --- a/DOC/src/defs/permits.def +++ b/DOC/src/defs/permits.def @@ -207,7 +207,7 @@ TEXT*/ /*TEXT [serial] Each entry in this section takes the form [#user=device#] where -[#device#] indicates a serial device. E.g. [#serial0#] refers to +[#device#] indicates a serial device. E.g. [#/dev/serial0#] refers to Linux device [#/dev/serial0#] There may be more than one [#device#] entry per user, each must be separated by a [#:#] character. @@ -216,10 +216,11 @@ There may be more than one [#device#] entry per user, each must be separated by characters) or [#?#] (matches a single character). ... -fred=serial0 # user fred can access /dev/serial0. -peter=tty* # user peter can access /dev/tty*. -boss=* # user boss can access /dev/*. -sally=serial?:ttyS* # user sally can access /dev/serial? and /dev/ttyS*. +fred=/dev/serial0 # user fred can access /dev/serial0. +peter=/dev/tty* # user peter can access /dev/tty*. +boss=/dev/* # user boss can access /dev/*. +sally=/dev/serial?:/dev/ttyS* # user sally can access /dev/serial? + # and /dev/ttyS*. ... TEXT*/ @@ -292,9 +293,9 @@ test2=n test3=y [serial] -test1=serial*:ttyUSB*:ttyS* -test2=ttyUSB1:tty0:ttyS0 -test3=null +test1=/dev/serial*:/dev/ttyUSB*:/dev/ttyS* +test2=/dev/ttyUSB1:/dev/tty0:/dev/ttyS0 +test3=/dev/null [spi] test1=0.0:0.1:1.0:1.1:1.2:2.0:2.1 diff --git a/DOC/src/defs/rgs.def b/DOC/src/defs/rgs.def index 307f238..ee9deb2 100644 --- a/DOC/src/defs/rgs.def +++ b/DOC/src/defs/rgs.def @@ -1396,10 +1396,10 @@ The baud rate must be one of 50, 75, 110, 134, 150, 38400, 57600, 115200, or 230400. ... -$ rgs sero ttyAMA0 9600 0 +$ rgs sero /dev/ttyAMA0 9600 0 0 -$ rgs sero tty1 38400 0 +$ rgs sero /dev/tty1 38400 0 1 ... @@ -1794,14 +1794,13 @@ cyc :: >= 0 The number of PWM pulses to generate. A value of 0 means infinite. dev :: a tty serial device -The command expects the name of a serial device without the -leading /dev, e.g. +The command expects the name of a serial device, e.g. ... -ttyAMA0 -ttyUSB0 -tty0 -serial0 +/dev/ttyAMA0 +/dev/ttyUSB0 +/dev/tty0 +/dev/serial0 ... ef :: GPIO event flags diff --git a/PY_LGPIO/lgpio_extra.py b/PY_LGPIO/lgpio_extra.py index 4fb3efd..265e5f1 100644 --- a/PY_LGPIO/lgpio_extra.py +++ b/PY_LGPIO/lgpio_extra.py @@ -5,7 +5,7 @@ import threading import time -LGPIO_PY_VERSION = 0x00010001 +LGPIO_PY_VERSION = 0x00010700 exceptions = True @@ -1738,7 +1738,7 @@ def notify_close(handle): def serial_open(tty, baud, ser_flags=0): """ Returns a handle for the serial tty device opened - at baud bits per second. The device muse be in /dev. + at baud bits per second. tty:= the serial device to open. baud:= baud rate in bits per second, see below. @@ -1753,11 +1753,11 @@ def serial_open(tty, baud, ser_flags=0): 38400, 57600, 115200, or 230400. ... - h1 = sbc.serial_open("ttyAMA0", 300) + h1 = sbc.serial_open("/dev/ttyAMA0", 300) - h2 = sbc.serial_open("ttyUSB1", 19200, 0) + h2 = sbc.serial_open("/dev/ttyUSB1", 19200, 0) - h3 = sbc.serial_open("serial0", 9600) + h3 = sbc.serial_open("/dev/serial0", 9600) ... """ return _u2i(_lgpio._serial_open(tty, baud, ser_flags)) @@ -2234,7 +2234,7 @@ class with the following members. See [*spi_open*]. tty: - A serial device, e.g. ttyAMA0, ttyUSB0 + A serial device, e.g. /dev/ttyAMA0, /dev/ttyUSB0 uint32: An unsigned 32 bit number. diff --git a/PY_LGPIO/setup.py b/PY_LGPIO/setup.py index 4428fe4..3a13535 100644 --- a/PY_LGPIO/setup.py +++ b/PY_LGPIO/setup.py @@ -12,7 +12,7 @@ lgpio_module = Extension('_lgpio', sources=['lgpio_wrap.c',], libraries=['lgpio',],) setup (name = 'lgpio', - version = '0.1.0.1', + version = '0.1.7.0', zip_safe=False, author='joan', author_email='joan@abyz.me.uk', diff --git a/PY_RGPIO/rgpio.py b/PY_RGPIO/rgpio.py index a3ab776..7a21aba 100644 --- a/PY_RGPIO/rgpio.py +++ b/PY_RGPIO/rgpio.py @@ -240,7 +240,7 @@ import atexit import hashlib -RGPIO_PY_VERSION = 0x00010100 +RGPIO_PY_VERSION = 0x00010700 exceptions = True @@ -2937,7 +2937,7 @@ def script_delete(self, handle): def serial_open(self, tty, baud, ser_flags=0): """ Returns a handle for the serial tty device opened - at baud bits per second. The device muse be in /dev. + at baud bits per second. This is a privileged command. See [+Permits+]. @@ -2954,11 +2954,11 @@ def serial_open(self, tty, baud, ser_flags=0): 38400, 57600, 115200, or 230400. ... - h1 = sbc.serial_open("ttyAMA0", 300) + h1 = sbc.serial_open("/dev/ttyAMA0", 300) - h2 = sbc.serial_open("ttyUSB1", 19200, 0) + h2 = sbc.serial_open("/dev/ttyUSB1", 19200, 0) - h3 = sbc.serial_open("serial0", 9600) + h3 = sbc.serial_open("/dev/serial0", 9600) ... """ ext = [struct.pack("II", baud, ser_flags)] + [tty] @@ -3755,7 +3755,7 @@ class with the following members. See [*spi_open*]. tty: - A serial device, e.g. ttyAMA0, ttyUSB0 + A serial device, e.g. /dev/ttyAMA0, /dev/ttyUSB0 uint32: An unsigned 32 bit number. diff --git a/PY_RGPIO/setup.py b/PY_RGPIO/setup.py index f988ace..7c65141 100644 --- a/PY_RGPIO/setup.py +++ b/PY_RGPIO/setup.py @@ -6,7 +6,7 @@ long_description = f.read() setup(name='rgpio', - version='0.1.1.0', + version='0.1.7.0', zip_safe=False, author='joan', author_email='joan@abyz.me.uk', diff --git a/lgSerial.c b/lgSerial.c index 206b274..5f9bd75 100644 --- a/lgSerial.c +++ b/lgSerial.c @@ -56,7 +56,6 @@ int lgSerialOpen(const char *serDev, int serBaud, int serFlags) int speed; int fd; int handle; - char serName[LG_MAX_PATH]; lgSerialObj_p ser; LG_DBG(LG_DEBUG_TRACE, "serDev=%s serBaud=%d serFlags=0x%X", @@ -90,9 +89,7 @@ int lgSerialOpen(const char *serDev, int serBaud, int serFlags) if (serFlags) PARAM_ERROR(LG_BAD_SERIAL_FLAGS, "bad serial flags (0x%X)", serFlags); - snprintf(serName, LG_MAX_PATH, "/dev/%s", serDev); - - if ((fd = open(serName, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK)) == -1) + if ((fd = open(serDev, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK)) == -1) { return LG_SERIAL_OPEN_FAILED; } diff --git a/lgpio.3 b/lgpio.3 index 9b8970c..54ecd50 100644 --- a/lgpio.3 +++ b/lgpio.3 @@ -3432,7 +3432,7 @@ End .IP "\fBint lgSerialOpen(const char *serDev, int serBaud, int serFlags)\fP" .IP "" 4 This function opens a serial device at a specified baud rate -and with specified flags. The device must be present in /dev. +and with specified flags. .br diff --git a/lgpio.h b/lgpio.h index caf0dbe..f608ee0 100644 --- a/lgpio.h +++ b/lgpio.h @@ -33,7 +33,7 @@ For more information, please refer to #include #include -#define LGPIO_VERSION 0x00010001 +#define LGPIO_VERSION 0x00010700 #define LG_CD "LG_CD" /* configuration directory */ #define LG_WD "LG_WD" /* working directory */ @@ -2057,7 +2057,7 @@ D*/ int lgSerialOpen(const char *serDev, int serBaud, int serFlags); /*D This function opens a serial device at a specified baud rate -and with specified flags. The device must be present in /dev. +and with specified flags. . . serDev: the serial device to open diff --git a/rgpio.h b/rgpio.h index cc6e3ad..f01bdc9 100644 --- a/rgpio.h +++ b/rgpio.h @@ -33,7 +33,7 @@ For more information, please refer to #include "lgpio.h" -#define RGPIO_VERSION 0x00010200 +#define RGPIO_VERSION 0x00010700 /*TEXT diff --git a/rgpiod.1 b/rgpiod.1 index 86d6fb7..5cff19b 100644 --- a/rgpiod.1 +++ b/rgpiod.1 @@ -639,7 +639,7 @@ script commands. .SH [serial] Each entry in this section takes the form \fBuser=device\fP where -\fBdevice\fP indicates a serial device. E.g. \fBserial0\fP refers to +\fBdevice\fP indicates a serial device. E.g. \fB/dev/serial0\fP refers to Linux device \fB/dev/serial0\fP .br @@ -660,13 +660,15 @@ characters) or \fB?\fP (matches a single character). .br .EX -fred=serial0 # user fred can access /dev/serial0. +fred=/dev/serial0 # user fred can access /dev/serial0. .br -peter=tty* # user peter can access /dev/tty*. +peter=/dev/tty* # user peter can access /dev/tty*. .br -boss=* # user boss can access /dev/*. +boss=/dev/* # user boss can access /dev/*. .br -sally=serial?:ttyS* # user sally can access /dev/serial? and /dev/ttyS*. +sally=/dev/serial?:/dev/ttyS* # user sally can access /dev/serial? +.br + # and /dev/ttyS*. .br .EE @@ -811,11 +813,11 @@ test3=y .br [serial] .br -test1=serial*:ttyUSB*:ttyS* +test1=/dev/serial*:/dev/ttyUSB*:/dev/ttyS* .br -test2=ttyUSB1:tty0:ttyS0 +test2=/dev/ttyUSB1:/dev/tty0:/dev/ttyS0 .br -test3=null +test3=/dev/null .br .br diff --git a/rgpiod.h b/rgpiod.h index 76b7f78..39b7e7a 100644 --- a/rgpiod.h +++ b/rgpiod.h @@ -32,7 +32,7 @@ For more information, please refer to #include "lgCmd.h" -#define RGPIOD_VERSION 0x00010100 +#define RGPIOD_VERSION 0x00010700 #define LG_ENVADDR "LG_ADDR" #define LG_ENVPORT "LG_PORT" diff --git a/rgs.1 b/rgs.1 index 21907dd..1a0b058 100644 --- a/rgs.1 +++ b/rgs.1 @@ -2593,13 +2593,13 @@ The baud rate must be one of 50, 75, 110, 134, 150, .br .EX -$ rgs sero ttyAMA0 9600 0 +$ rgs sero /dev/ttyAMA0 9600 0 .br 0 .br .br -$ rgs sero tty1 38400 0 +$ rgs sero /dev/tty1 38400 0 .br 1 .br @@ -3386,19 +3386,18 @@ The number of PWM pulses to generate. A value of 0 means infinite. .br .IP "\fBdev\fP: a tty serial device" 0 -The command expects the name of a serial device without the -leading /dev, e.g. +The command expects the name of a serial device, e.g. .br .EX -ttyAMA0 +/dev/ttyAMA0 .br -ttyUSB0 +/dev/ttyUSB0 .br -tty0 +/dev/tty0 .br -serial0 +/dev/serial0 .br .EE diff --git a/rgs.c b/rgs.c index c95990b..35f6817 100644 --- a/rgs.c +++ b/rgs.c @@ -50,7 +50,7 @@ This program provides a socket interface to some of the commands available from lg. */ -#define RGS_VERSION 0x00010200 +#define RGS_VERSION 0x00010700 #define RGS_CONNECT_ERR 255 #define RGS_OPTION_ERR 254 diff --git a/v0.1.6.2 b/v0.1.7.0 similarity index 100% rename from v0.1.6.2 rename to v0.1.7.0