-
Notifications
You must be signed in to change notification settings - Fork 0
MiP
Signature: uint8_t FlagBits
Signature: constexpr uint8_t MIP_CMD_DISCONNECT_APP
MiP protocol command bytes related to core functions.
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.
Signature: constexpr uint8_t MIP_CMD_SLEEP
Signature: constexpr uint8_t MIP_CMD_GET_STATUS
Signature: constexpr uint8_t MIP_ERROR_NONE
Integer error codes that can be encountered by the MiP library.
Signature: constexpr uint8_t MIP_ERROR_TIMEOUT
Signature: constexpr uint8_t MIP_ERROR_NO_EVENT
Signature: constexpr uint8_t MIP_ERROR_BAD_RESPONSE
Signature: constexpr uint8_t MIP_ERROR_MAX_RETRIES
Signature: MiP_Battery battery
Signature: MiP_ChestLED chestLED
Signature: MiP_Clap clap
Signature: MiP_EEPROM eeprom
Signature: MiP_Gesture gesture
Signature: MiP_HeadLEDs headLEDs
Signature: MiP_Infrared infrared
Signature: MiP_Mode mode
Signature: MiP_Motion motion
Signature: MiP_Odometer odometer
Signature: MiP_Position position
Signature: MiP_Radar radar
Signature: MiP_Serial serial
Signature: MiP_Shake shake
Signature: MiP_Sound sound
Signature: MiP_Version version
Signature: MiP_Weight weight
Signature: MiP_Wifi wifi
Signature: class MiP_Battery
Signature: class MiP_ChestLED
Signature: class MiP_Clap
Signature: class MiP_EEPROM
Signature: class MiP_Gesture
Signature: class MiP_HeadLEDs
Signature: class MiP_Infrared
Signature: class MiP_Mode
Signature: class MiP_Motion
Signature: class MiP_Wifi
Signature: class MiP_Odometer
Signature: class MiP_Position
Signature: class MiP_Radar
Signature: class MiP_Serial
Signature: class MiP_Shake
Signature: class MiP_Sound
Signature: class MiP_Version
Signature: class MiP_Weight
Signature: uint8_t m_flags
Signature: int8_t m_lastError
Signature: MiPStatus m_lastStatus
Signature: MiP()
Signature: ~MiP()
Signature: bool begin()
Initializes the core UART connection to the MiP robot.
Details:
Attempts connection at both 115200 and 9600 baud rates with retries. Sets up debug output on Serial1 and prepares internal state.
Returns: true if successfully connected to MiP, false otherwise.
Signature: void end()
Cleans up the connection to MiP and shuts down network services.
Details:
Restores default volume, sends disconnect command, and ends Serial/WiFi/OTA.
Signature: void sleep()
Puts the MiP robot to sleep.
Details:
The robot will need to be physically reset before another begin() call.
Signature: bool isInitialized()
Check whether the MiP library has completed initialization.
Details:
Returns true when the internal initialization flag (MRI_FLAG_INITIALIZED) is set, indicating that begin() completed successfully and the MiP instance is ready for use. Returns false if initialization failed or has not yet been performed.
This accessor does not modify object state and has no side effects. Consider calling this before invoking API methods that require an active connection to the robot.
Returns: true if the MiP instance is initialized and ready; false otherwise.
Signature: int8_t lastCallResult()
Retrieves the error code from the most recently executed MiP API function.
Details:
The library automatically attempts to handle communication errors by retrying read/write operations behind the scenes. If an operation ultimately fails to recover, this function provides the specific reason for the failure. int8_t The error code generated by the last operation (e.g., MIP_ERROR_NONE, MIP_ERROR_TIMEOUT, MIP_ERROR_BAD_RESPONSE).
Returns: int8_t The error code generated by the last operation (e.g., MIP_ERROR_NONE, MIP_ERROR_TIMEOUT, MIP_ERROR_BAD_RESPONSE).
Signature: bool didLastCallFail()
Checks if the most recently executed MiP API function encountered a critical error.
Details:
A quick convenience method to determine if a command was successful without needing to evaluate the specific error code. true If the last operation failed (m_lastError is not MIP_ERROR_NONE).
false If the last operation succeeded.
Returns: true If the last operation failed (m_lastError is not MIP_ERROR_NONE).
Signature: void dispatchEvent(uint8_t command, const uint8_t *payload, size_t)
Central dispatcher for all Out-of-Band events from the transport layer.
Details:
This method receives raw event data and routes it to the appropriate subsystem component (Clap, Gesture, Status, etc.).
Signature: void printLastCallResult()
Prints a human-readable description of the last error to the debug channel (Serial1).
Signature: void clear()
Signature: int8_t attemptMiPConnection(uint32_t baudRate)
Signature: void mipAssert(bool condition, uint32_t lineNumber, const char *fileName)
Assert mechanism that logs the failure location and then halts.
Details:
Call it like this (no macro needed): mipAssert(condition, LINE, FILE);
The original macro version always printed the file that defined mipAssert (MPU_Core.cpp). Passing FILE from the call site fixes that.
Signature: int8_t rawGetStatus(MiPStatus &status)
Signature: int8_t parseStatus(MiPStatus &status, const uint8_t response[], size_t responseLength)
- MiP
- MiPChestLED
- MiPClapSettings
- MiPDebug
- MiPHardwareInfo
- MiPHeadLEDs
- MiPIRDongleCode
- MiPSoftwareVersion
- MiPStatus
- MiP_Battery
- MiP_ChestLED
- MiP_Clap
- MiP_EEPROM
- MiP_Gesture
- MiP_HeadLEDs
- MiP_Infrared
- MiP_Mode
- MiP_Motion
- MiP_Odometer
- MiP_Position
- MiP_Radar
- MiP_Serial
- MiP_Shake
- MiP_Sound
- MiP_Version
- MiP_Weight
- MiP_WiFi