This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PC=0x478b42 | |
syscall.Syscall() | |
/usr/lib/go/src/pkg/syscall/asm_linux_amd64.s:16 +0x5 | |
syscall.read(0x3, 0xc200086000, 0x1000, 0x1000, 0x100000000000003, ...) | |
/usr/lib/go/src/pkg/syscall/zerrors_linux_amd64.go:2337 +0x70 | |
syscall.Read(0x3, 0xc200086000, 0x1000, 0x1000, 0x408c18, ...) | |
/usr/lib/go/src/pkg/syscall/syscall_unix.go:132 +0x5a | |
os.(*File).read(0xc2000009a8, 0xc200086000, 0x1000, 0x1000, 0x412e14, ...) | |
/usr/lib/go/src/pkg/os/file_unix.go:174 +0x60 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The function used to produce output seen below. | |
func (b *Board) handleCapabilityResponse(m message) { | |
log.Printf("Capability: -- HEXDUMP --\n%s", hex.Dump(m.data)) | |
pin := byte(0) // start with pin 0 | |
buf := bytes.NewBuffer(m.data[2 : len(m.data)-1]) | |
for buf.Len() > 0 { | |
d, _ := buf.ReadBytes(0x7F) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S | 83 | 53 | |
| 0 | 0 | |
t | 116 | 74 | |
| 0 | 0 | |
a | 97 | 61 | |
| 0 | 0 | |
n | 110 | 6E | |
ù | 249 | F9 | |
| 2 | 2 | |
| 3 | 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ gadget go run main.go | |
Version: got 2 3 | 2.3 | |
Firmware: got 2 3 | 2.3 | |
Firmware: StandardFirmata.ino | |
Firmware: HEXDUMP: | |
F0 79 02 03 53 00 74 00 61 00 6E 00 | |
64 00 61 00 72 00 64 00 46 00 69 00 | |
72 00 6D 00 61 00 74 00 61 00 2E 00 | |
69 00 6E 00 6F 00 F7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Message struct { | |
type string | |
midiData [3]byte | |
sysexData[255]byte | |
sysexLen int | |
} | |
func NewBoard() *Board { | |
b := &Board{} | |
// Start the message loops |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/ZachMassia/gofirmata" | |
"log" | |
"time" | |
) | |
func main() { | |
a, err := firmata.NewBoard("/dev/ttyACM0", 57600) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Client struct { | |
rw *bufio.ReadWriter | |
// ... | |
} | |
func NewClient(conn net.Conn) *Client { | |
rw := bufio.NewReadWriter(bufio.NewReader(conn), bufio.NewWriter(conn)) | |
// ... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resolving dependencies... | |
looking for inter-conflicts... | |
error: failed to prepare transaction (could not satisfy dependencies) | |
:: haskell-citeproc-hs: requires haskell-mtl=2.1.2-27 | |
:: haskell-citeproc-hs: requires haskell-utf8-string=0.3.7-27 | |
:: haskell-highlighting-kate: requires haskell-mtl=2.1.2-27 | |
:: haskell-http: requires haskell-mtl=2.1.2-27 | |
:: haskell-json: requires haskell-mtl=2.1.2-27 | |
:: haskell-parsec: requires haskell-mtl=2.1.2-27 | |
:: haskell-regex-base: requires haskell-mtl=2.1.2-27 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONFIG_FILE = File.expand_path_relative_to_caller('../hatterrc') | |
def initialize(config_file = CONFIG_FILE) | |
reader = ConfigToolkit::KeyValueReader.new user_config || config_file | |
load reader | |
end | |
def user_config | |
path = File.join(Dir.home, '.hatterrc') | |
File.exists?(path) ? path : nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
require 'relative' | |
require 'configtoolkit/keyvaluereader' | |
describe 'Configuration' do | |
let(:config_file) { File.expand_path_relative_to_caller("../hatterrc") } | |
let(:maildir_path) { "/path/to/maildir" } | |
let(:maildir_format) { "maildir" } | |
let(:termbox_library_path) { "/usr/lib/libtermbox.so" } |