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 gp04s.ex
Raw

lib/xgps/driver/gp04s.ex

defmodule XGPS.Driver.GP04S do
@moduledoc """
Driver for GP-04S GPS antenna
"""
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: 4_800, active: true)
{:ok, state}
end
end