-
Notifications
You must be signed in to change notification settings - Fork 0
MiP_Serial
Manages low-level UART transport and Out-Of-Band (OOB) event demultiplexing.
Handles serial transmission delays, command-response pairing, hex-ASCII parsing, and dispatching asynchronous event notifications received from MiP.
Signature: void rawSend(const uint8_t request[], size_t requestLength)
Summary: Sends a raw command buffer to MiP without waiting for a response (fire-and-forget).
Details:
Used internally by non-verified commands and higher-level driver methods. Enforces the minimum MIP_REQUEST_DELAY before writing data to the hardware serial port.
Parameters:
| Parameter | Description |
|---|---|
request |
Pointer to the array of command bytes to transmit. |
requestLength |
Number of bytes in the request array. |
Signature: uint8_t rawReceive(const uint8_t request[], size_t requestLength, uint8_t responseBuffer[], size_t responseBufferSize, size_t &responseLength)
Summary: Sends a raw command and blocks until the expected response is received or times out.
Details:
Transmits the request buffer over UART, waits for the corresponding command response byte, converts incoming hex-ASCII payload characters to binary, and populates the response buffer.
Parameters:
| Parameter | Description |
|---|---|
request |
Pointer to the array of command bytes to transmit. |
requestLength |
Number of bytes in the request array. |
responseBuffer |
Pointer to the buffer where the received response will be stored. |
responseBufferSize |
Maximum capacity of the response buffer in bytes. |
responseLength |
Receives the actual number of bytes written into responseBuffer. |
Returns: uint8_t MIP_ERROR_NONE on success, or MIP_ERROR_TIMEOUT on response timeout.
Signature: bool processAllResponseData()
Summary: Reads and processes all incoming data available in the hardware serial receive buffer.
Details:
Decodes incoming hex-ASCII command pairs. If the command byte matches an expected synchronous response, it populates the response buffer. Otherwise, it treats the data as an Out-Of-Band (OOB) notification and dispatches it to MiP::dispatchEvent().
Returns: true if the expected synchronous response was found during buffer processing, false otherwise.
Signature: constexpr uint8_t MIP_MAX_RETRIES
Summary: Maximum number of retry attempts for verified read and write operations.
Signature: constexpr uint16_t MIP_RETRY_WAIT
Summary: Duration in milliseconds to wait between retry attempts.
🔗 Quick Links: Main Repository • Report an Issue • Wiki Home
An open-source API for the WowWee MiP Robot. Licensed under Apache-2.0.
- 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