HWBRIDGE RFTRANSCEIVER ADD LOWBALL SUPPORT

bug/bundler_fix
Corey Harding 2017-07-20 05:09:00 -04:00
parent ffad0d1bbf
commit 22e8f1cb48
3 changed files with 29 additions and 0 deletions

View File

@ -278,6 +278,16 @@ module RFTransceiver
return_success(r) return_success(r)
end end
#
# Sets lowball. Ensure you set the frequency first before using this
# @return [Boolean] success value
def set_lowball
return false unless is_rf?
self.index ||= 0
r = client.rftransceiver.set_lowball(self.index)
return_success(r)
end
# #
# Set power level # Set power level
# @param level [Integer] Power level # @param level [Integer] Power level

View File

@ -186,6 +186,10 @@ class RFTransceiver < Extension
client.send_request("/rftransceiver/#{idx}/set_number_preamble?num=#{num}") client.send_request("/rftransceiver/#{idx}/set_number_preamble?num=#{num}")
end end
def set_lowball(idx)
client.send_request("/rftransceiver/#{idx}/set_lowball")
end
def set_maxpower(idx) def set_maxpower(idx)
client.send_request("/rftransceiver/#{idx}/set_maxpower") client.send_request("/rftransceiver/#{idx}/set_maxpower")
end end

View File

@ -34,6 +34,7 @@ class Console::CommandDispatcher::RFtransceiver
'deviation' => 'sets the deviation', 'deviation' => 'sets the deviation',
'sync_word' => 'sets the sync word', 'sync_word' => 'sets the sync word',
'preamble' => 'sets the preamble number', 'preamble' => 'sets the preamble number',
'lowball' => 'sets lowball'
'power' => 'sets the power level', 'power' => 'sets the power level',
'maxpower' => 'sets max power' 'maxpower' => 'sets max power'
} }
@ -528,6 +529,20 @@ class Console::CommandDispatcher::RFtransceiver
print_success(r) print_success(r)
end end
def cmd_lowball_help
print_line("Lowball is frequency dependent. Set frequency first")
end
def cmd_lowball(*args)
self.idx ||= 0
if args.length.positive?
cmd_lowball_help
return
end
r = client.rftransceiver.set_lowball(idx)
print_success(r)
end
def cmd_maxpower_help def cmd_maxpower_help
print_line("Max power is frequency dependent. Set frequency first") print_line("Max power is frequency dependent. Set frequency first")
end end