node-svmq icon indicating copy to clipboard operation
node-svmq copied to clipboard

receive mtype value with on data callback

Open kikolehm opened this issue 8 years ago • 1 comments

Hi,

First of all thanks for the intresting project. One missing thing I have noticed is that mtype value is not provided on data event. It would be really useful to also know what was message type.

kikolehm avatar May 26 '17 07:05 kikolehm

Hi @kikolehm, good suggestion. It will require some changes to the ReceiveMessageWorker in the native code to pass back either a JS object containing both mtext and mtype or a third callback parameter (err, mtext, mtype). From there, the JS data event can be modified to pass back an object:

{
  data: Buffer,
  type: Number
}

I'm open to pull requests if you have time to work on this yourself. Otherwise, I'll try to look into it over the next couple of weeks, but no promises.

jhead avatar May 26 '17 15:05 jhead