Skip to main content
Skip table of contents

serial_get_info(id)

기능

연결된 USB to Serial의 포트정보, 장치이름을 읽어옵니다.

인수

인수명자료형기본값설명

id

int

1

읽고싶은 USB to Serial ID (1~10)

리턴

값(port_info, device_name)설명

port_info

포트정보 (값이 NULL인 경우 연결된 장치 없음)

device_name

장치이름 (값이 NULL인 경우 연결된 장치 없음)

예외

예외설명

DR_Error (DR_ERROR_TYPE)

인수의 데이터형 오류 시

DR_Error (DR_ERROR_VALUE)

인수의 값이 유효하지 않을 시

예제

PY
port_info, device_name = serial_get_info(1) #1번째 연결된 장치의 정보조회 
#port_info = “COM_USB”
ser = serial_open(port=port_info, baudrate=115200, bytesize=DR_EIGHTBITS, 
        parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.