Skip to main content

bluetooth.fifoinfo()

Returns information about the Bluetooth LE's FIFOs

Availability

Device (from impOS™ 38)
Currently available on the imp004m only

Returns

Table — Bluetooth LE FIFO details

Description

This method returns information about the FIFOs used to communicate with a Bluetooth LE-enabled imp’s Bluetooth sub-system.

It returns a table with the following keys:

  • rxfifo
  • txfifo
  • filteredfifo
  • advertfifo

The first two are related to the UART assigned for use by the bluetooth object when it is configured. filteredfifo and advertfifo are internal buffers whose sizes are chosen based on the UART RX FIFO size (set by the user before using Bluetooth; see [bluetooth.open()(/api/hardware/bluetooth/open)).

Each of the above keys’ value is itself a table, with the following keys:

Key Value Type Description
size Integer The size of the FIFO in bytes
fill Integer The number of bytes the FIFO currently contains
highwatermark Integer The maximum number of bytes the FIFO has ever contained

On boot, the value of highwatermark will be reset to zero. It will also be reset to zero if the FIFO is resized. This value, together with fill, can be used to help you determine whether the Bluetooth LE FIFOs are correctly sized. For instance, an imp may receive many Bluetooth LE adverts from nearby devices, not only the one(s) it is interested in connecting to. Receiving an advert from a specific device is not deterministic but statistical, so a large FIFO may be required in order to guarantee the imp receives a sufficient volume of adverts to be reasonably certain it has seen (or not) an advert from the target device. However, too large a FIFO can cause memory and performance issues, so it is handy to be able to examine FIFO utilization during testing; bluetooth.fifoinfo() makes this possible.