MCPcopy Index your code
hub / github.com/marijnh/Eloquent-JavaScript / screen

Function screen

code/hangar2.js:100–117  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

98 }
99
100 function screen(n) {
101 return (req, resolve, reject) => {
102 if (!req || req.command !== "display") {
103 reject(new Error("LedTec SIG-5030: INVALID REQUEST " + req?.type))
104 } else if (!Array.isArray(req.data) || req.data.length !== 1500) {
105 reject(new Error("LedTec SIG-5030: INVALID DISPLAY DATA"))
106 } else {
107 if (!screens) {
108 if (typeof window != "object" || !window.document) return
109 screens = new Screens
110 }
111 setTimeout(() => {
112 screens.update(n, req.data)
113 resolve({status: "ok"})
114 }, 3 + Math.floor(Math.random() * 20))
115 }
116 }
117 }
118
119 ;["10.0.0.44", "10.0.0.45", "10.0.0.41",
120 "10.0.0.31", "10.0.0.40", "10.0.0.42",

Callers 1

hangar2.jsFile · 0.85

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected