Native test suite (61 tests, 5 suites) with thin mock layer for Arduino/FreeRTOS/esp_timer enabling host-side testing without hardware. ASCOM Alpaca REST API on port 32323 with UDP discovery, implementing Telescope v3 interface for N.I.N.A., PHD2, and compatible software. Follows existing ST4WiFi conditional compilation pattern. README documents wiring, all three protocols (serial, WebSocket, Alpaca), pin/rate configuration, and build instructions.
25 lines
786 B
C++
25 lines
786 B
C++
// esp_timer mock for native testing
|
|
#pragma once
|
|
#include "freertos/FreeRTOS.h"
|
|
|
|
namespace MockState { extern int64_t mockTimeMicros; }
|
|
|
|
typedef void (*esp_timer_cb_t)(void* arg);
|
|
|
|
struct esp_timer_create_args_t {
|
|
esp_timer_cb_t callback;
|
|
void* arg;
|
|
const char* name;
|
|
};
|
|
|
|
typedef void* esp_timer_handle_t;
|
|
|
|
inline int64_t esp_timer_get_time() { return MockState::mockTimeMicros; }
|
|
inline esp_err_t esp_timer_create(const esp_timer_create_args_t*, esp_timer_handle_t* out) {
|
|
*out = (void*)0x1;
|
|
return ESP_OK;
|
|
}
|
|
inline esp_err_t esp_timer_start_once(esp_timer_handle_t, uint64_t) { return ESP_OK; }
|
|
inline esp_err_t esp_timer_stop(esp_timer_handle_t) { return ESP_OK; }
|
|
inline esp_err_t esp_timer_delete(esp_timer_handle_t) { return ESP_OK; }
|