Code: Select all
:global formatFreqRange do= {
:if ( [:find $range "turbo"] < 0 && [:len $range] > 0) do={
:local startfreq ([:pick $range 0 [:find $range "-"]]);
:local endfreq ([:pick $range ([:find $range "-"]+1) [:find $range "/"]]);
:local modes ([:pick $range ([:find $range "/"]+1) [:find $range "("]]);
:local power ([:pick $range ([:find $range "("]+1) [:find $range "dBm)"]]);
:local range1 (" " . $range);
:local flagdfs ([:pick $range1 [:find $range1 "dfs"]]);
:local flagpassive ([:pick $range1 [:find $range1 "passive"]]);
:local flagindoor ([:pick $range1 [:find $range1 "indoor"]]);
:local flagoutdoor ([:pick $range1 [:find $range1 "outdoor"]]);
:put ($country .";". $startfreq .";". $endfreq .";". $power .";". $modes .";". $flagdfs .";". $flagpassive .";". $flagindoor .";". $flagoutdoor);
}
}
:put ("country;startfreq;endfreq;power;modes;dfs;passive;indoor;outdoor");
:foreach c in=(([/interface/wireless/info/country-list as-value])->"countries") do={
:local buf "";
:foreach r in=(([/interface/wireless/info/country-info $c as-value])->"ranges") do={
:if ( [:find "0123456789" [:pick $r 0]] >= 0) do={
$formatFreqRange country=$c range=$buf
:set buf $r;
} else={ :set buf ($buf . "," . $r); }
}
$formatFreqRange country=$c range=$buf
}