@@ -133,6 +133,7 @@ def __init__(
133133 self .queueStatus : Optional [mesh_pb2 .QueueStatus ] = None
134134 self .queue : collections .OrderedDict = collections .OrderedDict ()
135135 self ._localChannels = None
136+ self .filesystem_entries = collections .OrderedDict ()
136137
137138 # We could have just not passed in debugOut to MeshInterface, and instead told consumers to subscribe to
138139 # the meshtastic.log.line publish instead. Alas though changing that now would be a breaking API change
@@ -376,6 +377,22 @@ def getNestedValue(node_dict: Dict[str, Any], key_path: str) -> Any:
376377 print (table )
377378 return table
378379
380+ def showFileSystem (self ) -> str :
381+ """Display filesystem entries reported by the radio."""
382+ if not self .filesystem_entries :
383+ message = "No filesystem entries received."
384+ print (message )
385+ return message
386+
387+ rows = []
388+ for path , size in self .filesystem_entries .items ():
389+ size_str = str (size ) if size or size == 0 else "-"
390+ rows .append ((path , size_str ))
391+
392+ table = tabulate (rows , headers = ("Path" , "Size (bytes)" ), tablefmt = "plain" )
393+ print (table )
394+ return table
395+
379396 def getNode (
380397 self , nodeId : str , requestChannels : bool = True , requestChannelAttempts : int = 3 , timeout : int = 300
381398 ) -> meshtastic .node .Node :
@@ -1349,6 +1366,10 @@ def _handleFromRadio(self, fromRadioBytes):
13491366 self ._handleLogRecord (fromRadio .log_record )
13501367 elif fromRadio .HasField ("queueStatus" ):
13511368 self ._handleQueueStatusFromRadio (fromRadio .queueStatus )
1369+ elif fromRadio .HasField ("fileInfo" ):
1370+ file_info = fromRadio .fileInfo
1371+ logger .debug (f"Received file info: { file_info } " )
1372+ self .filesystem_entries [file_info .file_name ] = file_info .size_bytes
13521373 elif fromRadio .HasField ("clientNotification" ):
13531374 publishingThread .queueWork (
13541375 lambda : pub .sendMessage (
0 commit comments