############
# Second: power definitions
-power DEFAULT: 6, 30, 100 mW
+power DEFAULT: 6, 100 mW
############
# Finally, country definitions
# downloaded from http://www.bundesnetzagentur.de/media/archive/13358.pdf
country DE:
# entries 279004 and 280006
- (2400 - 2483.5 @ 40), (N/A, N/A, 100 mW)
+ (2400 - 2483.5 @ 40), (N/A, 100 mW)
# entries 303005 and 304002
- (5150 - 5255 @ 40), (N/A, N/A, 200 mW), NO-OUTDOOR, DFS
+ (5150 - 5255 @ 40), (N/A, 200 mW), NO-OUTDOOR, DFS
# entries 308002 and 309001
- (5470 - 5650 @ 40), (N/A, N/A, 1000 mW), DFS
+ (5470 - 5650 @ 40), (N/A, 1000 mW), DFS
country CH, HU, LI, AT:
ETSI1, DEFAULT
power_rules = {}
for pr in power:
power_rules[pr] = output.tell()
- pr = [int(v * 100.0) for v in (pr.max_ant_gain, pr.max_ir, pr.max_eirp)]
+ pr = [int(v * 100.0) for v in (pr.max_ant_gain, pr.max_eirp)]
# struct regdb_file_power_rule
- output.write(struct.pack('>III', *pr))
+ output.write(struct.pack('>II', *pr))
freq_ranges = {}
for fr in bands:
self.start, self.end, self.maxbw)
class PowerRestriction(object):
- def __init__(self, max_ant_gain, max_ir, max_eirp, comments = None):
+ def __init__(self, max_ant_gain, max_eirp, comments = None):
self.max_ant_gain = max_ant_gain
- self.max_ir = max_ir
self.max_eirp = max_eirp
self.comments = comments or []
o = other
if not isinstance(o, PowerRestriction):
return False
- return cmp((s.max_ant_gain, s.max_ir, s.max_eirp),
- (o.max_ant_gain, o.max_ir, o.max_eirp))
+ return cmp((s.max_ant_gain, s.max_eirp),
+ (o.max_ant_gain, o.max_eirp))
def __str__(self):
return '<PowerRestriction ...>'
def __hash__(self):
s = self
- return hash((s.max_ant_gain, s.max_ir, s.max_eirp))
+ return hash((s.max_ant_gain, s.max_eirp))
class FlagError(Exception):
def __init__(self, flag):
def _parse_power_def(self, pname, line, dupwarn=True):
try:
(max_ant_gain,
- max_ir,
max_eirp) = line.split(',')
if max_ant_gain == 'N/A':
max_ant_gain = '0'
- if max_ir == 'N/A':
- max_ir = '0'
if max_eirp == 'N/A':
max_eirp = '0'
max_ant_gain = float(max_ant_gain)
return 10.0 * math.log10(pwr)
else:
return float(pwr)
- max_ir = conv_pwr(max_ir)
max_eirp = conv_pwr(max_eirp)
except ValueError:
self._syntax_error("invalid power data")
- p = PowerRestriction(max_ant_gain, max_ir, max_eirp,
+ p = PowerRestriction(max_ant_gain, max_eirp,
comments=self._comments)
self._comments = []
self._powerdup[pname] = pname
else
printf("N/A, ");
- if (power->max_ir)
- printf("%.2f, ", ((float)ntohl(power->max_ir)/100.0));
- else
- printf("N/A, ");
-
if (power->max_eirp)
printf("%.2f)", ((float)ntohl(power->max_eirp)/100.0));
else
struct regdb_file_power_rule {
/* antenna gain is in mBi (100 * dBi) */
__be32 max_antenna_gain;
- /* these are in mBm (100 * dBm) */
- __be32 max_ir, max_eirp;
+ /* this is in mBm (100 * dBm) */
+ __be32 max_eirp;
};
enum reg_rule_flags {
f.text('Max antenna gain [dBi]'),
f.strong(0), f.table_cell(0),
f.table_cell(1), f.strong(1),
- f.text('Max IR [dBm'),
- f.hardspace,
- f.text('(mW)]'),
- f.strong(0), f.table_cell(0),
- f.table_cell(1), f.strong(1),
f.text('Max EIRP [dBm'),
f.hardspace,
f.text('(mW)]'),
f.text(str_or_na(perm.power.max_ant_gain)),
f.table_cell(0),
f.table_cell(1),
- f.text(str_or_na(perm.power.max_ir, dBm=True)),
- f.table_cell(0),
- f.table_cell(1),
f.text(str_or_na(perm.power.max_eirp, dBm=True)),
f.table_cell(0),
f.table_row(0),