tecki / ebpfcat

A Python-base EBPF code generator
GNU General Public License v2.0
17 stars 5 forks source link

Example for Scans device #4

Open jinyistudio534 opened 8 months ago

jinyistudio534 commented 8 months ago

Can you share a little example about hoe to scan devices in the bus ? 😵 i have test your sample from ebpfcat.ebpfcat import FastEtherCat

master = FastEtherCat("eth0") await master.connect() await master.scan_bus()

but i get following message 😵 python ebpfcat1.py File "/home/jinyistudio/python/ebpfcat1.py", line 6 await master.connect() ^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: 'await' outside function

tecki commented 7 months ago

awaits need to be in a coroutine. I hoped I had made that clear in the documentation, but apparently not clear enough.

I clarified the documentation and gave a full example.