aocakli / mikrotik4net

Automatically exported from code.google.com/p/mikrotik4net
Other
0 stars 0 forks source link

Interface wireless scan #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello Daniel,
How are you doing? I have a particular requirement where I have to scan for the 
available SSID's.

I need your help in executing, "interface wireless scan" number:0

Can you please let me know how we can execute this command.

Possible commands: "interface wireless scan <Name>"

interface wireless>scan <name>

interface wireless> scan
number:0

Looking forward to hear from you at the earliest.

regards,
Mahi

Original issue reported on code.google.com by gurjal.r...@gmail.com on 4 Aug 2011 at 3:19

GoogleCodeExporter commented 9 years ago
Hi,
  in v 1.0 it is possible only via very lowlevel api. Final implementation will be in v.2 (see roadmap on main page). May be I will post some example how to manage it via lowlevel access (it depends on time, of course) - so stay with us ;-)

Danik

Original comment by daniel.f...@gmail.com on 13 Aug 2011 at 7:12

GoogleCodeExporter commented 9 years ago
Hi Danik,
Can you post an example to manage via lowlevel access. It will be helpful.

Thanks,
Mahi

Original comment by gurjal.r...@gmail.com on 16 Aug 2011 at 3:38

GoogleCodeExporter commented 9 years ago
Hi,
  you could use ExecuteReader (see examples) to call command like this:

/interface/wireless/scan
=.id=wlan1
=duration=20

using (TikSession session = new TikSession(TikConnectorType.Api))
{
    session.Open("192.168.88.1", "admin", "");
    IApiConnector apiConnector = (IApiConnector)session.Connector; //!!! MOST important row in sample

    List<ITikEntityRow> macScanList = apiConnector.ApiExecuteReader("/interface/wireless/scan", new Dictionary<string,string>
        {
            {".id", "wlan1" },
            {"duration", "30" }
        });
    foreach (ITikEntityRow row in macScanList)
    {
        Console.WriteLine("Address: {0}, SSID: {1}",
            row.GetStringValueOrNull("address", true),
            row.GetStringValueOrNull("ssid", true));
    }
}    

Enjoj

Original comment by daniel.f...@gmail.com on 5 Sep 2011 at 6:10

GoogleCodeExporter commented 9 years ago
Documented in samples ...

Original comment by daniel.f...@gmail.com on 29 Oct 2011 at 2:55