Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I will run client.framebuffer is not working. #142

Open
gksdnfla opened this issue Jul 29, 2022 · 1 comment
Open

I will run client.framebuffer is not working. #142

gksdnfla opened this issue Jul 29, 2022 · 1 comment

Comments

@gksdnfla
Copy link

NodeJS version: 12.22.12
GraphicsMagick version: 1.3.36

Source Code:

const adb = require('adbkit');
const client = adb.createClient();

client
    .listDevices()
    .then(function (devices) {
        devices.forEach((device) => {
            client.framebuffer(device.id, 'jpeg', (err, data) => {
                if (err) return console.log(err);
                console.log('---------------------', data);
                var bufs = [];
                data.on('data', function (chunk) {
                    bufs.push(chunk);
                });
                data.on('end', function () {
                    var buffer = new Buffer.concat(bufs);
                    var out = fs.createWriteStream('out.jpg');
                    out.write(buffer);
                    out.end();
                });
            });
        });
    })
    .catch((er) => console.log(err));

Error Message:

TypeError: Cannot read property 'pipe' of undefined
    at FrameBufferCommand._convert (C:\projects\electron_auto\node_modules\adbkit\lib\adb\command\host-transport\framebuffer.js:67:9)
    at C:\projects\electron_auto\node_modules\adbkit\lib\adb\command\host-transport\framebuffer.js:39:34
    at tryCatcher (C:\projects\electron_auto\node_modules\adbkit\node_modules\bluebird\js\main\util.js:26:23)
    at Promise._settlePromiseFromHandler (C:\projects\electron_auto\node_modules\adbkit\node_modules\bluebird\js\main\promise.js:503:31)
    at Promise._settlePromiseAt (C:\projects\electron_auto\node_modules\adbkit\node_modules\bluebird\js\main\promise.js:577:18)
    at Promise._settlePromises (C:\projects\electron_auto\node_modules\adbkit\node_modules\bluebird\js\main\promise.js:693:14)
    at Async._drainQueue (C:\projects\electron_auto\node_modules\adbkit\node_modules\bluebird\js\main\async.js:123:16)
    at Async._drainQueues (C:\projects\electron_auto\node_modules\adbkit\node_modules\bluebird\js\main\async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (C:\projects\electron_auto\node_modules\adbkit\node_modules\bluebird\js\main\async.js:15:14)
    at processImmediate (internal/timers.js:461:21)
@tiennguyen12g
Copy link

hello my friend, i get the same issue, can you give your solution? Thank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants