Skip to main content

bluetooth.uartflags()

Returns event flags set by the previous Bluetooth LE UART transaction

Availability

Device
Only available on the imp004m and imp006 (impOS 42)

Returns

Integer — the UART transaction event flags bitfield

Description

This method allows you to monitor the UART over which the imp is communicating with its on-board Bluetooth LE module.

The integer returned by the method is a combination of values: each UART event flag represents a single bit in the returned value. At the moment, only two possible values will be returned by bluetooth.uartflags(): 0 or 32. The latter indicates an overrun error, which is remedied by closing the Bluetooth session (with bluetooth.close()) and then establishing a new session by calling bluetooth.open() once again.

Because of the need to establish a new Bluetooth session, bluetooth.uartflags() does not clear the event flag record when it is called.

Event Flag Constant Value Description
OK 0 Communication was successful
OVERRUN_ERROR 32 An over-run error occurred, ie. the receive buffer was full when another character arrived

The values assigned to the constants may change in a future impOS™ release.