intrepidcs / icsscand

User-mode SocketCAN daemon for Intrepid devices
BSD 2-Clause "Simplified" License
10 stars 6 forks source link

Add scan-interval-ms parameter #13

Closed j-rge closed 10 months ago

j-rge commented 1 year ago

Allow user to specify the scan interval for searching for devices. Scanning places every interface on the machine in promiscuous mode and currently runs once a second. This behaviour may have undesirable side-effects and also pollutes the kernel log.

The new parameter --scan-interval-ms will allow the user to specify the rate at which scanning occurs. If equal to 0, then only a single scan is performed.

Resolves [#12]

j-rge commented 11 months ago

@kschwarz-intrepidcs Thanks for the review.

I've been using this addition successfully with --scan-interval-ms 0 for weeks now with a single NeoVI Fire 3. I will test with multiple units concurrently to see if it will pick them all up in a single scan.

j-rge commented 11 months ago

@kschwarz-intrepidcs Update: I was able to test with two NeoVI Fire 3 units simultaneously in the "single scan" mode --scan-interval-ms 0 and confirm that both units were detected (16 CAN interfaces per unit) in the scan.

$ sudo ./libicsneo-socketcan-daemon --scan-interval-ms 0 &
$ ip a | grep can
85: can0: <NOARP,ECHO> mtu 72 qdisc noop state DOWN group default qlen 10 link/can 

. . .

119: can31: <NOARP,ECHO> mtu 72 qdisc noop state DOWN group default qlen 10 link/can
kschwarz-intrepidcs commented 10 months ago

Thanks @j-rge!