Packages

An OTP application for reading and parsing GPS data written in Elixir. Will attach to an serial port, and provide positions to subscribers. Distributes positions using GenStage.

Current section

Files

Jump to
xgps lib xgps driver generic.ex
Raw

lib/xgps/driver/generic.ex

defmodule XGPS.Driver.Generic do
@moduledoc """
Generic driver for XGPS
"""
alias Circuits.UART
def init(%{pid: pid, port_name: port_name} = state) do
:ok = UART.configure(pid, framing: {UART.Framing.Line, separator: "\r\n"})
:ok = UART.open(pid, port_name, speed: 9600, active: true)
{:ok, state}
end
end