Ser.Rxbuffrq Method

Top  Previous  Next

 

Function:

For the selected serial port (selection is made through ser.num) pre-requests "numpages" number of buffer pages (1 page= 256 bytes) for the RX buffer of the serial port.

Syntax:

ser.rxbuffrq(numpages as byte) as byte

Returns:

Actual number of pages that can be allocated (byte)

See Also:

Allocating Memory for Buffers, ser.txbuffrq

 


Part

Description

numpages

Requested numbers of buffer pages to allocate.

Details

Returns actual number of pages that can be allocated. Actual allocation happens when the sys.buffalloc method is used. The serial port is unable to RX data if its RX buffer has 0 capacity. Actual current buffer capacity can be checked through the ser.rxbuffsize which returns buffer capacity in bytes.

Relationship between the two is as follows: ser.rxbuffsize=num_pages*256-16 (or =0 when num_pages=0), where "num_pages" is the number of buffer pages that was GRANTED through the ser.rxbuffrq. "-16" is because 16 bytes are needed for internal buffer variables.

Buffer allocation will not work if the serial port to which this buffer belongs is opened (ser.enabled= 1- YES) at the time when sys.buffalloc executes. You can only change buffer sizes of ports that are closed.