elixir-circuits / circuits_uart

Discover and use UARTs and serial ports in Elixir
Apache License 2.0
189 stars 48 forks source link

Add function to set controlling_process #69

Closed robinhilliard closed 4 years ago

robinhilliard commented 5 years ago

Add function to update controlling process, as already implemented on :gen_tcp and :gen_udp. I wasn't sure if you'd rather have this in configure, but having a separate function mimics the Erlang network libraries.

The reason this feature is useful is that it allows a user to move new/retry connection attempts into a separate process and pass the uart back to the main process (which is busy doing time-sensitive-rather-not-be-blocked-stuff) when it's ready.

I created a basic smoke test for calling the function but I have been unable to run the unit tests after following the OS X socat instructions (the devices just don't seem to be created in /dev, and yes I changed the user name).

Cheers, Robin

fhunleth commented 5 years ago

Yes, this is needed. Thanks!

I'll have to look at the OSX instructions again, since it sounds like they're no longer working. I'll also take more of a look at the PR when I get a chance this week, but I wanted to let you know that I really appreciated the update!

robinhilliard commented 4 years ago

Hi, any chance you'd be able to merge this soon? We're prevented from doing a new hex release for our MAVLink library while we depend on my github fork of this.

Cheers, Robin

fhunleth commented 4 years ago

Yes, and thanks for the reminder. I'll make sure it gets done today or tomorrow. Sorry for the delay!!!

fhunleth commented 4 years ago

Just an update, @ssachse and I will be running some tests on circuits_uart tomorrow to make sure that the release is ok. We had an illness and a rush at work come up, but tomorrow looks completely clear for us to finish this off. Your change looks very low risk so I don't expect any surprises.

robinhilliard commented 4 years ago

Thanks for the update Frank, most appreciated.

fhunleth commented 4 years ago

Merged! Thanks for the patience. Release coming out shortly.