Device.js document commented. Gate.js partially commented, missing comments on the last functions