Setting 2.4GHz Radio Bands via API

Hi all.

I’m using ros5.6 & the delphi api (brilliant job there Chupaka, many thanks!) to talk to 411s with either 5GHz or 2.4GHz radios fitted. I dynamically populate my drop-down lists if available bands/freqs depending on the hardware fitted.

Using the TestAPI program & a 2.4GHz radio the list of supported bands returned by:
/interface/wireless/info/print
is
.
=supported-bands=2ghz-b,2ghz-g,2ghz-10mhz,2ghz-5mhz
.

which is fine. However the band currently set returned by:
/interface/wireless/print
=advanced=
is
=band=2ghz-b/g

which dosen’t match any of the supported bands. Problematic when I’m tring to show the radio’s current settings.

Am I getting the info from the wrong place or doing something else stupid?

info print contains information of what is supported, in this case response lists bands that card can work in:

  • 802.11b, 802.11g, 802.11n 2GHz

when you set up interface you can allow it to work in all of them, so you can set 2ghz-b/g/n or 2ghz-b/g

these values are not the same.

so you can check what bands are supported and according to that you can populate the list acordingly with settings that can be set in RouterOS.

list of available settings for band attribute is like this:

2ghz-b  2ghz-b/g  2ghz-b/g/n  2ghz-onlyg  2ghz-onlyn  5ghz-a  5ghz-a/n  5ghz-onlyn

all of this, since info is red from card info, but band settings in RouterOS is what it is capable of doing.

Thanks for the explanation janisk, its all becomming a bit clearer now…

Is there a way to get back the valid strings from RouterOS (ie 2ghz-b, 2ghz-b/g, 2ghz-b/g/n etc) at run time or would it be simplist to just hard-code them?

unfortunately there is no way how to get the contents of these lists in RouterOS and they have to be hard-coded.