lib/freewifi/mikrotik/newhub_mtik_api.rb in freewifi-0.2.0 vs lib/freewifi/mikrotik/newhub_mtik_api.rb in freewifi-0.2.1

- old
+ new

@@ -10,10 +10,11 @@ @mtik_password = mtik_password end def get_info_subs_from_mik_1(subs_mac, controllers_ip) + input_parameters = {:subs_mac => subs_mac, :controllers_ip => controllers_ip} #region get additional information subscribers_mac = subs_mac access_point ="" ssid_ap ="" @@ -28,11 +29,12 @@ MTik::verbose = false mikrot_connection1 = MTik::Connection.new :host => controllers_ip, :user => mtik_user, :pass => mtik_password, :conn_timeout => 7, :cmd_timeout => 7 mikrot_connection1.get_reply('/caps-man/registration-table/getall') do |req, sentence| req.reply.each do |reply| - if reply.key?('!re') + if reply.key?('mac-address') + #p reply if reply['mac-address'] == subscribers_mac access_point = reply['interface'] ssid_ap = reply['ssid'] tx_rate = reply['tx-rate'] @@ -88,10 +90,10 @@ end #endregion answ = subscribers_mac+ "---" + access_point + "---" + ssid_ap + "---" + tx_rate_set + "---"+ tx_rate + "---"+ rx_rate + "---"+ rx_signal + "---"+ uptime + "---"+ packets + "---"+ bytes - return answ + answ end end