Comments (2)
As it relates to Issue #94, a history list will be used to retain the original Name (as well as IP and MAC) of a wireless port and will contain also a UID and Life field used by this issue to form a more stable and unique list of wireless port identifiers.
The process of making a new entry unique is as follows:
- Compare new item's MAC against the MAC of all items in history list
- If a MAC match is found:
- Compare Names
- If they match, simply set Life to 4
- If they don't match, remove entry and treat as a new non-MAC match item (below)
- Compare Names
- If no MAC match is found:
- Search list for matching Name
- If no Name match found:
- Create new entry with Name, IP, MAC, UID=Name, and Life = 4
- If a Name match found:
- Repeat Name search for Name=Name+'-#' where # is progressively more right-most MAC digits until no Name match is found (or it's used all possible MAC digits), then create new entry with Name, IP, MAC, a UID (from Name mangling above), and a Life = 4
- If no Name match found:
- Search list for matching Name
Return Wi-Fi Identifier list as a sorted list of UID values appended to the wired ports list.
NOTE: Issue #94 describes the trimming of the history list; an important part where the Life field comes into play.
from blocklypropclient.
Solved and merged via PR #96!
The official process of generating a port list (including features of Issue #86 and Issue #94) is:
wiredMaxLife is 2
wirelessMaxLife is 4
portRec is a list containing fields UID, Name, IP, MAC, and Life
- Retrieve list of wired and wireless ports from PropLoader
- For each port
- Is it a wired port?
- If wired port identifier matches an existing UID from the portRec (history list)
- Reset matching portRec's Life field to wiredMaxLife
- Else (no wired port match)
- Create new portRec entry (wired_port_identifier, n/a, n/a, n/a, wiredMaxLife)
- If wired port identifier matches an existing UID from the portRec (history list)
- Else (wireless port)
- If wireless port's MAC does not match an existing MAC from the portRec (history list)
- Create new portRec entry (UID=Unique_Name, Name, IP, MAC, wirelessMaxLife)
- Else (found MAC match)
- If Name hasn't changed
- Update portRec's matching entry to IP and wirelessMaxLife
- Else (Name has changed)
- Delete old portRec entry
- Create new portRec entry (UID=Unique_Name, Name, IP, MAC, wirelessMaxLife)
- If Name hasn't changed
- If wireless port's MAC does not match an existing MAC from the portRec (history list)
- Is it a wired port?
- Age records (subtract 1 from Life filed)
- Remove ancients (delete records with Life = 0)
- For each port
Return Wi-Fi Identifier list as a sorted list of UID values appended to the wired ports list.
For each "Create new portRec entry..." step:
MAC = entry's MAC address stripped of colons (:)
UID = Name
Size = 1
- while UID matches a UID in portRec
- Set UID to Name + Size rightmost characters from MAC
- Increment Size
- If Size = length MAC
- Prep to repeat MAC further
- Name = UID
- Size = 1
- Prep to repeat MAC further
- Create new portRec entry (UID, Name, IP, actual_MAC, wirelessMaxLife)
from blocklypropclient.
Related Issues (20)
- Terminal stream needs base64 encoding HOT 1
- Terminal character echoing needs to be turned off HOT 1
- Improve port list response HOT 1
- Version Number Management HOT 3
- Move Developer Notes to the Wiki HOT 1
- Log is cleared when application is terminated HOT 2
- Determine difference in behavior for logging on Win vs Mac HOT 1
- When running on Linux, application tries to read files from the root directory HOT 8
- Document BlocklyPropClient Troubleshooting Tips HOT 5
- Enhance to allow Wi-Fi debugging
- Improve port string parsing to prevent "R"-style ports HOT 1
- Add Update Client Ability
- Validate COM port IDs before launching PropLoader HOT 2
- Sort wired ports to their alphanumeric order HOT 1
- FTDI Driver on macOS Sierra (exclusive or not at all)
- Apply better port list handling HOT 3
- Review/Test for possible name-adjustment bug
- Unable to load program onto S2 Robot HOT 4
- Add Base64 encoding for terminal communications HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blocklypropclient.