Reads a string of characters from the serial port
Device (from impOS™ 30)
Name | Type | Description |
---|---|---|
numberOfChars | integer |
Optional number of characters to read (default = 80)
|
This method reads a specified numbers of bytes from the UART’s receive FIFO and returns them as a string. If you do not specify the number of characters you require — the numberOfChars parameter is optional — the method returns all of the available bytes as characters up to the size of the FIFO itself. By default, the receive FIFO is set at 80 characters is size. However, under impOS™ Release 32 and up, the size of the FIFO may be altered using uart.setrxfifosize().
If fewer characters than requested are available, the method will return a shorter string containing as many characters as there were bytes in the FIFO. If no data is available, it will return an empty string, ""
.
The method does not block.