Update docs and fix bugs (#149)

Improved the docs for the 3 main Tactility projects. I also fixed some inaccuracies and bugs in certain APIs as I went through the code.
This commit is contained in:
Ken Van Hoeylandt
2025-01-07 20:45:23 +01:00
committed by GitHub
parent ff4287e2ce
commit 415096c3b2
62 changed files with 503 additions and 517 deletions
@@ -39,7 +39,7 @@ void ScreenshotService::startApps(const char* path) {
}
}
void ScreenshotService::startTimed(const char* path, uint8_t delay_in_seconds, uint8_t amount) {
void ScreenshotService::startTimed(const char* path, uint8_t delayInSeconds, uint8_t amount) {
auto scoped_lockable = mutex.scoped();
if (!scoped_lockable->lock(50 / portTICK_PERIOD_MS)) {
TT_LOG_W(TAG, LOG_MESSAGE_MUTEX_LOCK_FAILED);
@@ -49,7 +49,7 @@ void ScreenshotService::startTimed(const char* path, uint8_t delay_in_seconds, u
if (task == nullptr || task->isFinished()) {
task = std::make_unique<ScreenshotTask>();
mode = ScreenshotModeTimed;
task->startTimed(path, delay_in_seconds, amount);
task->startTimed(path, delayInSeconds, amount);
} else {
TT_LOG_W(TAG, "Screenshot task already running");
}
@@ -16,8 +16,10 @@ typedef enum {
ScreenshotModeApps
} Mode;
class ScreenshotService {
private:
Mutex mutex;
std::unique_ptr<ScreenshotTask> task;
Mode mode = ScreenshotModeNone;
@@ -25,9 +27,23 @@ class ScreenshotService {
public:
bool isTaskStarted();
/** The state of the service. */
Mode getMode();
/** @brief Start taking screenshot whenever an app is started
* @param[in] path the path to store the screenshots at
*/
void startApps(const char* path);
void startTimed(const char* path, uint8_t delay_in_seconds, uint8_t amount);
/** @brief Start taking screenshots after a certain delay
* @param[in] path the path to store the screenshots at
* @param[in] delayInSeconds the delay before starting (and between successive screenshots)
* @param[in] amount 0 = indefinite, >0 for a specific
*/
void startTimed(const char* path, uint8_t delayInSeconds, uint8_t amount);
/** @brief Stop taking screenshots */
void stop();
};
@@ -35,22 +35,18 @@ public:
~ScreenshotTask();
/** @brief Start taking screenshots after a certain delay
* @param task the screenshot task
* @param path the path to store the screenshots at
* @param delay_in_seconds the delay before starting (and between successive screenshots)
* @param amount 0 = indefinite, >0 for a specific
* @param[in] path the path to store the screenshots at
* @param[in] delayInSeconds the delay before starting (and between successive screenshots)
* @param[in] amount 0 = indefinite, >0 for a specific
*/
void startTimed(const char* path, uint8_t delay_in_seconds, uint8_t amount);
void startTimed(const char* path, uint8_t delayInSeconds, uint8_t amount);
/** @brief Start taking screenshot whenever an app is started
* @param task the screenshot task
* @param path the path to store the screenshots at
* @param[in] path the path to store the screenshots at
*/
void startApps(const char* path);
/** @brief Stop taking screenshots
* @param task the screenshot task
*/
/** @brief Stop taking screenshots */
void stop();
void taskMain();