Skip to content

MiP_Infrared

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

Class MiP_Infrared

Manages MiP's infrared system.

Table of Contents


Constructors & Destructors

MiP_Infrared

Signature: MiP_Infrared(MiP &mip)

Summary: Constructs the infrared manager.

Parameters:

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

Public Functions

enableMiPDetectionMode

Signature: void enableMiPDetectionMode(uint8_t id, uint8_t txPower)

Summary: Enables MiP detection mode (allows detecting other MiPs via IR).

Parameters:

Parameter Description
id Unique ID for this MiP (used in detection events).
txPower Transmit power level (1-120).

disableMiPDetectionMode

Signature: void disableMiPDetectionMode()

Summary: Disables MiP detection mode.


isMiPDetectionModeEnabled

Signature: bool isMiPDetectionModeEnabled()

Summary: Checks if MiP detection mode is currently enabled.

Returns: true if detection mode is active.


readDetectedMiP

Signature: uint8_t readDetectedMiP()

Summary: Reads the next detected MiP event.

Details:

Processes pending serial data first.

Returns: ID of the detected MiP, or 0 if none available.


availableDetectedMiPEvents

Signature: uint8_t availableDetectedMiPEvents()

Summary: Returns the number of unread detected MiP events.

Details:

Processes pending serial data first.

Returns: Number of available detection events.


enableRemoteControl

Signature: void enableRemoteControl()

Summary: Enables IR remote control mode.

Details:

Verified operation (command + read-back with retry).


disableRemoteControl

Signature: void disableRemoteControl()

Summary: Disables IR remote control mode.

Details:

Verified operation (command + read-back with retry).


isRemoteControlEnabled

Signature: bool isRemoteControlEnabled()

Summary: Checks if IR remote control mode is enabled.

Returns: true if IR remote control is active.


sendDongleCode

Signature: void sendDongleCode(const MiPIRDongleCode &irCode, uint8_t transmitPower)

Summary: Transmits a 2-, 3-, or 4-byte IR dongle code (fire and forget).

Details:

No verification is performed as there is no reliable feedback mechanism.

Parameters:

Parameter Description
irCode Struct containing code value and byte length (2, 3, or 4).
transmitPower Transmit power level (1-120).

sendDongleCode

Signature: void sendDongleCode(uint32_t code, uint8_t length, uint8_t transmitPower)

Summary: Transmits a variable-length IR dongle code using direct values.

Parameters:

Parameter Description
code Up to 32-bit IR code value.
length Code length in bytes (2, 3, or 4).
transmitPower Transmit power level (1-120).

readDongleCode

Signature: MiPIRDongleCode readDongleCode()

Summary: Reads the next received IR dongle code from the queue.

Returns: MiPIRDongleCode struct containing the code and its byte length. Returns an empty struct (length = 0) if no event is available.


availableCodeEvents

Signature: uint8_t availableCodeEvents()

Summary: Returns the number of unread IR dongle code events.

Details:

Processes pending serial data first.

Returns: Number of available IR code events.


processEvent

Signature: void processEvent(uint8_t command, const uint8_t *payload, size_t length)


Public Variables

MIP_CMD_RECEIVE_IR_DONGLE_CODE

Signature: constexpr uint8_t MIP_CMD_RECEIVE_IR_DONGLE_CODE

Summary: MiP protocol command bytes used by the infrared 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_GET_DETECTED_MIP

Signature: constexpr uint8_t MIP_CMD_GET_DETECTED_MIP


MIP_CMD_SET_DETECTION_MODE

Signature: constexpr uint8_t MIP_CMD_SET_DETECTION_MODE


MIP_CMD_SET_IR_REMOTE_CONTROL

Signature: constexpr uint8_t MIP_CMD_SET_IR_REMOTE_CONTROL


MIP_CMD_GET_IR_REMOTE_CONTROL

Signature: constexpr uint8_t MIP_CMD_GET_IR_REMOTE_CONTROL


MIP_CMD_SEND_IR_DONGLE_CODE

Signature: constexpr uint8_t MIP_CMD_SEND_IR_DONGLE_CODE


MIP_IR_DETECTION_MODE_DISABLE

Signature: constexpr uint8_t MIP_IR_DETECTION_MODE_DISABLE

Summary: Infrared mode definitions.


MIP_IR_REMOTE_CONTROL_DISABLE

Signature: constexpr uint8_t MIP_IR_REMOTE_CONTROL_DISABLE


MIP_IR_REMOTE_CONTROL_ENABLE

Signature: constexpr uint8_t MIP_IR_REMOTE_CONTROL_ENABLE


Clone this wiki locally