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.