pi_wire 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/pi_wire/pi_wire_serial.c +2 -1
- data/ext/pi_wire/pi_wire_serial.h +1 -0
- data/lib/pi_wire/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 829b6ef9214c4f4907c0f74c5bd1997902cf3af9
|
4
|
+
data.tar.gz: c9e148c4e26e12aeed9ca885fef5112253445943
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d09b52b823a44b3c32462eba7c584f5287a9c285f775b17ee9b88df2c6e79b70afe497198c15f555c71ddd4f4bd48e58552d659caa79d09ecf305a2625e51a2
|
7
|
+
data.tar.gz: 8f85795f5e186d505e89b2e270e41acd0cbad6e3b4f55833aac1acbb4a1605f8bdda8b111f1e25ef05de9ce47ccde20ab26633e36594265722927e68dff7431d
|
@@ -32,6 +32,7 @@ static VALUE serial_write(VALUE self, VALUE str) {
|
|
32
32
|
int fd = get_fd(self);
|
33
33
|
char *s = StringValueCStr(str);
|
34
34
|
serialPuts(fd, s);
|
35
|
+
tcdrain(fd);
|
35
36
|
return Qtrue;
|
36
37
|
}
|
37
38
|
|
@@ -39,7 +40,7 @@ static VALUE serial_read(VALUE self) {
|
|
39
40
|
int fd = get_fd(self);
|
40
41
|
int chars_available = serialDataAvail(fd);
|
41
42
|
int i;
|
42
|
-
char *str = malloc(chars_available +
|
43
|
+
char *str = malloc(chars_available + 1);
|
43
44
|
|
44
45
|
if (chars_available == -1) {
|
45
46
|
rb_raise(rb_eRuntimeError, "No data to read");
|
data/lib/pi_wire/version.rb
CHANGED