0.2.419 • Published 5 years ago

ds-cctalk v0.2.419

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
5 years ago

(deprecated) moved ds-cctalk

CCTalk Node.js Implamentation Classes

Importent

Please don't use this the active Maintained version is https://github.com/direktspeed/node-cctalk

npm i node-cctalk
const cc = require('ds-cctalk')

// Use
cc.device() // Register / Create a Device
cc.bus() // Open a new Connection gets used by device if not defined befor
cc.command() // gets used by bus and device for the sendCommand and sendCommandRaw prototypes
// running this file as main
if(!module.parent) {

  var usbBus =  new CCBus('/dev/ttyUSB0');

  var cd = new require(usbBus, { dest: 2, timeout: 1000 });

  cd.on('error', function(e) {
    debug('emp800::')(e);
  });

  cd.on('ready', function() {
    try {
      debug('emp800::')('ready');
      cd.enableAcceptance();
      cd.setAcceptanceMask(0xFFFF);
      // Example sendCommand for usage see CCTalk Spec for more information
      // cd.sendCommand({ src: 1, dest: 2, command: 231, data: new Uint8Array(0) });
      cd.on('error', function(e) { debug('emp800::')('error', e); });
      cd.on('accepted', function(c) {
        debug('emp800::')('Accepted', c);
        cd.getCoinName(c).then(function(name) { debug('emp800::')(name); });
      });
      cd.on('inhibited', function(c) {
        debug('emp800::')('Inhibited', c);
        cd.getCoinName(c).then(function(name) { debug('emp800::')(name); });
      });
      cd.on('rejected', function(c) { debug('emp800::')('Rejected', c); });
    } catch(e) {
      debug('emp800::')(e, e.stack);
    }
  });


}

If You need help implamenting this feel free to asks Wenn Sie Hilfe brauchen bei der Implementierung fragen Sie ruhig

0.2.419

5 years ago

0.2.418

5 years ago

0.2.417

7 years ago

0.2.416

7 years ago

0.2.415

7 years ago

0.2.414

7 years ago

0.2.413

7 years ago

0.2.412

7 years ago

0.2.411

7 years ago

0.2.410

7 years ago

0.2.39

7 years ago

0.2.38

7 years ago

0.2.37

7 years ago

0.2.36

7 years ago

0.2.35

7 years ago

0.2.34

7 years ago

0.2.33

7 years ago

0.2.32

7 years ago

0.2.31

7 years ago

0.2.30

7 years ago

0.2.29

7 years ago

0.2.28

7 years ago

0.2.27

7 years ago

0.2.26

7 years ago

0.2.25

7 years ago

0.2.24

7 years ago

0.2.23

7 years ago

0.2.22

7 years ago

0.2.21

7 years ago

0.2.20

7 years ago

0.2.19

7 years ago

0.2.18

7 years ago

0.2.17

7 years ago

0.2.16

7 years ago

0.2.15

7 years ago

0.2.14

7 years ago

0.2.13

7 years ago

0.2.12

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.28

7 years ago

0.1.27

7 years ago

0.1.26

7 years ago

0.1.25

7 years ago

0.1.24

7 years ago

0.1.23

7 years ago

0.1.22

7 years ago

0.1.21

7 years ago

0.1.20

7 years ago

0.1.19

7 years ago

0.1.18

7 years ago

0.1.17

7 years ago

0.1.16

7 years ago

0.1.15

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago