pi_wire 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a15da7d47a81214d92643c33b73b05a6a90ff8c5
4
- data.tar.gz: 4a1fdb93864525c41721ca6044003f38cc2d0393
3
+ metadata.gz: 829b6ef9214c4f4907c0f74c5bd1997902cf3af9
4
+ data.tar.gz: c9e148c4e26e12aeed9ca885fef5112253445943
5
5
  SHA512:
6
- metadata.gz: 851ffbcf7929ea3d0d40feac16e82c9c7f9e4bf0dfce10e67a57e965ab33a99dc272dd347072be1fabd8f7ed65785aa7163e1160768f16bd6baf94f20089d6f2
7
- data.tar.gz: 04176c0d520a3e3086f0ac820d568a733aaafe496a88969f62938ae0c06128a85804042ad9f806997bb193efb13c5af1a20ea3a984d5f070c1658b204f889327
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 + 2);
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");
@@ -2,6 +2,7 @@
2
2
  #define PI_WIRE_SERIAL
3
3
 
4
4
  #include <pi_wire.h>
5
+ #include <termios.h>
5
6
 
6
7
  void Init_pi_wire_serial();
7
8
 
@@ -1,3 +1,3 @@
1
1
  module PiWire
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pi_wire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Nightingale