Hi,
I'm making a Node.js add-on and I want a callback function like this:
var port = new addon.CANPort();
>
> port.setCallback(function(msg) {
>
> console.log(msg);
>
> });
>
>
That will be useful because I will receive some datagrams, and I want my
Node server to manage them.
But I can't find useful examples of people using MakeCallback function...
void CanObject::CANCallback(sCanMsg* msg)
>
> {
>
> Isolate* isolate = Isolate::GetCurrent();
>
> HandleScope scope(isolate);
>
>
>> const int argc = 1;
>
> Handle<Value> argv[argc] = { String::NewFromUtf8(isolate, "This is a test
>> !") };
>
> node::MakeCallback(isolate, I_DONT_KNOW, mCallback, argc, argv);
>
> }
>
>
So mCallback is fixed with a mCallback.Reset(isolate,
args[0].As<Function>());
but now, I don't know what to put in MakeCallback as second argument :
Handle<Object> recv...
Thanks,
Nicolas.
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/837f6c18-0c68-4b8c-82c6-f9084e4b501b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.