import wlan_exp.platform as wlan_exp_platform from wlan_exp.info import InfoStruct # Define the WARP v3 platform node info struct - must match the typedef # in w3_high.c. Struct field defs use the format defined for InfoStructs # in wlan_exp.info.py _w3_node_info_flds = [('fpga_dna', 'Q', 'uint64', 'Virtex-6 FPGA DNA value'), ('max_tx_power_dbm', 'b', 'int8', 'RF interface maximum Tx power'), ('min_tx_power_dbm', 'b', 'int8', 'RF interface minimum Tx power')] _w3_node_info = InfoStruct(field_defs=_w3_node_info_flds) # Define a getter for the platform node info format # The current format does not depend on the platform_config value def _get_node_info_fmt(platform_config=None): return _w3_node_info w3_platform = wlan_exp_platform.WlanExpPlatform( name = 'Mango WARP v3', platform_id = 1, sn_regexp = r'[Ww]3-a-(?P\d+)', sn_str_fmt = 'W3-a-{0:05}' ) # Override the default node methods for platform-specific behavior # TODO: these overrides should really be method overrides in a subclass w3_platform.get_node_info_format = _get_node_info_fmt wlan_exp_platform.register_platform(w3_platform)