Browse Subversion Repository
Contents of /branches/ttcomtester/tests/#40507-send-lf.ttl
Parent Directory
| Revision Log
Revision 10521 -
( show annotations)
( download)
Fri Jan 20 16:03:38 2023 UTC
(14 months, 3 weeks ago)
by zmatsuo
File size: 915 byte(s)
add communication test tool
| 1 |
; Ticket #40507 確認用マクロ |
| 2 |
; |
| 3 |
; 適当なUnix系OSに接続した状態でこのマクロを実行する。 |
| 4 |
; |
| 5 |
|
| 6 |
; ホスト側での CR -> NL 変換を無効にした状態で hexdump を実行する。 |
| 7 |
; 出力に干渉するので echo back も無効にしている。 |
| 8 |
sendln "stty -echo -icrnl; hexdump -C; stty echo icrnl" |
| 9 |
|
| 10 |
; ホスト側に ruby が有った場合は以下の方が見やすいかもしれない。 |
| 11 |
;sendln 'stty -echo -icrnl; cat | ruby -ne '"'"'puts $_.gsub(/\n/,"<LF>\n").gsub(/\r/,"<CR>\n")'"'"'; stty echo icrnl' |
| 12 |
|
| 13 |
pause 1 |
| 14 |
|
| 15 |
send "send cr" |
| 16 |
send $0D |
| 17 |
|
| 18 |
send "send lf" |
| 19 |
send $0A |
| 20 |
|
| 21 |
send "send crlf" |
| 22 |
send $0D $0A |
| 23 |
|
| 24 |
send "end" |
| 25 |
send $4 $4 |
| 26 |
end |
| 27 |
|
| 28 |
; 正しい出力: |
| 29 |
; % stty -echo -icrnl; hexdump -C; stty echo icrnl |
| 30 |
; 00000000 73 65 6e 64 20 63 72 0d 73 65 6e 64 20 6c 66 0a |send cr.send lf.| |
| 31 |
; 00000010 73 65 6e 64 20 63 72 6c 66 0d 0a 65 6e 64 |send crlf..end| |
| 32 |
; 0000001e |
| 33 |
; |
| 34 |
; ruby 使用時: |
| 35 |
; send cr<CR> |
| 36 |
; send lf<LF> |
| 37 |
; send crlf<CR> |
| 38 |
; <LF> |
| 39 |
; end |
|