Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Higher baud rates for macOS #37

Open
tkornack opened this issue Aug 21, 2016 · 2 comments
Open

Higher baud rates for macOS #37

tkornack opened this issue Aug 21, 2016 · 2 comments
Milestone

Comments

@tkornack
Copy link

Arbitrary baud rates—in particular 460800—are available on macOS using a special IOKit call. Kindly consider a special case ioctl call for them. Here is what pyserial does:

    IOSSIOSPEED = 0x80045402 
    class PlatformSpecific(PlatformSpecificBase):
        osx_version = os.uname()[2].split('.')
        # Tiger or above can support arbitrary serial speeds
        if int(osx_version[0]) >= 8:
            def _set_special_baudrate(self, baudrate):
                # use IOKit-specific call to set up high speeds
                buf = array.array('i', [baudrate])
                fcntl.ioctl(self.fd, IOSSIOSPEED, buf, 1)
@dcuddeback
Copy link
Owner

@tkornack Not just Mac, but Linux supports this too with a different ioctl.

@luojia65
Copy link

Any further works? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants