English | 简体中文
Flutter plugin for connect & operate on smart notepad
- 36notes
- Pendo TODO
- Wacom Smartpads TODO
- Scan notepad
- Connect notepad
- Sync notepen pointer
let device = notepadConnector.requestDevice();
console.log(`requestDevice ${device}`);
let scanResultReceiver = function (scanResult) {
console.log(`onScanResult ${scanResult}`);
};
notepadConnector.onScanResult(scanResultReceiver);
notepadConnector.startScan();
// ...
notepadConnector.stopScan();
notepadConnector.offScanResult(scanResultReceiver);
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);
-
NotepadMode.Common
Notepad saves only
NotePenPointer
with positive pressure & accurate timestamp, into offline memo -
NotepadMode.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");
Receive NotePenPointer
s in NotepadMode.Sync
let syncPointerReceiver = function (pointers) {
console.log(`onSyncPointerReceive ${pointers.length}`);
};
_notepadClient.onSyncPointerReceive(syncPointerReceiver);
// ...
_notepadClient.offSyncPointerReceive(syncPointerReceiver);