How to use the open function from bindings

Find comprehensive JavaScript bindings.open code examples handpicked from public code repositorys.

105
106
107
108
109
110
111
112
113
114
  rc.showTime = defined(options.showTime, rc.showTime, true)
  rc.showLine = defined(options.showLine, rc.showLine, true)
  rc.showFile = defined(options.showFile, rc.showFile, true)
  rc.showTags = defined(options.showTags, rc.showTags, true)

  connected = bindings.open(rc.title, fac[rc.facility], rc.upto)
}

process.on('exit', function () {
  if (connected) 
fork icon10
star icon54
watch icon5

+ 25 other calls in file

62
63
64
65
66
67
68
69
70
  this.opening = true;

  const device = `/dev/i2c-${busnum}`;
  debug('opening', `path: ${device}`);

  await fromCallback(cb => wire.open(device, cb));
  this.opening = false;
  this.opened = true;
}
fork icon90
star icon0
watch icon2

+ 9 other calls in file

69
70
71
72
73
74
75
76
77
78
}

stream.Stream.call(this);

this.port = path;
this.fd = serialport_native.open(this.port, options.baudrate, options.databits, options.stopbits, options.parity, options.flowcontrol);
if (this.fd == -1) {
  throw new Error("Could not open serial port");
} else {
  this.readStream = fs.createReadStream(this.port,{bufferSize:options.buffersize});
fork icon0
star icon5
watch icon4

+ 9 other calls in file

30
31
32
33
34
35
36
37
38
39
pause() { return kinect.pause() }
seek(time) { return kinect.seek(time) }
get time() { return kinect.time() }
get duration() { return kinect.duration() }

open() { return kinect.open() }

/**
 * Starts the kinect cameras
 * @param {Object} options The configuration for the cameras
fork icon20
star icon0
watch icon1

+ 11 other calls in file

15
16
17
18
19
20
21
22
23
24
}
export class Pcan extends Duplex {
        private inst: any = null;
        constructor(info: PcanInfo) {
                super({ objectMode: true });
                this.inst = bindings.open(info, (data: any) => {
                        this.push(data);
                });
        }
        _read(size: number) {
fork icon1
star icon0
watch icon0

87
88
89
90
91
92
93
94
95
96
		rtlsdr.mock_get_rtlsdr_dev_contents(dev1).should.have.property('index', 1);
		rtlsdr.mock_get_rtlsdr_dev_contents(dev1).should.have.property('open', true);
	});

	it('throws if index does not exist', () => {
		(() => rtlsdr.open(2)).should.throw();
	});
});

describe('open-device functions', () => {
fork icon0
star icon1
watch icon0

+ 191 other calls in file

61
62
63
64
65
66
67
68
69
70

if (this.isOpen) {
  return asyncError(cb, new Error('Already open'));
}

binding.open(path, options, function afterOpen(err, fd) {
  if (err) {
    return cb(err);
  }
  this.fd = fd;
fork icon0
star icon0
watch icon1

+ 11 other calls in file

222
223
224
225
226
227
228
229
230
231
this.readable = true;
this.reading = false;
this.opening = true;

var self = this;
SerialPortBinding.open(this.path, this.options, function (err, fd) {
  if (err) {
    debug('SerialPortBinding.open had an error', err);
    return self._error(err, callback);
  }
fork icon0
star icon0
watch icon2

+ 11 other calls in file

Other functions in bindings

Sorted by popularity

function icon

bindings.createKey is the most popular function in bindings (8616 examples)