You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Exists already? Update it's (portPath/Name or iP)
55
61
updatePort(port,alist);
56
62
}else{
57
63
// else, add it as a new port record (all fields included; many with default values to be updated later)
58
64
log("Adding port: "+alist.path,mDbug);
59
65
ports.push({
60
-
path : alist.path,/*[<>""] Wired port path, or wireless port's custom name, or fabricated name; never empty*/
66
+
name : makePortName(alist.path),/*[<>""] Friendly port name; never empty, does not include path*/
67
+
path : alist.path,/*[<>""] Wired port path+name, or wireless port's custom name, or fabricated name; never empty*/
61
68
connId : get("connId",alist,null),/*[null+] Holds wired serial port's connection id (if open), null (if closed)*/
62
69
mac : get("mac",alist,""),/*[""+] Holds wireless port's MAC address*/
63
70
ip : get("ip",alist,""),/*[""+] Wireless port's IP address; */
@@ -81,6 +88,7 @@ function updatePort(port, alist) {
81
88
/* Update port attributes if necessary. Automatically handles special case of baudrate changes.
82
89
port: [required] port object to update
83
90
alist: [required] one or more attributes of port to update. Unchanging attributes can be omitted. Possible attributes are:
91
+
name: the friendly name of the port (not including path). Can be empty ("") and a name will be created from path
84
92
path: the string path to the wired serial port, or custom name of wireless port. Can be empty ("") and a wireless name will be fabricated from the MAC address
85
93
connId: unique identifier for the wired serial port connection id
86
94
ip: the wireless port's IP address
@@ -96,12 +104,20 @@ function updatePort(port, alist) {
96
104
if(exists(attr,alist)){port[attr]=alist[attr]}
97
105
}
98
106
99
-
if(exists("path",alist)&&!alist.path){
100
-
// Empty port path? If wireless port, craft path from mac, else abort (reject)
0 commit comments