smartware 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,11 +55,11 @@ module Smartware
55
55
  def ussd(code="*100#")
56
56
  res = self.send "AT+CUSD=1,\"#{code}\",15\r\n"
57
57
  return ERRORS["11"] unless res.size >= 3
58
- return ERRORS["12"] if res[1].size < 10 # Check valid ussd answer by length
59
58
 
60
59
  ussd_body = res[1].split(",")[1].gsub('"','') # Parse USSD message body
60
+ result = ussd_body.scan(/\w{4}/).map{|i| [i.hex].pack("U") }.join # Encode USSD message from broken ucs2 to utf-8
61
61
  port.close
62
- ussd_body.scan(/\w{4}/).map{|i| [i.hex].pack("U") }.join # Encode USSD message from broken ucs2 to utf-8
62
+ result
63
63
  rescue
64
64
  ERRORS["10"]
65
65
  end
@@ -1,3 +1,3 @@
1
1
  module Smartware
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
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.9
4
+ version: 0.1.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-12-24 00:00:00.000000000 Z
13
+ date: 2012-12-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: serialport
@@ -101,3 +101,4 @@ signing_key:
101
101
  specification_version: 3
102
102
  summary: Smartware is the Smartkiosk hardware control daemon
103
103
  test_files: []
104
+ has_rdoc: