From a49e634af3efe9cd5b2f408e1f912865ad4fbaa4 Mon Sep 17 00:00:00 2001 From: pelikhan Date: Fri, 9 Sep 2022 06:57:20 -0700 Subject: [PATCH] more robust client matching --- tools/microbit-jukebox/runtime.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/microbit-jukebox/runtime.ts b/tools/microbit-jukebox/runtime.ts index e470cdab9..4686a818c 100644 --- a/tools/microbit-jukebox/runtime.ts +++ b/tools/microbit-jukebox/runtime.ts @@ -210,7 +210,7 @@ namespace machine { // this device was previously connected // and clients are already instantiated for it jacdac.bus.unattachedClients.some( - client => client.roleName === d.deviceId + client => client.roleName.indexOf(d.deviceId) === 0 ) ) } @@ -257,7 +257,7 @@ namespace machine { Math.randomRange(0, 4), Math.randomRange(0, 3), Math.randomRange(0, 1), - Math.randomRange(0, 255) + Math.randomRange(100, 255) ) return factory.handler(d.deviceId, serviceIndex, sonifyOptions) }