arduino / mdns-discovery

mdns (bonjour) pluggable discovery
GNU General Public License v3.0
18 stars 6 forks source link

Port label is returned with unnecessary escape chars #21

Closed silvanocerza closed 2 years ago

silvanocerza commented 2 years ago

Currently returned event:

{                                                                                                                                                  
  "eventType": "add",                                                                                                                              
  "port": {                                                                                                                                        
    "address": "10.130.22.171",                                                                                                                    
    "label": "HP\\ OfficeJet\\ Pro\\ 7740\\ series\\ [55F0FA]._scanner._tcp.local. at 10.130.22.171",                                              
    "protocol": "network",                                                                                                                         
    "protocolLabel": "Network Port",                                                                                                               
    "properties": {                                                                                                                                
      "UUID": "8e0a28b0-76c0-52c7-8478-7d9eaf722fdf",                                                                                              
      "adminurl": "http://HPB4B68655F0FA.local.",                                                                                                  
      "button": "T",
      "feeder": "T",
      "flatbed": "T",
      "hostname": "HPB4B68655F0FA.local.",
      "mdl": "OfficeJet Pro 7740 series",
      "mfg": "HP",
      "mopria-certified": "1.3",
      "note": "",
      "port": "8080",
      "txtvers": "1",
      "ty": "HP OfficeJet Pro 7740 series"
    }
  }
}

Expected:

{                                                                                                                                                  
  "eventType": "add",                                                                                                                              
  "port": {                                                                                                                                        
    "address": "10.130.22.171",                                                                                                                    
    "label": "HP OfficeJet Pro 7740 series [55F0FA] at 10.130.22.171",                                              
    "protocol": "network",                                                                                                                         
    "protocolLabel": "Network Port",                                                                                                               
    "properties": {                                                                                                                                
      "UUID": "8e0a28b0-76c0-52c7-8478-7d9eaf722fdf",                                                                                              
      "adminurl": "http://HPB4B68655F0FA.local.",                                                                                                  
      "button": "T",
      "feeder": "T",
      "flatbed": "T",
      "hostname": "HPB4B68655F0FA.local.",
      "mdl": "OfficeJet Pro 7740 series",
      "mfg": "HP",
      "mopria-certified": "1.3",
      "note": "",
      "port": "8080",
      "txtvers": "1",
      "ty": "HP OfficeJet Pro 7740 series"
    }
  }
}

Notice also how the label is simplified to remove the ._scanner._tcp.local. part.

per1234 commented 2 years ago

@fstasi @silvanocerza was it intended to close this issue?

If so, please add a short summary (e.g., it was resolved by PR number ___)

silvanocerza commented 2 years ago

Yup, it has been solved by #22.