Skip to content

Commit f66fcc8

Browse files
committedAug 6, 2014
Added bufferalgorithm list
Former-commit-id: 7f9d18af484437ae407c845c3cd1bc3347a0bf42 [formerly 7a7a0d55c9ef1531246c8e9d372d40250ec6600b] Former-commit-id: d6409b1f8ec4b318bd688af2e46c534a71aaec3a
1 parent 4e05996 commit f66fcc8

7 files changed

+32
-6
lines changed
 

‎README.md.REMOVED.git-id

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
74cafc97c4e0fbd0b6699faf950340ba85fd12cb
1+
0de95ffc7bd9a19853d1edcc63774ebf817db8b9

‎bufferflow_default.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
)
99

1010
type BufferflowDefault struct {
11+
Name string
12+
Port string
1113
}
1214

1315
var ()

‎bufferflow_dummypause.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func (b *BufferflowDummypause) BlockUntilReady() bool {
1919
log.Printf("BlockUntilReady() start. numLines:%v\n", b.NumLines)
2020
log.Printf("buffer:%v\n", b)
2121
//for b.Paused {
22-
log.Println("We are paused. Yeilding send.")
22+
log.Println("We are paused for 3 seconds. Yeilding send.")
2323
time.Sleep(3000 * time.Millisecond)
2424
//}
2525
log.Printf("BlockUntilReady() end\n")
@@ -33,10 +33,29 @@ func (b *BufferflowDummypause) OnIncomingData(data string) {
3333
log.Printf("OnIncomingData() end. numLines:%v\n", b.NumLines)
3434
}
3535

36+
func (b *BufferflowDummypause) Pause() {
37+
return
38+
}
39+
40+
func (b *BufferflowDummypause) Unpause() {
41+
return
42+
}
43+
3644
func (b *BufferflowDummypause) SeeIfSpecificCommandsShouldSkipBuffer(cmd string) bool {
3745
return false
3846
}
3947

48+
func (b *BufferflowDummypause) SeeIfSpecificCommandsShouldPauseBuffer(cmd string) bool {
49+
return false
50+
}
51+
52+
func (b *BufferflowDummypause) SeeIfSpecificCommandsShouldUnpauseBuffer(cmd string) bool {
53+
return false
54+
}
55+
4056
func (b *BufferflowDummypause) SeeIfSpecificCommandsShouldWipeBuffer(cmd string) bool {
4157
return false
4258
}
59+
60+
func (b *BufferflowDummypause) ReleaseLock() {
61+
}

‎bufferflow_tinyg.go.REMOVED.git-id

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
28a4fc9264c1a04cd360d739ef187251d1ce502a
1+
fd1392787230fd2dc2b0177d0d6da43ab0b5eb38

‎hub.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (h *hub) run() {
3838
h.connections[c] = true
3939
// send supported commands
4040
c.send <- []byte("{\"Version\" : \"" + version + "\"} ")
41-
c.send <- []byte("{\"Commands\" : [\"list\", \"open [portName] [baud]\", \"send [portName] [cmd]\", \"close [portName]\"]} ")
41+
c.send <- []byte("{\"Commands\" : [\"list\", \"open [portName] [baud] [bufferAlgorithm (optional)]\", \"send [portName] [cmd]\", \"sendnobuf [portName] [cmd]\", \"close [portName]\", \"bufferalgorithms\", \"baudrates\"]} ")
4242
case c := <-h.unregister:
4343
delete(h.connections, c)
4444
close(c.send)
@@ -131,13 +131,18 @@ func checkCmd(m []byte) {
131131
}
132132

133133
} else if strings.HasPrefix(sl, "send") {
134+
// will catch send and sendnobuf
134135

135136
//args := strings.Split(s, "send ")
136137
go spWrite(s)
137138

138139
} else if strings.HasPrefix(sl, "list") {
139140
go spList()
140141
//go getListViaWmiPnpEntity()
142+
} else if strings.HasPrefix(sl, "bufferalgorithm") {
143+
go spBufferAlgorithms()
144+
} else if strings.HasPrefix(sl, "baudrate") {
145+
go spBaudRates()
141146
} else {
142147
go spErr("Could not understand command.")
143148
}

‎serial.go.REMOVED.git-id

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2c2bd75b6d7cd02144015099a4e8f34f9bedae8a
1+
4f33c4e28de6baffff11708eed0574a4f17ca036

‎serialport.go.REMOVED.git-id

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
70e2a4345e89af9c04d0454e02c148a9cc04e88e
1+
ad7c6e32238f823153af09d5dce4f200e9b5eac2

0 commit comments

Comments
 (0)
Please sign in to comment.