Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 1.07 KB

README.md

File metadata and controls

33 lines (26 loc) · 1.07 KB

JavaScript consumer library for the Simple Device Drawing Protocol

API

TBD

Example: hello-world

new require('sddp-javascript-consumer')('sddp.ConsumerA', 'sddpExample', { 
  host: '...', 
  password: '...' 
})
.connect(process.argv.pop() || 'sddp.Display1')
.then((display) => {
  display.clear()
  display.writeAt(3, 0, 'Hello')
  display.writeAt(4, 1, 'World!')
  const timeStr = new Date().toLocaleTimeString()
  display.writeAt(20 - timeStr.length, 3, timeStr)
  display.disconnect()
})
.catch((err) => {
  console.error('Connection failed:', err)
  process.exit(-1)
})

A trace of the traffic generated by the execution of this script is shown here.

On an LCM2004A 4x20 character display, execution of the above would result in:

hello-world executed on an LCM2004A 4x20 character display (white text on blue background)