-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support for 921600 baudrate #3
Comments
Can you share what code you test the output/input with? |
I made a second try and it works. Sorry for that. I did test a lot of things yesterday, maybe I forgot to set the baudrate on the receiver? Just for the record the code is: defmodule BaudEvaluation.Write do
@moduledoc """
Write to the serial port
"""
@buff_size 1024
def write(filename) do
device = Application.get_env(:baud_evaluation, :writeDeviceName)
IO.puts device
{:ok, serial} = Baud.start_link([device: device, speed: 921600])
file = File.open!(filename)
write_loop(serial, file)
end
def write_loop(serial, file) do
case IO.binread(file, @buff_size) do
:eof -> IO.puts "done"
{:error, reason} -> IO.puts("Error" <> reason)
content ->
IO.puts(byte_size(content))
Baud.write(serial, content)
write_loop(serial, file)
end
end
end I will submit a PR for the baudrate. |
The new baudrates from #4 break building sniff on macOS. Tested on macOS 10.12.6 (16G1114). See tomszilagyi/gen_serial#1 for a description of the problem and Gottox/node-termios#2 for a possible solution. |
@samuelventura any news on fixing the MacOS issue? |
That is awesome. Many thanks for your work! |
@jvf Thank you for your research on this. |
Hello,
I tried to extend the code to get a baudrate of 921600 by adding:
However, after testing the change by using your baud library, I notice that the data are transmitted wrongly: inputs and outputs do not match.
The text was updated successfully, but these errors were encountered: