Greetings Everybody!


I have library on linux. 

That library have struct. 

Manual of this library says that struct must be initialized, like this:


        LONG lUserID;   NET_DVR_DEVICEINFO_V30 struDeviceInfo;  lUserID = 
NET_DVR_Login_V30("192.168.1.64", 8000, "admin", "12", &struDeviceInfo);

struDeviceInfo — output data from device, that I must to read and use.  

How can I code this in Nodejs. 

PS: I have use node-ffi module, library initialization and connect to device 
finished ok. 


Near part of code:

var libHikSDK = ffi.Library('./libhcnetsdk.so',{

'NET_DVR_Init': ['bool', []],

'NET_DVR_SetConnectTime': ['bool', ['char','char']],

'NET_DVR_SetReconnect': ['bool', ['char','bool']],

'NET_DVR_Login_V30': ['char', ['string','int', 'string','string']],

'NET_DVR_Cleanup':['void', []],

'NET_DVR_GetLastError':['char', []],

'NET_DVR_GetSDKVersion':['char',[]],

'NET_DVR_SetLogToFile':['bool',['int','string']]

});

libHikSDK.NET_DVR_Cleanup(); 

var init = libHikSDK.NET_DVR_Init();

var v = libHikSDK.NET_DVR_GetSDKVersion();

var s = libHikSDK.NET_DVR_SetConnectTime('200000', '1');

libHikSDK.NET_DVR_SetLogToFile(3,"/home/user");

var i = libHikSDK.NET_DVR_Login_V30("192.168.0.10", 8000, "admin","12345");

var g = libHikSDK.NET_DVR_GetLastError();

-- 
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 nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/d69ce10a-de88-4c4e-b683-e9057aeb8d82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to