smartware 0.1.13 → 0.1.14

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.
@@ -53,6 +53,7 @@ module Smartware
53
53
  # Valid ussd answer sample: ["", "+CUSD: 2,\"003100310035002C003000300440002E00320031002E00330031002004310430043B002E0020\",72", "OK"]
54
54
  #
55
55
  def ussd(code="*100#")
56
+ self.send "AT"
56
57
  res = self.send "AT+CUSD=1,\"#{code}\",15"
57
58
  unless res[1][0..4] == "+CUSD"
58
59
  @error = ERRORS["11"]
@@ -63,6 +64,7 @@ module Smartware
63
64
  ussd_body.scan(/\w{4}/).map{|i| [i.hex].pack("U") }.join.strip # Encode USSD message from broken ucs2 to utf-8
64
65
  rescue
65
66
  @error = ERRORS["10"]
67
+ return false
66
68
  end
67
69
 
68
70
  def send(cmd, read_timeout = 0.25)
@@ -1,3 +1,3 @@
1
1
  module Smartware
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartware
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: