728x90

It depends on what is ENTER for your device.
In Windows it is CRLF (13 and then 10), Linux is LF (only 10.)
It's just a matter of what your device expects, because it can't see ENTER, just "byte 10, byte 13.


시리얼 통신에서 장비 콘솔 접속 제어 처리를 할 때 알아두어야 할 값이라 적어둔다.

    public final static char CR  = (char) 0x0D; // \r
    public final static char LF  = (char) 0x0A; // \n
    public final static char SPaceBar  = (char) 0x20;


윈도우상에서 콘솔로 접속하여 처리하던 걸 안드로이드에서 하려고 한다면 윈도우에서 사용하는 키를 알아야 동작한다는 점만 알면 다음 고려사항은 쉽게 풀린다.


Converting Control Codes to ASCII, Decimal and Hexadecimal
The ^ symbol stands for Ctrl

Ctrl    ASCII     Dec     Hex    Meaning
^@     NUL    000     00     Null character
^A     SOH    001     01     Start of Header
^B     STX    002     02     Start of Text
^C     ETX    003     03     End of Text
^D    EOT    004     04     End of Transmission
^E     ENQ     005     05     Enquiry
^F     ACK     006     06     Acknowledge
^G    BEL    007     07     Bell
^H     BS     008     08     Backspace
^I     HT     009     09    Horizontal tab
^J    LF     010     0A     Line feed
^K     VT     011     0B     Vertical tab
^L     FF    012     0C     Form feed
^M     CR     013     0D     Carriage return
^N     SO     014     0E     Shift out
^O     SI     015     0F     Shift in
^P     DLE     016     10     Data link escape
^Q     DCL     017     11     Xon (transmit on)
^R     DC2     018     12     Device control 2
^S     DC3     019     13    Xoff (transmit off)
^T     DC4     020     14     Device control 4
^U     NAK     021     15     Negative acknowledge
^V    SYN     022     16     Synchronous idle
^W    ETB     023     17     End of transmission
^X    CAN     024     18     Cancel
^Y    EM     025     19     End of medium
^Z    SUB     026     1A     Substitute
^[    ESC     027     1B     Escape
^\    FS     028     1C     File separator
^]    GS     029     1D     Group separator
^^    RS     030     1E    Record separator
^_    US     031     1F     Unit separator
        SP     032     20     Space

블로그 이미지

Link2Me

,