Module: Zklib::PlatformManagement
- Included in:
- Zklib
- Defined in:
- lib/zklib/platform_management.rb
Constant Summary collapse
- PLATFORM_KEYWORD =
'~Platform'
Instance Method Summary collapse
-
#get_platform ⇒ Object
Get platform.
Instance Method Details
#get_platform ⇒ Object
Get platform
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/zklib/platform_management.rb', line 6 def get_platform execute_cmd( command: CMD_DEVICE, command_string: PLATFORM_KEYWORD ) do |opts| return puts "ERROR: #{[:error]}" unless opts[:valid] data = opts[:data] if data.length > 8 data.split("\u0000").pop.tr("#{PLATFORM_KEYWORD}=", '') else puts 'ERROR: Invalid platform response' end end end |