Skip to content

Instantly share code, notes, and snippets.

View jjmilburn's full-sized avatar

Josh Milburn jjmilburn

View GitHub Profile
@jjmilburn
jjmilburn / some stereo magic
Created November 7, 2014 20:37
stereo maybe
public short[] toMonoSampleArray() {
int written = 0;
final short[] samples = new short[this.buffersTotalLength];
for(short[] buffer : buffers) {
System.arraycopy(buffer, 0, samples, written, buffer.length);
written += buffer.length;
}
@jjmilburn
jjmilburn / limNEC.conf
Created December 18, 2014 23:29
limited param NEC file
#
# this config file was automatically generated
# using lirc-0.8.6(SerialDevice) on Thu Aug 12 09:57:19 2010
#
# contributed by
#
# brand: Advance Acoustic
# model no. of remote control: MAP-305II/DAII
# devices being controlled by this remote: Advcance Acoustic MAP-305DAII
#
/****************************************************************************
** hw_ftdi.c ***************************************************************
****************************************************************************
*
* Mode2 receiver + transmitter using the bitbang mode of an FTDI
* USB-to-serial chip such as the FT232R, with a demodulating IR receiver
* connected to one of the FTDI chip's data pins -- by default, D1 (RXD).
*
* Copyright (C) 2008 Albert Huitsing <albert@huitsing.nl>
* Copyright (C) 2008 Adam Sampson <ats@offog.org>
@jjmilburn
jjmilburn / index.html
Created June 4, 2012 02:52
AllTheThingsInOneBigThing
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src = "http://code.jquery.com/jquery-1.7.2.min.js">
</script>
<title>All Your Base</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
@jjmilburn
jjmilburn / SketchSystems.spec
Last active April 29, 2019 07:10
Product MCU - PAYG MCU UART Link
Product MCU - PAYG MCU UART Link
Idle*
uart_from_payg_mcu -> Buffer Message
Buffer Message
message_is_payg_uart -> Process Message
message_is_asp -> Forward Message to Accessory
Process Message
message_processed -> Idle
Forward Message to Accessory
message_forwarded -> Idle
#!/bin/sh
DAM_RO_BASE=0x43000000
export TOOL_PATH_ROOT="../../Snapdragon-llvm-4.0.3-linux64/"
export TOOLCHAIN_PATH="$TOOL_PATH_ROOT/bin"
export LLVMLINK_PATH="$TOOL_PATH_ROOT/tools/bin"
export TOOLCHAIN_PATH_STANDARDS="$TOOL_PATH_ROOT/armv7m-none-eabi/libc/include"
export LLVMLIB="$TOOL_PATH_ROOT/lib/clang/4.0.3/lib"
export PYTHON_PATH="/usr/bin/python2"
@jjmilburn
jjmilburn / SketchSystems.spec
Created December 27, 2019 07:12
ASP Accessory Symmetric Key Link Manager
ASP Accessory Symmetric Key Link Manager
Unlinked
Unlinked Idle*
TICK->Broadcast Timeout Expired?
valid_asp_link_challenge_received->Computing Link Key
Broadcasting Identity
send_asp_notify_accessory_unlinked->Unlinked Idle
Broadcast Timeout Expired?
timeout expired?->Broadcasting Identity
timeout not expired?->Unlinked Idle
@jjmilburn
jjmilburn / SketchSystems.spec
Last active October 30, 2020 02:27
POST_PAY Phone in Backend*
POST_PAY Phone in Backend*
No unit record*
# Upload IMEIs to Angaza, we will attempt to upload to Samsung
batch_upload ->SHOULD_UPLOAD
SHOULD_UPLOAD
# successfully sets reported data, marks as uploaded OK to samsung
activation_success ->UPLOADED
@jjmilburn
jjmilburn / SketchSystems.spec
Last active November 25, 2020 02:11 — forked from ricehornet/SketchSystems.spec
# Theoretically, do we want to allow an 'independent' mode where PAYG credit is always independent of link state?
# Theoretically, do we want to allow an 'independent' mode where PAYG credit is always independent of link state?
1 or more NX Channel Links
link or unlink event -> link state?
reset -> Credit Independent
Credit Leading&
tick? -> push credit update to accessory
event indicates PAYG credit has updated? -> push credit update to accessory
@jjmilburn
jjmilburn / SketchSystems.spec
Last active December 4, 2020 00:53
Generating dlight unit keycode
Generating dlight unit keycode
#dlight server index is unknown
Angaza index is X*
get_dlight_server_latest_token_data -> unit number exists on dlight server?
unit number exists on dlight server?
yes? -> dlight latest token index is X minus 1 or None?
no? -> Raise error require ticket to add unit on dlight side
dlight latest token index is X minus 1 or None?
yes? -> dlight_create_token_with_id_x
no? -> is dlight server index and token value equal to Angaza index and requested value?