Skip to content

Commit 59e009d

Browse files
committed
add port to serial output
1 parent 4e91762 commit 59e009d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

bufferflow_timed.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (b *BufferflowTimed) Init() {
3434
bufferedOutput = bufferedOutput + data
3535
case <-b.ticker.C:
3636
if bufferedOutput != "" {
37-
m := SpPortMessage{bufferedOutput}
37+
m := SpPortMessage{b.Port, bufferedOutput}
3838
buf, _ := json.Marshal(m)
3939
// data is now encoded in base64 format
4040
// need a decoder on the other side

bufferflow_timedraw.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (b *BufferflowTimedRaw) Init() {
3232
b.ticker = time.NewTicker(16 * time.Millisecond)
3333
for _ = range b.ticker.C {
3434
if len(bufferedOutputRaw) != 0 {
35-
m := SpPortMessageRaw{bufferedOutputRaw}
35+
m := SpPortMessageRaw{b.Port, bufferedOutputRaw}
3636
buf, _ := json.Marshal(m)
3737
// data is now encoded in base64 format
3838
// need a decoder on the other side

serialport.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ type qwReport struct {
8383
}
8484

8585
type SpPortMessage struct {
86-
// P string // the port, i.e. com22
86+
P string // the port, i.e. com22
8787
D string // the data, i.e. G0 X0 Y0
8888
}
8989

9090
type SpPortMessageRaw struct {
91-
// P string // the port, i.e. com22
91+
P string // the port, i.e. com22
9292
D []byte // the data, i.e. G0 X0 Y0
9393
}
9494

@@ -157,7 +157,7 @@ func (p *serport) reader() {
157157

158158
if p.bufferwatcher.IsBufferGloballySendingBackIncomingData() == false {
159159
//m := SpPortMessage{"Alice", "Hello"}
160-
m := SpPortMessage{data}
160+
m := SpPortMessage{p.portConf.Name, data}
161161
//log.Print("The m obj struct is:")
162162
//log.Print(m)
163163

0 commit comments

Comments
 (0)