var dlfcn = require("dlfcna.js");
//console.log(dlfcn)

var funcs = [
    ["startlte", "v"],
    ["closelte", "v"],
    ["read", "is"],
];

//console.log("in factory_testlte.js")
function register() {
    //console.log("will register lte.so")
    var isSuccess = dlfcn.register("@native.lte", "./lib/factory/lte.so", funcs);
    if (isSuccess) {
        //console.log("load so successfully")
        var lte = require("@native.lte");
        return lte
    } else {
        //console.log("load so failed")
    }
    return undefined;
}
var lte = register();

function start() {
    lte.startlte();
}
function close() {
    lte.closelte();
}
function read(option) {

//    option -> "data" // return "aaaaaaaaaaa"
//    option -> "imei" // return "11"
   return lte.read(option);
}

module.exports = {
    start: start,
    close: close,
    read: read,
}

