Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oberernst/macrina
A CoAP server
https://github.com/oberernst/macrina
coap coap-server elixir
Last synced: about 2 months ago
JSON representation
A CoAP server
- Host: GitHub
- URL: https://github.com/oberernst/macrina
- Owner: oberernst
- Created: 2022-03-12T01:56:17.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-31T16:44:45.000Z (over 1 year ago)
- Last Synced: 2024-10-19T07:31:57.228Z (3 months ago)
- Topics: coap, coap-server, elixir
- Language: Elixir
- Homepage:
- Size: 85.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Macrina
Saint Macrina, patron of Robotics, ora pro nobis
---
UNDER CONSTRUCTION! It's still a rough draft that I'm ripping to shreds constantly. LMK if you'd like this to change
* CoAP binary request encoding and decoding (RFC 7253.3)
* CoAP Block Transfers (RFC 7959)
* Endpoint
* can receive and decode messages
* started with arbitrary `handler` function for processing messages## Overview
### `Macrina.Endpoint`
A thin `GenServer` wrapper around `:gen_udp`. Given an IP and port, any incoming UDP packets at that port will be sent to the `Endpoint`. This is done via `GenServer`'s built-in `handle_info` functionality.### `Macrina.Connection.Server`
A `GenServer` that represents a connection from the local `Endpoint` that started it to some other `Endpoint`. Given an IP, port, and `Handler` module, this process serves two important functions:
* general message handling
* receiving `{:coap, binary()}` messages
* decoding those messages
* using the given `Handler` module to process the message and generate any CoAP responses
* sending those responses via `:gen_udp`
* client message handling
* the included `Macrina.Client` uses this process to send requests
* clients use a `GenServer.call` to do this, which returns the response from the requested endpoint or times out### `Macrina.Message`
Used for encoding and decoding `CoAP` messages, defining a `struct` for in memory representation