@@ -228,33 +228,33 @@ def not_supported
228
228
229
229
def on_request_uri ( cli , request )
230
230
if request . uri =~ /status$/i
231
- print_status ( "Sending status..." )
231
+ print_status ( "Sending status..." ) if datastore [ 'VERBOSE' ]
232
232
send_response_html ( cli , get_status ( ) . to_json ( ) , { 'Content-Type' => 'application/json' } )
233
233
elsif request . uri =~ /statistics$/i
234
- print_status ( "Sending statistics..." )
234
+ print_status ( "Sending statistics..." ) if datastore [ 'VERBOSE' ]
235
235
send_response_html ( cli , get_statistics ( ) . to_json ( ) , { 'Content-Type' => 'application/json' } )
236
236
elsif request . uri =~ /settings\/ datetime\/ get$/i
237
- print_status ( "Sending Datetime" )
237
+ print_status ( "Sending Datetime" ) if datastore [ 'VERBOSE' ]
238
238
send_response_html ( cli , get_datetime ( ) . to_json ( ) , { 'Content-Type' => 'application/json' } )
239
239
elsif request . uri =~ /settings\/ timezone\/ get$/i
240
- print_status ( "Sending Timezone" )
240
+ print_status ( "Sending Timezone" ) if datastore [ 'VERBOSE' ]
241
241
send_response_html ( cli , get_timezone ( ) . to_json ( ) , { 'Content-Type' => 'application/json' } )
242
242
elsif request . uri =~ /custom_methods$/i
243
- print_status ( "Sending custom methods" )
243
+ print_status ( "Sending custom methods" ) if datastore [ 'VERBOSE' ]
244
244
send_response_html ( cli , get_custom_methods ( ) . to_json ( ) , { 'Content-Type' => 'application/json' } )
245
245
elsif request . uri =~ /custom\/ sample_cmd\? data=(\S +)$/
246
- print_status ( "Request for custom command with args #{ $1} " )
246
+ print_status ( "Request for custom command with args #{ $1} " ) if datastore [ 'VERBOSE' ]
247
247
send_response_html ( cli , sample_custom_method ( $1) . to_json ( ) , { 'Content-Type' => 'application/json' } )
248
248
elsif request . uri =~ /automotive/i
249
249
if request . uri =~ /automotive\/ supported_buses/
250
- print_status ( "Sending known buses..." )
250
+ print_status ( "Sending known buses..." ) if datastore [ 'VERBOSE' ]
251
251
send_response_html ( cli , get_auto_supported_buses ( ) . to_json , { 'Content-Type' => 'application/json' } )
252
252
elsif request . uri =~ /automotive\/ (\w +)\/ cansend\? id=(\w +)&data=(\w +)/
253
- print_status ( "Request to send CAN packets for #{ $1} => #{ $2} ##{ $3} " )
253
+ print_status ( "Request to send CAN packets for #{ $1} => #{ $2} ##{ $3} " ) if datastore [ 'VERBOSE' ]
254
254
send_response_html ( cli , cansend ( $1, $2, $3) . to_json ( ) , { 'Content-Type' => 'application/json' } )
255
255
elsif request . uri =~ /automotive\/ (\w +)\/ isotpsend_and_wait\? srcid=(\w +)&dstid=(\w +)&data=(\w +)/
256
256
bus = $1; srcid = $2; dstid = $3; data = $4
257
- print_status ( "Request to send ISO-TP packet and wait for response #{ srcid } ##{ data } => #{ dstid } " )
257
+ print_status ( "Request to send ISO-TP packet and wait for response #{ srcid } ##{ data } => #{ dstid } " ) if datastore [ 'VERBOSE' ]
258
258
timeout = 1500
259
259
maxpkts = 3
260
260
timeout = $1 if request . uri =~ /&timeout=(\d +)/
0 commit comments