uart_write()


지정된 UART로 데이터를 전송

Description

int uart_write(int $uart_id, int/string $wbuf [, int $wlen = MAX_STRING_LEN])

Parameters

Return Value

성공 시 전송한 데이터 길이(바이트 수), 실패 시 0

Example

<?php
include "/lib/sd_340.php";
$wbuf = "abcde";
uart_setup(0, 9600);    // 0번 UART를 9600 bps로 설정
$slen = uart_write(0, $wbuf);    // 0번 UART로 데이터 전송
usleep(500000);
echo "$slen bytes has been sent\r\n";
?>

See also