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)
|
data/lib/smartware/version.rb
CHANGED