Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable serial moduls for luasockets #24522

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

PhracturedBlue
Copy link
Contributor

Maintainer: @flyn-org
Compile tested: ath79/generic OpenWRT 23.05.3
Run tested: ath79/generic OpenWRT 23.05.3
Description: Includes the serial module for luasockets (which is already being built) in the final package. This allows using socket.select() on a serial port (eg /dev/ttyACM0) which is the easiest way to use a serial-port with coroutines. For instance copas can now be used via:

local copas = require("copas")
local serial = require("socket.serial")

copas.addthread(function()
        tty = copas.wrap(serial("/dev/ttyACM0"))
        l, e = tty:receivepartial()
        while not e do
                print(">" .. l)
                l, e = tty:receivepartial()
        end
end)
copas()

@flyn-org
Copy link
Contributor

flyn-org commented Jul 5, 2024

Looks good. Recommend merge.

@PhracturedBlue PhracturedBlue force-pushed the luasocket-serial branch 2 times, most recently from f354daa to 9faff7c Compare July 5, 2024 21:05
@feckert
Copy link
Member

feckert commented Jul 8, 2024

@PhracturedBlue Can you please increase the PKG_RELEASE number.

@PhracturedBlue
Copy link
Contributor Author

@PhracturedBlue Can you please increase the PKG_RELEASE number.

Done, Thanks.

@BKPepe
Copy link
Member

BKPepe commented Jul 9, 2024

There is missing commit description. It needs to be added or copy&pasted from the pull request.

Includes the serial module for luasockets (which is already being built)
in the final package. This allows using socket.select() on a serial port
(eg /dev/ttyACM0) which is the easiest way to use a serial-port with
coroutines.

Signed-off-by: Geoffrey Hausheer <[email protected]>
@PhracturedBlue
Copy link
Contributor Author

There is missing commit description. It needs to be added or copy&pasted from the pull request.

Done.

@neheb neheb merged commit 6769d5c into openwrt:master Jul 10, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants