notepad-core
v0.3.0
Published
English | [简体中文](./README-CN.md)
Downloads
4
Readme
English | 简体中文
notepad_core
Flutter plugin for connect & operate on smart notepad
- 36notes
- Pendo TODO
- Wacom Smartpads TODO
Usage
- Scan notepad
- Connect notepad
- Sync notepen pointer
Scan notepad
Web
let device = notepadConnector.requestDevice();
console.log(`requestDevice ${device}`);
Mini-program on Wechat
let scanResultReceiver = function (scanResult) {
console.log(`onScanResult ${scanResult}`);
};
notepadConnector.onScanResult(scanResultReceiver);
notepadConnector.startScan();
// ...
notepadConnector.stopScan();
notepadConnector.offScanResult(scanResultReceiver);
Connect notepad
Connect to device
requested from notepadConnector.requestDevice()
or scanResult
received from notepadConnector.onScanResult
let connectionChangeHandler = function (notepadClient, connectionState) {
console.log(`onConnectionChange ${notepadClient}, ${connectionState}`);
};
notepadConnector.onConnectionChange(connectionChangeHandler);
notepadConnector.connect(obj); // obj = device/scanResult
// ...
notepadConnector.disconnect();
notepadConnector.offConnectionChange(connectionChangeHandler);
Sync notepen pointer
NotepadClient#setMode
NotepadMode.Common
Notepad saves only
NotePenPointer
with positive pressure & accurate timestamp, into offline memoNotepadMode.Sync
Notepad notify every
NotePenPointer
, positive or not, without timestamp, to connected mobile device
Notepad is always NotepadMode.Common
(connected or disconnected), unless setMode
after connected
await _notepadClient.setMode(NotepadMode.Sync);
console.log("setMode complete");
NotepadClient#onSyncPointerReceive
Receive NotePenPointer
s in NotepadMode.Sync
let syncPointerReceiver = function (pointers) {
console.log(`onSyncPointerReceive ${pointers.length}`);
};
_notepadClient.onSyncPointerReceive(syncPointerReceiver);
// ...
_notepadClient.offSyncPointerReceive(syncPointerReceiver);