Skip to content

Commit 9e7c901

Browse files
authored
Merge pull request #1 from Nefelim4ag/master
Notes about autosync time on device
2 parents fa55dda + 4937853 commit 9e7c901

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ Allowing non-root access to the device
7878

7979
The file ``udev/99-nuvoton-hid.rules`` contains an example set of rules for setting the device permissions to ``0666``. Copy the file to the directory ``/etc/udev/rules.d/`` to use it.
8080

81+
Autosync time when device connected
82+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83+
84+
The file ``scripts/evic-usb-rtc-sync.service`` + ``udev/99-nuvoton-hid.rules`` is a example of how to auto sync time
85+
8186
Usage
8287
-------
8388
See ``--help`` for more information on a given command.

scripts/evic-usb-rtc-sync.service

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[Unit]
2+
Description=Evic RTC sync
3+
4+
[Service]
5+
ExecStart=/usr/bin/evic-usb time
6+
RemainAfterExit=yes

udev/99-nuvoton-hid.rules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ SUBSYSTEM=="usb", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="5020", MODE="0666"
33

44
# HIDAPI/hidraw
55
KERNEL=="hidraw*", ATTRS{busnum}=="1", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="5020", MODE="0666"
6+
7+
# HIDAPI/libusb RTC Sync
8+
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="5020", RUN+="/usr/bin/systemctl restart evic-usb-rtc-sync'"

0 commit comments

Comments
 (0)