ixCheckPortTransmitDone
ixCheckPortTransmitDone - checks whether transmission is done on a port
SYNOPSIS
ixCheckPortTransmitDone chassisID cardID portID
DESCRIPTION
The ixCheckPortTransmitDone command polls the transmit rate statistic counter and returns when transmission has stopped. Note: This command should be called no earlier than one second after starting transmit with ixStartTransmit or ixStartPortTransmit.
Note: It should be preceded by an after 1000 statement following the previous command, to allow the effects of the previous command to have an effect on the port hardware.
ARGUMENTS
chassisID
(By value) The ID number of the chassis.
cardID
(By value) The ID number of the card.
portID
(By value) The ID number of the port.
RETURNS
0
No frames were sent or the stat get framesSent command failed.
numTxFrames
No Error; number of frames transmitted since the last time statistics were cleared.
EXAMPLES
package require IxTclHal
set host galaxy
set username user
# Check if we're running on UNIX - connect to the TCL Server
# which must be running on the chassis
if [isUNIX] {
if [ixConnectToTclServer $host] {
ixPuts "Could not connect to $host"
return 1
}
}
# Now connect to the chassis
if [ixConnectToChassis $host] {
ixPuts $::ixErrorInfo
return 1
}
# Get the chassis ID to use in port lists
set chas [ixGetChassisID $host]
set chas 1
set cardA 1
set portA 4
set portList [list [list $chas $cardA $portA]]
# Login before taking ownership
if [ixLogin $username] {
ixPuts $::ixErrorInfo
return 1
}
# Take ownership of the ports we'll use
if [ixTakeOwnership $portList] {
ixPuts $::ixErrorInfo
return 1
}
port setDefault
port set $chas $cardA $portA
stream setDefault
stream config -dma stopStream
stream config -numFrames 100000
stream set $chas $cardA $portA 1
ixWritePortsToHardware portList
after 1000
if {[ixCheckLinkState portList] != 0} {
ixPuts "Link is not up"
}
# Start transmit and wait a bit
ixStartPortTransmit $chas $cardA $portA
after 1000
# Check if the port has stopped
ixCheckPortTransmitDone $chas $cardA $portA
ixPuts "PortA Stopped transmitting"
# Let go of the ports that we reserved
ixClearOwnership $portList
# Disconnect from the chassis we're using
ixDisconnectFromChassis $host
# If we're running on UNIX, disconnect from the TCL Server
if [isUNIX] {
ixDisconnectTclServer $host
}