How to use the get_tuner_gains function from bindings

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

11
12
13
14
15
16
17
18
19
20
21
22
rtlsdr.TUNER_R820T = 5
rtlsdr.TUNER_R828D = 6


/* eslint-disable camelcase */


const get_tuner_gains = rtlsdr.get_tuner_gains
rtlsdr.get_tuner_gains = function (dev, gains) {
  const buf = Buffer.alloc(gains.length * 4) // TODO: int size is OS dependent
  const result = get_tuner_gains(dev, buf)
  for (let i = 0; i < gains.length; i++) {
fork icon13
star icon73
watch icon0

+ 3 other calls in file

393
394
395
396
397
398
399
400
401
402
it('returns an array of tuner gains from rtlsdr_get_tuner_gains', () => {
	rtlsdr.get_tuner_gains(dev).should.eql([0, 10, 20, 30, 40]);
});

it('throws if dev_hnd is not an open device handle', () => {
	(() => rtlsdr.get_tuner_gains({})).should.throw();
});

it('throws if rtlsdr_get_tuner_gains errors', () => {
	rtlsdr.mock_set_rtlsdr_dev_contents(dev, 'mock_return_error', -1);
fork icon0
star icon1
watch icon0

+ 95 other calls in file

Other functions in bindings

Sorted by popularity

function icon

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