Breadcrumbs

serial_close()

Definition

serial_close(ser)

Features

This function closes a serial communication port.

Parameters

Parameter Name

Data Type

Default Value

Description

ser

serial.Serial

-

Serial instance

Return

Value

Description

0

Successful closing of a serial port

Exception

Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

Example

Python
ser = serial_open(port="COM", baudrate=115200, bytesize=DR_EIGHTBITS, 
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)
 
res = serial_write(ser, b"123456789")
 
serial_close(ser)