Skip to content

MiP_Radar

github-actions[bot] edited this page Aug 10, 2026 · 10 revisions

Class MiP_Radar

Manages MiP's radar system.

Public Members & Functions

MIP_CMD_GET_GESTURE_RADAR_MODE

Signature: constexpr uint8_t MIP_CMD_GET_GESTURE_RADAR_MODE

MiP protocol command bytes used by the radar subsystem.

Details:

These values are placed in the first byte of requests sent to the MiP (and appear in the corresponding responses). See the official MiP BLE Protocol for the complete list.


MIP_CMD_SET_GESTURE_RADAR_MODE

Signature: constexpr uint8_t MIP_CMD_SET_GESTURE_RADAR_MODE


MIP_CMD_GET_RADAR_RESPONSE

Signature: constexpr uint8_t MIP_CMD_GET_RADAR_RESPONSE


MiP_Radar

Signature: MiP_Radar(MiP &mip)

Constructs the radar manager.

Parameters:

Parameter Description
mip A reference to the main MiP object to access core services.

clear

Signature: void clear()


enable

Signature: void enable()

Enables radar tracking mode on the MiP.

Details:

Uses verified mode switching (command + read-back confirmation with retry).


disable

Signature: void disable()

Disables radar tracking mode.

Details:

Uses verified mode switching (command + read-back confirmation with retry).


isEnabled

Signature: bool isEnabled()

Checks whether radar tracking mode is currently active.

Returns: true if radar mode is enabled.


read

Signature: MiPRadar read()

Reads the most recent radar tracking data.

Details:

Uses cached value from the latest OOB status event. Processes pending serial data first.

Returns: Current radar value or MIP_RADAR_INVALID if no data received yet.


processEvent

Signature: void processEvent(uint8_t radarCode)

Handles an incoming radar OOB event from the transport layer.

Details:

Called by MiP::dispatchEvent() when a MIP_CMD_GET_RADAR_RESPONSE notification is received. Updates the cached distance and marks the radar data as valid.

Parameters:

Parameter Description
radarCode Raw distance code from the MiP (MIP_RADAR_NONE .. MIP_RADAR_0CM_10CM).

Clone this wiki locally