Nol.A SDK Library 26.11.2
For IoT System Software Development
Loading...
Searching...
No Matches
VC0706 Class Reference

Asynchronous UART JPEG camera with timer-driven command handling. Call begin() before commands and keep the driver/UART alive during callbacks. Commands share a state machine; do not overlap capture and command sequences. More...

#include <VC0706.hpp>

Public Member Functions

 VC0706 (SerialPort &, uint8_t compRatio=0xFF)
 Bind the UART and initial compression byte (default 0xFF).
void begin ()
 Start the UART at 38400 baud and install the asynchronous receive handler.
void getVer ()
 Request the version; the response is printed by the receive handler.
void takePicture (void(*func)(void *, const char *buf, uint32_t size), void *arg)
 Begin an asynchronous JPEG capture when idle.
void stopFrame ()
 Freeze the frame and start the internal length/image retrieval sequence.
void getLen ()
 Request frozen-frame length as part of the capture state machine.
void getImage ()
 Allocate a JPEG buffer and request image bytes after length retrieval.
void reset ()
 Discard pending UART bytes and send an asynchronous reset command.
void startCapture (uint16_t cycle, void(*func)(void *, bool)=nullptr, void *arg=nullptr)
 Enter motion-status capture mode with optional periodic polling.
void endCapture ()
 Stop periodic capture polling and reset the parser to idle.
void setMotionCtrl (uint8_t len, uint8_t motionAttribute, uint8_t ctrlItme, uint8_t secondBit, uint8_t thirdBit=0)
 Send raw motion-control settings.
void sendData (char *args, uint8_t Len)
 Write Len raw command bytes from args to the UART.
void recoverFrame (void(*func)(void *, bool)=nullptr, void *arg=nullptr)
 Resume frame acquisition asynchronously.
void checkMotionStatus ()
 Send a motion-status query, normally used while startCapture() is active.
void restart ()
 Reset the local parser to idle and resend the current compression ratio.

Public Attributes

uint8_t ratio
 Desired compression byte applied by the next capture or restart().

Detailed Description

Asynchronous UART JPEG camera with timer-driven command handling. Call begin() before commands and keep the driver/UART alive during callbacks. Commands share a state machine; do not overlap capture and command sequences.

Member Function Documentation

◆ recoverFrame()

void VC0706::recoverFrame ( void(* func )(void *, bool) = nullptr,
void * arg = nullptr )

Resume frame acquisition asynchronously.

Parameters
funcOptional callback receiving arg and success; timeout reports false.
argUser context passed to the callback.

◆ setMotionCtrl()

void VC0706::setMotionCtrl ( uint8_t len,
uint8_t motionAttribute,
uint8_t ctrlItme,
uint8_t secondBit,
uint8_t thirdBit = 0 )

Send raw motion-control settings.

Parameters
lenCommand argument length byte.
motionAttributeCamera motion attribute selector.
ctrlItmeCamera control-item selector; 1 sends both payload bytes.
secondBitFirst motion-control payload byte.
thirdBitSecond payload byte, used for control item 1.

◆ startCapture()

void VC0706::startCapture ( uint16_t cycle,
void(* func )(void *, bool) = nullptr,
void * arg = nullptr )

Enter motion-status capture mode with optional periodic polling.

Parameters
cyclePoll interval in milliseconds; zero disables automatic polling.
funcOptional callback receiving arg and true on a detected capture event.
argUser callback context. The stored callback is consumed on notification.

◆ takePicture()

void VC0706::takePicture ( void(* func )(void *, const char *buf, uint32_t size),
void * arg )

Begin an asynchronous JPEG capture when idle.

Parameters
funcReceives arg, JPEG bytes, and byte count; failure paths can report nullptr and zero. The image buffer is valid only during the callback.
argUser context passed to func. A request while busy resets the camera instead of queuing another capture.

The documentation for this class was generated from the following file: