diff options
| author | Ha Thach <[email protected]> | 2021-03-10 11:37:07 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-10 11:37:07 +0700 |
| commit | ccb599f84bf26e979e209bfe03307ce582e021af (patch) | |
| tree | 431ca32797b665b5c9a76b2fefa5549caa8d9bb8 /examples/device | |
| parent | 2adb7e719316b12c53a907153cfa0056db1abd70 (diff) | |
| parent | 4a73b6a21930c71368153fe4197b96f9d100fc4c (diff) | |
Merge pull request #710 from hathach/update-doc
update doc for BOARD name, add note for udev on Linux
Diffstat (limited to 'examples/device')
| -rw-r--r-- | examples/device/99-tinyusb.rules | 14 | ||||
| -rw-r--r-- | examples/device/webusb_serial/src/main.c | 20 |
2 files changed, 34 insertions, 0 deletions
diff --git a/examples/device/99-tinyusb.rules b/examples/device/99-tinyusb.rules new file mode 100644 index 000000000..e6372ed58 --- /dev/null +++ b/examples/device/99-tinyusb.rules @@ -0,0 +1,14 @@ +# Copy this file to the location of your distribution's udev rules, for example on Ubuntu: +# sudo cp 99-tinyusb.rules /etc/udev/rules.d/ +# Then reload udev configuration by executing: +# sudo udevadm control --reload-rules +# sudo udevadm trigger + +# Check SUBSYSTEM +SUBSYSTEMS=="hidraw", KERNEL=="hidraw*", MODE="0666", GROUP="dialout" + +# Rule applies to all TinyUSB example +ATTRS{idVendor}=="cafe", MODE="0666", GROUP="dialout" + +# Rule to blacklist TinyUSB example from being manipulated by ModemManager. +SUBSYSTEMS=="usb", ATTRS{idVendor}=="cafe", ENV{ID_MM_DEVICE_IGNORE}="1" diff --git a/examples/device/webusb_serial/src/main.c b/examples/device/webusb_serial/src/main.c index 143a73374..6a5a9fa61 100644 --- a/examples/device/webusb_serial/src/main.c +++ b/examples/device/webusb_serial/src/main.c @@ -23,6 +23,26 @@ * */ +/* This example demonstrates WebUSB as web serial with browser with WebUSB support (e.g Chrome). + * After enumerated successfully, browser will pop-up notification + * with URL to landing page, click on it to test + * - Click "Connect" and select device, When connected the on-board LED will litted up. + * - Any charters received from either webusb/Serial will be echo back to webusb and Serial + * + * Note: + * - The WebUSB landing page notification is currently disabled in Chrome + * on Windows due to Chromium issue 656702 (https://crbug.com/656702). You have to + * go to landing page (below) to test + * + * - On Windows 7 and prior: You need to use Zadig tool to manually bind the + * WebUSB interface with the WinUSB driver for Chrome to access. From windows 8 and 10, this + * is done automatically by firmware. + * + * - On Linux/macOS, udev permission may need to be updated by + * - copying '/examples/device/99-tinyusb.rules' file to /etc/udev/rules.d/ then + * - run 'sudo udevadm control --reload-rules && sudo udevadm trigger' + */ + #include <stdlib.h> #include <stdio.h> #include <string.h> |
