File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed
mpm/python/usrp_mpm/periph_manager Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -94,16 +94,20 @@ void mpmd_impl::init_property_tree(
9494 /* ** Device info ****************************************************/
9595 if (not tree->exists (" /name" )) {
9696 tree->create <std::string>(" /name" )
97- .set (mb->device_info .get (" name " , " Unknown MPM device" ))
97+ .set (mb->device_info .get (" description " , " Unknown MPM device" ))
9898 ;
9999 }
100100 tree->create <std::string>(mb_path / " name" )
101- .set (mb->device_info .get (" type " , " UNKNOWN" ));
101+ .set (mb->device_info .get (" name " , " UNKNOWN" ));
102102 tree->create <std::string>(mb_path / " serial" )
103103 .set (mb->device_info .get (" serial" , " n/a" ));
104104 tree->create <std::string>(mb_path / " connection" )
105105 .set (mb->device_info .get (" connection" , " UNKNOWN" ));
106106 tree->create <size_t >(mb_path / " link_max_rate" ).set (1e9 / 8 );
107+ tree->create <std::string>(mb_path / " mpm_version" )
108+ .set (mb->device_info .get (" mpm_version" , " UNKNOWN" ));
109+ tree->create <std::string>(mb_path / " fpga_version" )
110+ .set (mb->device_info .get (" fpga_version" , " UNKNOWN" ));
107111
108112 /* ** Clocking *******************************************************/
109113 tree->create <std::string>(mb_path / " clock_source/value" )
Original file line number Diff line number Diff line change 2020from usrp_mpm .sys_utils .udev import get_eeprom_paths
2121from usrp_mpm .sys_utils .udev import get_spidev_nodes
2222from usrp_mpm .sys_utils import dtoverlay
23+ from usrp_mpm .sys_utils import net
2324from usrp_mpm import eeprom
2425from usrp_mpm .rpc_server import no_claim , no_rpc
2526from usrp_mpm import prefs
@@ -54,6 +55,8 @@ class PeriphManagerBase(object):
5455 # Very important: A list of PIDs that apply to the current device. Must be
5556 # list, even if there's only one entry.
5657 pids = []
58+ # A textual description of this device type
59+ description = "MPM Device"
5760 # Address of the motherboard EEPROM. This could be something like
5861 # "e0005000.i2c". This value will be passed to get_eeprom_paths() tos
5962 # determine a full path to an EEPROM device.
@@ -447,6 +450,10 @@ def get_device_info(self):
447450 """
448451 result = {"claimed" : str (self .claimed )}
449452 result .update (self .mboard_info )
453+ result .update ({
454+ 'name' : net .get_hostname (),
455+ 'description' : self .description ,
456+ })
450457 result .update (self .get_device_info_dyn ())
451458 return result
452459
Original file line number Diff line number Diff line change @@ -456,6 +456,7 @@ class n310(PeriphManagerBase):
456456 # See PeriphManagerBase for documentation on these fields
457457 #########################################################################
458458 pids = [0x4242 ,]
459+ description = "N300-Series Device"
459460 mboard_eeprom_addr = "e0005000.i2c"
460461 mboard_eeprom_max_len = 256
461462 mboard_info = {"type" : "n3xx" ,
@@ -782,8 +783,13 @@ def get_device_info_dyn(self):
782783 """
783784 Append the device info with current IP addresses.
784785 """
785- return self ._xport_mgrs ['udp' ].get_xport_info () \
786+ device_info = self ._xport_mgrs ['udp' ].get_xport_info () \
786787 if self ._device_initialized else {}
788+ device_info .update ({
789+ 'fpga_version' : "{}.{}" .format (
790+ * self .mboard_regs_control .get_compat_number ())
791+ })
792+ return device_info
787793
788794 ###########################################################################
789795 # Clock/Time API
You can’t perform that action at this time.
0 commit comments