Skip to content

Instantly share code, notes, and snippets.

defmodule UartListener do
use GenServer
@serial_port "/dev/cu.usbserial-2210" # e.g., "/dev/ttyUSB0"
@baud_rate 115200
# @ic7300_address "94" # Hexadecimal address of IC-7300
# @controller_address "E0" # Hexadecimal address of the controller (PC)
# Client
def start_link(args) do
defmodule UartListener do
use GenServer
@serial_port "/dev/cu.usbserial-2210" # e.g., "/dev/ttyUSB0"
@baud_rate 115200
# @ic7300_address "94" # Hexadecimal address of IC-7300
# @controller_address "E0" # Hexadecimal address of the controller (PC)
# Client
def start_link(args) do
defmodule UartListener do
use GenServer
@serial_port "/dev/cu.usbserial-2210" # e.g., "/dev/ttyUSB0"
@baud_rate 115200
# Client
def start_link(args) do
GenServer.start_link(__MODULE__, args, name: __MODULE__)
end
@zenom
zenom / uart_test.ex
Created December 18, 2023 00:54
My uart test.
odule RadioListener do
# use Circuits.UART
# when you use circuits.uart.enumerate there is an id
# which we could map to which module we want to use.
@serial_port "/dev/cu.usbserial-2210" # e.g., "/dev/ttyUSB0"
@baud_rate 115200
@ic7300_address "94" # Hexadecimal address of IC-7300
@controller_address "E0" # Hexadecimal address of the controller (PC)
# A user can be a part of multiple teams and orgs. The OrgTeam
# table has user_id, organization_id and team_id
defmodule Conspyre.Customers do
import Ecto.Query
alias Conspyre.Repo
alias Conspyre.Customers.{Team, OrgTeam}
alias Conspyre.Users.User
SENT: M122
READ: X Y Z E
READ: Address 0 0 0 0
READ: Enabled false false false false
READ: Set current 800 800 800 800
READ: RMS current 795 795 795 795
READ: MAX current 1121 1121 1121 1121
READ: Run current 25/31 25/31 25/31 25/31
READ: Hold current 12/31 12/31 12/31 12/31
READ: CS actual 12/31 12/31 12/31 12/31
#! /bin/sh
### BEGIN INIT INFO
# Provides: darkice
# Required-Start: $remote_fs $syslog $network $named $time alsa-utils
# Required-Stop: $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: darkice audio streamer
# Description: Darkice will take an ALSA audio input and send it to
# a streaming server.
@zenom
zenom / darkice.cfg
Last active December 30, 2015 18:40
# darkice configuration file
[general]
duration = 0 # 0 means forever
bufferSecs = 10 # Internal buffer, 10 is good
reconnect = yes # reconnect if stream broken? default: yes
[input]
ORSSerialRequest *request =
[ORSSerialRequest requestWithDataToSend:requestData
userInfo:nil
timeoutInterval:2.0
responseEvaluator:^BOOL(NSData *inputData) {
if ([inputData length] != 8) return NO;
NSData *headerData = [inputData subdataWithRange:NSMakeRange(0, 4)];
NSString *header = [[NSString alloc] initWithData:headerData encoding:NSASCIIStringEncoding];
return [header isEqualToString:@"data"];
}];
@zenom
zenom / gist:38534fb697d9ede78bee
Created February 21, 2015 14:38
Loading Window
@preferencesWindowController = PreferencesWindow.alloc.initWithWindowNibName('PreferencesWindow')
@preferencesWindowController.window