Joke Collection Website - Blessing messages - How does node ffi call c++ class methods?
How does node ffi call c++ class methods?
Strict use'
/**
* SMS service module
* */
var FFI = require(' FFI ');
//int send _ msg (char * phone, char * content) c language interface.
var libm = ffi。 Library (__dirname+'/msgQ/libsend_msg',
{
send_msg': ['int ',['string ',' string']]
});
let smsExport = {
Send message (optional) {
let phone = opt.phone
let content = opt.text
//Call C interface to send SMS.
Let retcode = libm.send_msg (phone, content);
if (retcode === 0)
{
// TODO succeeded
}
Otherwise {
// TODO failed
}
}
};
module.exports = smsExport
- Previous article:Is it safe to log in on WeChat to catch dolls?
- Next article:Will Meituan make a phone call when buying prescription drugs?
- Related articles
- I bought the house on 20 18. The bank informed me before that I can adjust the mortgage interest rate now. Do you need to adjust interest? Which is better?
- How to reimburse cooperative medical care
- Honey, I like your message.
- Xiaomi's mobile phone opens multiple applications at the same time. How to mute or reduce one application alone?
- What are the online marketing methods? How about the marketing of Shenzhen Excelle? Asking for information
- How to turn off the display of information content?
- Aauto Quicker commented on how to send numbers.
- Does the medical insurance card have SMS reminder function?
- About the Mid-Autumn Festival
- Samsung mobile phone doesn't ring when it receives the message. How to set it?