Open ptrdvds opened 2 years ago
I found that os detection does not work for Mac OS.
Please use:
import platform if platform.system() == "Linux": import fcntl def sender(self): while True: if not(self.enabled): continue if platform.system() == "Linux": fcntl.ioctl(self.desc, 0x5427) # Yeah, it's magic. Start Break (TIOCSBRK) time.sleep(0.0001) fcntl.ioctl(self.desc, 0x5428) # Yeah, it's magic. End Break (TIOCCBRK) else: self.ser.send_break(0.0001)
https://docs.python.org/3.8/library/platform.html
I tried to use a pull request, but it was to cumbersome.
Thanks for the code, it works for me, but with changes merged to master for OS detection, it easier to use. I am a mac and linux user :)
Chears Peter
The platform test could also be used to set the default USB port for an OS. Eg.: For "Darwin" : '/dev/tty.usbserial-1420' For "Linux" : '/dev/ttyUSB0
I found that os detection does not work for Mac OS.
Please use:
https://docs.python.org/3.8/library/platform.html
I tried to use a pull request, but it was to cumbersome.
Thanks for the code, it works for me, but with changes merged to master for OS detection, it easier to use. I am a mac and linux user :)
Chears Peter