smartware 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
@@ -52,13 +52,6 @@ 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
|
-
|
62
55
|
def ussd(code="*100#")
|
63
56
|
res = self.send "AT+CUSD=1,\"#{code}\",15"
|
64
57
|
unless res[1][0..4] == "+CUSD"
|
@@ -52,7 +52,7 @@ module Smartware
|
|
52
52
|
@status[:signal_level] = @device.signal_level
|
53
53
|
@status[:model] = @device.model
|
54
54
|
@status[:error] = @device.error
|
55
|
-
@status[:balance] = @device.
|
55
|
+
@status[:balance] = balance if balance = @device.ussd("*100#")
|
56
56
|
sleep 30
|
57
57
|
end
|
58
58
|
end
|
data/lib/smartware/version.rb
CHANGED