diff --git a/src/i2c.jl b/src/i2c.jl index 4305907..a4ecc07 100644 --- a/src/i2c.jl +++ b/src/i2c.jl @@ -338,7 +338,7 @@ function i2c_read_block_data(self::Pi, handle, reg) # Don't raise exception. Must release lock. bytes = u2i(_pigpio_command(self.sl, _PI_CMD_I2CRK, handle, reg, false)) if bytes > 0 - data = rxbuf(bytes) + data = rxbuf(self,bytes) else data = "" end @@ -614,7 +614,7 @@ function i2c_zip(self::Pi, handle, data) bytes = u2i(_pigpio_command_ext( self.sl, _PI_CMD_I2CZ, handle, 0, length(data), data, false)) if bytes > 0 - data = self._rxbuf(bytes) + data = rxbuf(self,bytes) else data = "" end @@ -756,7 +756,7 @@ function bb_i2c_zip(self::Pi, SDA, data) bytes = u2i(_pigpio_command_ext( self.sl, _PI_CMD_BI2CZ, SDA, 0, length(data), [data], false)) if bytes > 0 - data = self._rxbuf(bytes) + data = rxbuf(self,bytes) else data = "" end diff --git a/src/pi.jl b/src/pi.jl index 355d56c..133dfd6 100644 --- a/src/pi.jl +++ b/src/pi.jl @@ -1218,7 +1218,7 @@ function custom_2(self, arg1=0, argx=[], retMax=8192) bytes = u2i(_pigpio_command_ext( self.sl, _PI_CMD_CF2, arg1, retMax, length(argx), [argx], false)) if bytes > 0 - data = rxbuf(bytes) + data = rxbuf(self,bytes) else data = "" end diff --git a/src/spiSerial.jl b/src/spiSerial.jl index e93181b..15a45d9 100644 --- a/src/spiSerial.jl +++ b/src/spiSerial.jl @@ -132,7 +132,7 @@ function spi_read(self::Pi, handle, count) bytes = u2i(_pigpio_command( self.sl, _PI_CMD_SPIR, handle, count, false)) if bytes > 0 - data = rxbuf(bytes) + data = rxbuf(self,bytes) else data = "" end @@ -195,11 +195,14 @@ function spi_xfer(self::Pi, handle, data) ## extension ## # s len data bytes + # python code + # https://github.com/joan2937/pigpio/blob/c33738a320a3e28824af7807edafda440952c05d/pigpio.py#L4045 + # Don't raise exception. Must release lock. bytes = u2i(_pigpio_command_ext( self.sl, _PI_CMD_SPIX, handle, 0, length(data), data, false)) if bytes > 0 - data = rxbuf(bytes) + data = rxbuf(self,bytes) else data = "" end @@ -306,7 +309,7 @@ function serial_read(self::Pi, handle, count) bytes = u2i( _pigpio_command(self.sl, _PI_CMD_SERR, handle, count, false)) if bytes > 0 - data = rxbuf(bytes) + data = rxbuf(self,bytes) else data = "" end @@ -418,7 +421,7 @@ function bb_serial_read(self, user_gpio) bytes = u2i( _pigpio_command(self.sl, _PI_CMD_SLR, user_gpio, 10000, false)) if bytes > 0 - data = self._rxbuf(bytes) + data = rxbuf(self,bytes) else data = "" end