node-adb-client icon indicating copy to clipboard operation
node-adb-client copied to clipboard

Use incrementing id instead of 12345 for localId?

Open gmaclennan opened this issue 9 years ago • 6 comments

I don't fully understand the code, but it looks like all OPEN commands are being sent with the same localId 12345. From what I understand of the protocol, this will cause errors if we try to open two streams at the same time?

gmaclennan avatar Apr 18 '16 23:04 gmaclennan

Correct, it would cause errors if we wanted to open two streams at the same time. I just used 12345 for convenience as the library is still a WIP, but I can't really think of any situation that would require two streams either. Can you give an example of what you'd use multiple streams for?

cstyan avatar Apr 19 '16 00:04 cstyan

I was thinking of pulling multiple files from the device, although maybe for this protocol it would be better to make pull commands synchronous.

I've been reading through the code to see if we can use it for pulling files off phones from an Electron packaged app (cross-platform MTP access is a headache).

Any plans to implement the LIST command? I could also take a crack at it in a week or two when I have some time, if you'd accept PRs.

gmaclennan avatar Apr 19 '16 00:04 gmaclennan

I was thinking of pulling multiple files from the device, although maybe for this protocol it would be better to make pull commands synchronous. Not sure what you're referring to about the protocol, but I could probably add support for multiple streams fairly easily. It's just not on the TODO list at the moment.

Which LIST command are you referring to? Listing all connected devices?

cstyan avatar Apr 19 '16 00:04 cstyan

Hi @cstyan, re. the protocol, I was just referring to not really understanding the ADB protocol and being unsure whether it would be faster to read files in parallel. Certainly not a priority right now, more a curiosity as I try to understand things.

Re. LIST, I was referring to the list of files in a directory

gmaclennan avatar Apr 19 '16 00:04 gmaclennan

I have some more detailed documentation of the protocol here: https://github.com/cstyan/adbDocumentation

To be honest, I this list command is probably fairly easy. Most commands are just glorified shell commands. Can you create another issue for implementing LIST?

cstyan avatar Apr 19 '16 00:04 cstyan

Sure thing, thanks for all the responses.

gmaclennan avatar Apr 19 '16 00:04 gmaclennan