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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df2c9010297a3d6f8745c36a8a1497070a1c3328
4
- data.tar.gz: 15c6168b6efe2176135dd43a36795de46583df07
3
+ metadata.gz: b08c6ff8d41e9348cee0b0aaae81e6c43419c59c
4
+ data.tar.gz: b4fc450cdd159d3acaff1a24e2648b0789d3dc5f
5
5
  SHA512:
6
- metadata.gz: b9f377253f514833b0435cfaf332a05c266e1211ac744d8d2b91f83c59a58f1aec8a73c2ec01f1c7321d94b80263dd82f5cbe82870b60a6fc42e6d90411b59a4
7
- data.tar.gz: c532bbc26069d612efca340e65958b13ecd5908f3a982c8abfaccee9395a9847a4ef25252c20ca2a9b2d983cb3c072b23760a667383206939d43d14f1c79f81c
6
+ metadata.gz: fd29bfa0cf0457418dc225dd2a0a7b4a409f6e44b9f16b29bf3d36c1b4d77372201aa85fc8dcb2fca01731e475c8278b2a80bb998c40fa9e8a5ba025345d4a27
7
+ data.tar.gz: 538c425580ba648c800168375dda11cec16d2b1b626cfc08b560d71f1e2d09344b9f049eb524030d712208fc8921a5fd7deab88013fc79267ae199e783810fb9
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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
- set_print_mode(INVERSE_MASK)
137
+ write_bytes ASCII_GS, 'B', 1
135
138
  end
136
139
 
137
140
  def inverse_off
138
- unset_print_mode(INVERSE_MASK)
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.0
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-27 00:00:00.000000000 Z
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