smartware 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
@@ -52,8 +52,14 @@ module Smartware
|
|
52
52
|
#
|
53
53
|
# Valid ussd answer sample: ["", "+CUSD: 2,\"003100310035002C003000300440002E00320031002E00330031002004310430043B002E0020\",72", "OK"]
|
54
54
|
#
|
55
|
+
def balance
|
56
|
+
loop do
|
57
|
+
break if @balance = ussd('*100#')
|
58
|
+
sleep 0.5
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
55
62
|
def ussd(code="*100#")
|
56
|
-
self.send "AT"
|
57
63
|
res = self.send "AT+CUSD=1,\"#{code}\",15"
|
58
64
|
unless res[1][0..4] == "+CUSD"
|
59
65
|
@error = ERRORS["11"]
|
data/lib/smartware/version.rb
CHANGED