Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fixes for tip #3

Merged
merged 6 commits into from
Feb 20, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions Makefile

This file was deleted.

3 changes: 3 additions & 0 deletions basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import (
)

func TestConnection(t *testing.T) {
if testing.Short() {
return
}
c0 := &Config{Name: "COM5", Baud: 115200}

/*
Expand Down
1 change: 0 additions & 1 deletion serial_linux.go

This file was deleted.

5 changes: 4 additions & 1 deletion serial_darwin.go → serial_posix.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// +build !windows

package serial

// #include <termios.h>
// #include <unistd.h>
import "C"

// TODO: Maybe change to using syscall package + ioctl instead of cgo

import (
Expand All @@ -15,7 +18,7 @@ import (
)

func openPort(name string, baud int) (rwc io.ReadWriteCloser, err error) {
f, err := os.OpenFile(name, os.O_RDWR|os.O_NOCTTY|os.O_NONBLOCK, 0666)
f, err := os.OpenFile(name, syscall.O_RDWR|syscall.O_NOCTTY|syscall.O_NONBLOCK, 0666)
if err != nil {
return
}
Expand Down
4 changes: 3 additions & 1 deletion serial_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build windows

package serial

import (
Expand Down Expand Up @@ -50,7 +52,7 @@ func openPort(name string, baud int) (rwc io.ReadWriteCloser, err error) {
if err != nil {
return nil, err
}
f := os.NewFile(h, name)
f := os.NewFile(uintptr(h), name)
defer func() {
if err != nil {
f.Close()
Expand Down