Skip to content

Commit 38d9a5b

Browse files
use _SOCK_CMD_LEN=16 as in pigpio.py
1 parent c80dd92 commit 38d9a5b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/constants.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ WAVE_MODE_REPEAT_SYNC =3
5757
WAVE_NOT_FOUND = 9998 # Transmitted wave not found.
5858
NO_TX_WAVE = 9999 # No wave being transmitted.
5959

60+
_SOCK_CMD_LEN = 16
61+
6062
# pigpio command numbers
6163

6264
_PI_CMD_MODES= 0

src/pi.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Runs a pigpio socket command.
104104
function _pigpio_command(sl::SockLock, cmd::Integer, p1::Integer, p2::Integer, rl=true)
105105
lock(sl.l)
106106
Base.write(sl.s, UInt32.([cmd, p1, p2, 0]))
107-
out = IOBuffer(Base.read(sl.s, 16))
107+
out = IOBuffer(Base.read(sl.s, _SOCK_CMD_LEN))
108108
msg = reinterpret(Cuint, take!(out))[4]
109109
if rl
110110
unlock(sl.l)

0 commit comments

Comments
 (0)