コード例 #1
0
ファイル: test_ax25frame.py プロジェクト: tarpn/aioax25
def test_encode_frmr_frmr_ctrl():
    """
    Test we can set the FRMR Control field on a FRMR frame.
    """
    frame = AX25FrameRejectFrame(destination='VK4BWI',
                                 source='VK4MSL',
                                 w=False,
                                 x=False,
                                 y=False,
                                 z=False,
                                 vr=0,
                                 vs=0,
                                 frmr_control=0x55,
                                 frmr_cr=False)
    hex_cmp(
        bytes(frame),
        'ac 96 68 84 ae 92 60'  # Destination
        'ac 96 68 9a a6 98 e1'  # Source
        '87'  # Control
        '00 00 55'  # FRMR data
    )
コード例 #2
0
ファイル: test_ax25frame.py プロジェクト: tarpn/aioax25
def test_frmr_copy():
    """
    Test we can copy a FRMR frame.
    """
    frame = AX25FrameRejectFrame(destination='VK4BWI',
                                 source='VK4MSL',
                                 w=False,
                                 x=False,
                                 y=False,
                                 z=False,
                                 vr=0,
                                 vs=0,
                                 frmr_control=0x55,
                                 frmr_cr=False)
    framecopy = frame.copy()

    assert framecopy is not frame
    hex_cmp(
        bytes(framecopy),
        'ac 96 68 84 ae 92 60'  # Destination
        'ac 96 68 9a a6 98 e1'  # Source
        '87'  # Control
        '00 00 55'  # FRMR data
    )
コード例 #3
0
ファイル: test_ax25frame.py プロジェクト: tarpn/aioax25
def test_encode_frmr():
    """
    Test that we can encode a FRMR.
    """
    frame = AX25FrameRejectFrame(destination='VK4BWI',
                                 source='VK4MSL',
                                 w=True,
                                 x=False,
                                 y=True,
                                 z=False,
                                 vr=1,
                                 frmr_cr=False,
                                 vs=2,
                                 frmr_control=0xaa,
                                 cr=True)
    hex_cmp(
        bytes(frame),
        'ac 96 68 84 ae 92 e0'  # Destination
        'ac 96 68 9a a6 98 61'  # Source
        '87'  # Control
        '05'  # W/X/Y/Z
        '24'  # VR/CR/VS
        'aa'  # FRMR Control
    )