DeviceConfig

Central device and hardware configuration

Namespaces

 CloudMouse
 

Macros

#define PCB_VERSION   4
 
#define FIRMWARE_VERSION   "3.0.0-alpha"
 
#define WIFI_REQUIRED   true
 
#define GET_DEVICE_ID()   DeviceID::getDeviceID()
 
#define GET_DEVICE_UUID()   DeviceID::getDeviceUUID()
 
#define GET_AP_SSID()   DeviceID::getAPSSID()
 
#define GET_AP_PASSWORD()   DeviceID::getAPPasswordSecure()
 
#define WIFI_CONFIG_SERVICE   "http://192.168.4.1/"
 
#define DEVICE_MANUFACTURER   "Cloudmouse"
 

Macro Definition Documentation

◆ DEVICE_MANUFACTURER

#define DEVICE_MANUFACTURER   "Cloudmouse"

Device manufacturer

Applications:

  • Used for BLE connection setup

◆ FIRMWARE_VERSION

#define FIRMWARE_VERSION   "3.0.0-alpha"

Firmware Version String

Semantic versioning for firmware releases and compatibility tracking. Used for OTA update validation, diagnostic reporting, and version display.

Format: MAJOR.MINOR.PATCH-PRERELEASE

  • MAJOR: Breaking changes, incompatible API modifications
  • MINOR: New features, backward-compatible additions
  • PATCH: Bug fixes, security updates, minor improvements
  • PRERELEASE: alpha, beta, rc (release candidate)

Version History Integration:

  • Displayed in device information screens
  • Transmitted in diagnostic and telemetry data
  • Used by OTA update system for compatibility validation
  • Logged in system startup messages for debugging

◆ GET_AP_PASSWORD

#define GET_AP_PASSWORD ( )    DeviceID::getAPPasswordSecure()

Get Access Point Password

Returns
Secure password derived from device MAC address

Security Characteristics:

  • Generated from hardware MAC address for uniqueness
  • Sufficient complexity for WPA2/WPA3 protection
  • Consistent per device for user convenience
  • Cannot be easily guessed without device access

Note: Uses secure password generation (not the simple version)

◆ GET_AP_SSID

#define GET_AP_SSID ( )    DeviceID::getAPSSID()

Access Point Credential Generation

Provides device-specific WiFi Access Point configuration for setup mode. Credentials are derived from device hardware ID for security and uniqueness.

Security Features:

  • Unique SSID per device prevents conflicts in multi-device environments
  • Hardware-derived password provides reasonable security for setup process
  • Credentials remain consistent across firmware updates for user convenience Get Access Point SSID
Returns
Device-specific SSID (e.g., "CloudMouse-b126aaaf")

Format: "CloudMouse-{device_id}"

  • Clearly identifies device type and instance
  • Unique per device to prevent SSID conflicts
  • Human-readable for easy identification during setup

◆ GET_DEVICE_ID

#define GET_DEVICE_ID ( )    DeviceID::getDeviceID()

Device ID Generation Macros

Provides consistent device identification across all SDK modules. Based on ESP32 MAC address for hardware-tied unique identification.

Usage Pattern:

  • Use macros instead of direct DeviceID calls for consistency
  • Device ID remains constant across firmware updates
  • Unique per physical device for cloud service registration
  • Human-readable format for debugging and support Get unique device identifier string
Returns
Short device ID derived from MAC address (e.g., "b126aaaf")

Applications:

  • Device registration with cloud services
  • Local device identification in multi-device environments
  • Diagnostic logging and support ticket correlation
  • Default Access Point SSID generation

◆ GET_DEVICE_UUID

#define GET_DEVICE_UUID ( )    DeviceID::getDeviceUUID()

Get full device UUID string

Returns
Complete UUID for device (e.g., "CloudMouse-b126aaaf-uuid")

Applications:

  • Comprehensive device registration
  • Cloud service authentication
  • Inter-device communication identification
  • Detailed system logging and analytics

◆ PCB_VERSION

#define PCB_VERSION   4

PCB Hardware Version Selection

Critical configuration that affects power management logic and pin behavior. Must match the physical hardware to prevent damage from incorrect power sequencing.

Version Differences:

  • PCB v4: Inverted power enable logic (LOW = power on)
  • PCB v5: Normal power enable logic (HIGH = power on)

Affected Components:

  • Display power management (TFT_PWR pin behavior)
  • Potentially other power-controlled peripherals

IMPORTANT: Verify PCB version before deployment to prevent hardware damage

◆ WIFI_CONFIG_SERVICE

#define WIFI_CONFIG_SERVICE   "http://192.168.4.1/"

WiFi Configuration Service URL

Standard URL for web-based device configuration interface. Accessible when device is in Access Point mode for initial setup.

Service Features:

  • WiFi network selection and credential entry
  • Device configuration parameter adjustment
  • Firmware update initiation (if supported)
  • System status and diagnostic information

Access Method:

  1. Connect to device Access Point using credentials above
  2. Navigate to this URL in web browser
  3. Follow configuration wizard for setup completion

Technical Details:

  • Standard Access Point gateway address (192.168.4.1)
  • HTTP protocol for broad device compatibility
  • Captive portal detection for automatic redirection

◆ WIFI_REQUIRED

#define WIFI_REQUIRED   true

WiFi Requirement Flag

Determines whether WiFi connectivity is mandatory for device operation. Affects startup behavior and error handling for network failures.

true: Device requires WiFi for full operation (cloud features, updates) false: Device can operate offline (local-only functionality)

Impact on Behavior:

  • Startup sequence (WiFi initialization priority)
  • Error handling (network failure responses)
  • Feature availability (cloud vs local features)
  • Power management (WiFi radio control)