12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- var bleTool = require("./JLBleManagerTool.js"),
- dataTool = require("./dataTool.js"),
- bleCode = require("./errorCode.js"),
- writeDeviceId = "",
- writeServiceId = "",
- writeCharacterticId = "";
- export function initModule(e) {
- bleTool.setParams(e)
- }
- export function scanDevice(e, o) {
- bleTool.scan_StartScanBleDevice(e, e => {
- o.call(this, e)
- })
- }
- export function stopScanDevice(e) {
- bleTool.scan_stopScanBleDevice(function (o) {
- e.call(this, o)
- })
- }
- export function characticValueChange(e, o, c) {
- bleTool.findDeviceServices(e, e => {
- o.call(this, e)
- }, e => {
- c.call(this, e)
- })
- }
- export function connectDevice(e, o) {
- bleTool.connectDevice(e, e => {
- o.call(this, e)
- })
- }
- export function disConnect(e) {
- bleTool.disConnectDevice(function (o) {
- e.call(this, o)
- })
- }
- export function onDeviceDisconnect(e) {
- bleTool.onDeviceConnectStateChange(function (o) {
- e.call(this, o)
- })
- }
- export function sendCommand(e, o) {
- bleTool.sendMessageToDevice(e, function (e) {
- o.call(this, e)
- })
- }
|