Skip to content

Commit 38551de

Browse files
committed
chore: detect target operating system
1 parent 474c801 commit 38551de

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/schemas/hardware.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export const Hardware = ({ onCreate, onUpdate }: ISchema) => {
2626
const [transportType, setTransportType] = useState('serial');
2727
const [tcpHostname, setTcpHostname] = useState('10.0.0.100');
2828
const [tcpPort, setTcpPort] = useState('12345');
29-
const [serialPort, setSerialPort] = useState('COM3');
29+
const [serialPort, setSerialPort] = useState(
30+
navigator.userAgent.includes('Windows') ? 'COM3' : '/dev/ttyUSB0'
31+
);
3032
const [serialBaudrate, setSerialBaudrate] = useState('57600');
3133

3234
const updateEndpoint = useCallback(() => {

0 commit comments

Comments
 (0)