Explorar el Código

Quick lowercase hack to help Windows users (#103)

Windows upper cases the vendor and product id, so the filter will fail.
So LOWERCASE ALL THE THINGS!

Co-authored-by: Crosseye Jack <dan@crosseyejack.com>
CrosseyeJack hace 3 años
padre
commit
cfde66128c
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      software/js/packages/example/src/index.ts

+ 1 - 1
software/js/packages/example/src/index.ts

@@ -9,7 +9,7 @@ const main = async () => {
         // Implement a check for your device's vendor+product+serial
         // Implement a check for your device's vendor+product+serial
         // (this is more robust than the alternative of just hardcoding a "path" like "/dev/ttyUSB0")
         // (this is more robust than the alternative of just hardcoding a "path" like "/dev/ttyUSB0")
         return (
         return (
-            portInfo.vendorId === '1a86' && portInfo.productId === '7523'
+            portInfo.vendorId?.toLowerCase() === '1a86'.toLowerCase() && portInfo.productId?.toLowerCase() === '7523'.toLowerCase()
             // && portInfo.serialNumber === 'DEADBEEF'
             // && portInfo.serialNumber === 'DEADBEEF'
         )
         )
     })
     })