Search code examples
vbscriptportserial-communicationusbserialdocklight

Listening to 2 senders on the same USB Port using Docklight


I am currently working on a script in docklight v2.0.

My setup is the following:

  • I have a splitter connected in the USB port of my PC.
  • That splitter is connected on a wire on which a communication is made between 2 devices.
  • Docklight is connected on the USB port and receives all the information transmited through that wire.
  • I have a script on docklight set up to put every byte in a buffer once docklight sniffs them.
  • My script is coded using the functions in Docklight and VBScript.

The problem I have is the following:

I put all the bytes in the same buffer, that mixes up the messages from both devices and it becomes impossible to analyse them.

What I need to do:

I need to know which byte comes from which device, Docklight is already able to do so, but I need to do that in my script so I can put the bytes in 2 different buffers to treat the data properly.


Solution

  • Using the fonction DL.OnReceive_GetChannel() solved my problem.