lib/imperituroard/projects/iot/mongoconnector.rb in imperituroard-1.1.3 vs lib/imperituroard/projects/iot/mongoconnector.rb in imperituroard-1.1.4

- old
+ new

@@ -505,10 +505,11 @@ #function for get iot platform credentials from profile #universal procedure. use profile or profile id def get_iot_oceanconn_credent_2(profile) + input_in = {:profile => profile} out_resp = {} begin result_ps = [] collection = client[:device_profiles] @@ -526,11 +527,11 @@ secret = result_ps[0][:iot_data][:secret] out_resp = {:code => 200, :result => "get_iot_oceanconn_credent_2: Request completed successfully", :body => {:app_id => app_id, :secret => secret}} rescue out_resp = {:code => 500, :result => "get_iot_oceanconn_credent_2: Process failed"} end - internal_func.printer_texter(out_resp, "debug") + internal_func.printer_texter({:input_in => input_in, :out_resp => out_resp, :fun => "get_iot_oceanconn_credent_2"}, "debug") out_resp end def get_device_type_info_by_model(device_model) out_resp = {} @@ -594,10 +595,11 @@ end def compare_profiles(profile1, profile2) + input_inf = {:profile1 => profile1, :profile2 => profile2} out_answ = {} ch1 = internal_func.if_digit_or_string(profile1) ch2 = internal_func.if_digit_or_string(profile2) if ch1[:body][:string] == ch2[:body][:string] && ch1[:body][:string] == false if profile1.to_i == profile2.to_i @@ -630,14 +632,16 @@ out_answ = {:code => 200, :result => "compare_profiles: profiles are the same", :is_the_same => true, :data_type => "different"} else out_answ = {:code => 200, :result => "compare_profiles: profiles are different", :is_the_same => false, :data_type => "different"} end end + internal_func.printer_texter({:input_inf => input_inf, :out => out_answ, :fun => "compare_profiles"}, "debug") out_answ end def compare_device_types(type1, type2) + input_inf = {:type1 => type1, :type2 => type2} out_answ = {} tp1 = internal_func.if_digit_or_string(type1) tp2 = internal_func.if_digit_or_string(type2) p tp1 p tp2 @@ -680,9 +684,10 @@ out_answ = {:code => 200, :result => "compare_device_types: profiles are the same", :is_the_same => true, :data_type => "different"} else out_answ = {:code => 200, :result => "compare_device_types: profiles are different", :is_the_same => false, :data_type => "different"} end end + internal_func.printer_texter({:input_inf => input_inf, :out => out_answ, :fun => "compare_device_types"}, "debug") out_answ end #universal procedure. put there profile name or id in string or int