forked from Blendman974/faceclaw
Add bluetooth settings options to bandwidth benchmark
This commit is contained in:
1 parent
50cbc3a756
commit
5a97b218e6
4 files changed
+85
-7
No files matched your search
@@ -14,6 +14,7 @@ export type BandwidthBenchmarkStatus = {
|
||||
state: "idle" | "starting" | "running" | "done";
|
||||
messageSize: number;
|
||||
windowSize: number;
|
||||
linkMode: number;
|
||||
elapsedMs: number;
|
||||
messagesSent: number;
|
||||
messagesAcked: number;
|
||||
@@ -33,12 +34,14 @@ function activeCommunicator(): any {
|
||||
}
|
||||
|
||||
/** Start a run. False if not connected or a run is already active. */
|
||||
export function startBandwidthBenchmark(messageSize: number, windowSize: number, durationMs: number): boolean {
|
||||
export function startBandwidthBenchmark(messageSize: number, windowSize: number, durationMs: number, linkMode = 0): boolean {
|
||||
const active = activeCommunicator();
|
||||
if (!active) return false;
|
||||
try {
|
||||
return Boolean(
|
||||
active.startBandwidthBenchmark(Math.round(messageSize), Math.round(windowSize), Math.round(durationMs)),
|
||||
active.startBandwidthBenchmarkWithLinkMode(
|
||||
Math.round(messageSize), Math.round(windowSize), Math.round(durationMs), Math.round(linkMode),
|
||||
),
|
||||
);
|
||||
} catch (error) {
|
||||
console.warn(`startBandwidthBenchmark failed: ${error}`);
|
||||
|
||||
Reference in new issue
Block a user