Breadcrust
Programmer
im trying to make a program i can interface with devices on the paralell port (on linux) with :
---------------------------------
proc sendtext {newline} {
global outtext
global port
if {$newline} {
set sendtext "$outtext\n"
} else {
set sendtext $outtext
}
.text insert end $sendtext
puts -nonewline $port $sendtext
}
proc readtext {} {
global port
.text insert end [read "$port"]
after idle readtext
}
text .text
frame .control
entry .control.text -textvariable outtext
button .control.send -text "Send" -command {sendtext false}
button .control.sendnl -text "Send (\\n)" -command {sendtext true}
button .control.recieve -text "Start Recieving" -command {
.control.recieve configure -state disabled
readtext
}
pack .text -fill both -expand true
pack .control -fill x
pack .control.text -fill both -expand true -side left
pack .control.send -fill y -side right
pack .control.sendnl -fill y -side right
pack .control.recieve -fill y -side right
set port [open /dev/lp0 r+]
-------------------------------------------------------
the problem is, when i try to start receiving stuff from the paralell port it comes up with cannot read from file4: i/o error. what am i doing wrong?
Breadcrust (aka J@red)
Web - E-mail - net-head@softhome.net
Linux Reg. Number - 307180
---------------------------------
proc sendtext {newline} {
global outtext
global port
if {$newline} {
set sendtext "$outtext\n"
} else {
set sendtext $outtext
}
.text insert end $sendtext
puts -nonewline $port $sendtext
}
proc readtext {} {
global port
.text insert end [read "$port"]
after idle readtext
}
text .text
frame .control
entry .control.text -textvariable outtext
button .control.send -text "Send" -command {sendtext false}
button .control.sendnl -text "Send (\\n)" -command {sendtext true}
button .control.recieve -text "Start Recieving" -command {
.control.recieve configure -state disabled
readtext
}
pack .text -fill both -expand true
pack .control -fill x
pack .control.text -fill both -expand true -side left
pack .control.send -fill y -side right
pack .control.sendnl -fill y -side right
pack .control.recieve -fill y -side right
set port [open /dev/lp0 r+]
-------------------------------------------------------
the problem is, when i try to start receiving stuff from the paralell port it comes up with cannot read from file4: i/o error. what am i doing wrong?
Breadcrust (aka J@red)
Web - E-mail - net-head@softhome.net
Linux Reg. Number - 307180