TMRAppBle/script/module/zifuka.js

22 lines
616 B
JavaScript

var moudleSocket;
var ZFKUtil = {
initZFK:function(param,callback){
moudleSocket = api.require("moduleDemo")
moudleSocket.createTcp({ host: param.host, port: param.port }, function (ret, err) {
callback(ret,err)
})
},
createTcp:function(param,callback){
moudleSocket.createTcp({ host: param.host, port: param.port }, function (ret, err) {
callback(ret,err)
})
},
sendMsg:function(param,callback){
moudleSocket.send({msg:param.msg},function (ret, err) {
callback(ret,err)
})
}
}
export {
ZFKUtil
}