Module: Zklib::VersionManagement
- Included in:
- Zklib
- Defined in:
- lib/zklib/version_management.rb
Constant Summary collapse
- OS_VERSION_KEYWORD =
'~OS'- PLATFORM_VERSION_KEYWORD =
'~ZKFPVersion'- SSR_VERSION_KEYWORD =
'~SSR'
Instance Method Summary collapse
-
#get_firmware_version ⇒ Object
Get firmware version.
-
#get_os_version ⇒ Object
Get OS version.
-
#get_platform_version ⇒ Object
Get platform version.
Instance Method Details
#get_firmware_version ⇒ Object
Get firmware version
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/zklib/version_management.rb', line 8 def get_firmware_version execute_cmd( command: CMD_VERSION, command_string: '' ) do |opts| return puts "ERROR: #{[:error]}" unless opts[:valid] data = opts[:data] if data.length > 8 data.split("\u0000").pop else puts 'ERROR: Invalid firmware version response' end end end |
#get_os_version ⇒ Object
Get OS version
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/zklib/version_management.rb', line 25 def get_os_version execute_cmd( command: CMD_DEVICE, command_string: OS_VERSION_KEYWORD ) do |opts| return puts "ERROR: #{[:error]}" unless opts[:valid] data = opts[:data] if data.length > 8 data.split("\u0000").pop.tr("#{OS_VERSION_KEYWORD}=", '') else puts 'ERROR: Invalid OS version response' end end end |
#get_platform_version ⇒ Object
Get platform version
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/zklib/version_management.rb', line 42 def get_platform_version execute_cmd( command: CMD_DEVICE, command_string: PLATFORM_VERSION_KEYWORD ) do |opts| return puts "ERROR: #{[:error]}" unless opts[:valid] data = opts[:data] if data.length > 8 data.split("\u0000").pop.tr("#{PLATFORM_VERSION_KEYWORD}=", '') else puts 'ERROR: Invalid platform version response' end end end |