serialport_mtp 0.1.0 → 0.1.1
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
- checksums.yaml.gz.sig +0 -0
- data/lib/serialport_mtp.rb +6 -3
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b08c6ff8d41e9348cee0b0aaae81e6c43419c59c
|
4
|
+
data.tar.gz: b4fc450cdd159d3acaff1a24e2648b0789d3dc5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd29bfa0cf0457418dc225dd2a0a7b4a409f6e44b9f16b29bf3d36c1b4d77372201aa85fc8dcb2fca01731e475c8278b2a80bb998c40fa9e8a5ba025345d4a27
|
7
|
+
data.tar.gz: 538c425580ba648c800168375dda11cec16d2b1b626cfc08b560d71f1e2d09344b9f049eb524030d712208fc8921a5fd7deab88013fc79267ae199e783810fb9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/serialport_mtp.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
# file: serialport_mtp.rb
|
4
4
|
|
5
5
|
# original code at https://github.com/lazyatom/a2_printer
|
6
|
+
# modified code uses references from https://github.com/adafruit/Adafruit-Thermal-Printer-Library
|
6
7
|
|
7
8
|
# This gem can be used with the mini thermal printer, connected via
|
8
9
|
# the TX+RX pins on the Raspberry Pi
|
@@ -10,6 +11,8 @@
|
|
10
11
|
require 'serialport'
|
11
12
|
|
12
13
|
|
14
|
+
ASCII_GS = 29 # Group separator
|
15
|
+
|
13
16
|
class SerialPortMTP
|
14
17
|
|
15
18
|
def initialize(port: "/dev/ttyAMA0", baud_rate: 19200, heat_time: 150)
|
@@ -131,11 +134,11 @@ class SerialPortMTP
|
|
131
134
|
end
|
132
135
|
|
133
136
|
def inverse_on
|
134
|
-
|
137
|
+
write_bytes ASCII_GS, 'B', 1
|
135
138
|
end
|
136
139
|
|
137
140
|
def inverse_off
|
138
|
-
|
141
|
+
write_bytes ASCII_GS, 'B', 0
|
139
142
|
end
|
140
143
|
|
141
144
|
def upside_down_on
|
@@ -349,4 +352,4 @@ class SerialPortMTP
|
|
349
352
|
def set_line_height(val=32)
|
350
353
|
write_bytes(27, 51, val) # default is 32
|
351
354
|
end
|
352
|
-
end
|
355
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serialport_mtp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
MHjXTcOEOj4I+WjeDSWFks3b+3nyfjSyQW3I6DTtwzW6hKMaAQZWgjddCbOsHbof
|
32
32
|
4bxShMp7fn3hMQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-08-
|
34
|
+
date: 2015-08-28 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: serialport
|
metadata.gz.sig
CHANGED
Binary file
|