sniff
Elixir Serial Port NIF
Notice: sniff focuses in the native interface to serial ports. For high level serial port access see baud.
Installation and Usage
-
Add
sniffto your list of dependencies inmix.exs:
def deps do
[{:sniff, "~> 0.1.6"}]
endDevelopment
-
Testing requires two null modem serial ports configured in
test/test_helper.exs -
Test against the build server farm with:
./farm.sh remote
Windows
Install Visual C++ 2015 Build Tools by one of the following methods:
- Download and install visualcppbuildtools_full.exe
-
Thru Chocolatey
choco install VisualCppBuildTools.
From the Windows run command launch cmd /K c:\Users\samuel\Documents\github\sniff\setenv.bat adjusting your code location accordingly.
Ubuntu
Give yourself access to serial ports with sudo gpasswd -s samuel dialout. Follow the official Elixir installation instructions and install build-essential erlang-dev as well.
MacOS
No support provided other than ensuring compilation and basic interactive testing.
sudo dseditgroup -o edit -a samuel -t user admin
sudo dseditgroup -o edit -a samuel -t user wheelRoadmap
Future
- Binary distro to avoid devenv setup
- Ensure farm.sh handles local.hex --force
- Document build server farm setup
- Cleanup windows compilation warnings
- Pass test serial port thru environment variables
-
Requirements to migrate to elixir_make:
- Allow using a different make file for each unix platform
- Pass the BUILD_PATH to the makefile
- Pass the ERTS_HOME to the makefile
0.1.5
- Added O_NONBLOCK for MacOS file open.
- Tests confirmed to pass on linux.
- Upgraded ex_doc to compile with latest elixir
- Test serial port names detection on unixes
- Fixed binary leak when serial_read fails
- Separated darwin and linux baudrate files
0.1.4
- Handle spaces in Windows build path
0.1.3
- Document Windows dependencies
-
BAT to launch windows dev environment
- A bat to call env.bat and cd back to code folder is provided
- must be executed from Windows run command (no double click)
-
Ensure native library can be loaded on first compile
- First deps.get && compile works fine
- Second compile works fine
- clean && compile fails to load NIF library
-
Ensure native library can be loaded from IEX
- Tested on OSXElCapitan/Ubuntu16.10/Windows10
-
Ensure native library can be loaded when used as dependency from IEX
- Tested on OSXElCapitan/Ubuntu16.10/Windows10
-
Pass the ERTS_HOME to unix makefiles
- Tested on OSXElCapitan/Ubuntu16.10/Windows10
0.1.2
-
Empty priv is committed and included in hex package so that native libraries get copied to
_buildwhen compiled as dependency
0.1.1
- Tests pass on a clean Windows 10 VM (see build.bat)
- Automatic test against Ubuntu 16 & Windows 10
0.1.0
- Drop mac target until stable serial ports
- Ubuntu 16.04 64 and Windows 10 Pro 64 support
- Extract baud nif branch to its own repo
Research
- Support udoo neo
- Support beaglebone black
- Support raspberry pi 3 B
- Bypass the 0.1s minimum granularity on posix systems
- Higher baud rates support for posix and win32
- DTR/RTS control and CTS/DSR monitoring
- Unit test 8N1 7E1 7O1 and baud rate setup against a confirmed gauge
- Posix async and Windows overlapped
- Buffer discarding