295abb37ee
Firmware for an autonomous wave-measurement buoy (ATmega2560-based WII5 v2 board). Reads wave motion from a Sparton AHRS-M1/M2 IMU, samples GPS and battery state, and reports back over Iridium SBD satellite telemetry. Originally developed 2012-2024. This is the first public release. Code, documentation, and field-tested operating modes (Capture, Sleep, Position, ManualTest, SelfTest, LowBattery) are licensed under Apache 2.0 — see LICENSE and NOTICE. See README.md for an overview and build instructions, CONTRIBUTING.md for how to contribute, and DEPLOYMENTS.md for the field-deployment log.
57 lines
1.6 KiB
C++
57 lines
1.6 KiB
C++
// SPDX-License-Identifier: Apache-2.0
|
|
// Copyright (c) 2012-2024 Scott Penrose <scottp@dd.com.au> and WII5 Buoy contributors
|
|
//
|
|
// This file is part of WII5 Buoy firmware.
|
|
// See LICENSE for full terms.
|
|
|
|
/**
|
|
* @file WII5Strings.h
|
|
* @brief String-formatting helpers: strDriver, strStatus, strError, etc.
|
|
*/
|
|
|
|
#ifndef WII5Strings_h
|
|
#define WII5Strings_h
|
|
|
|
#include <WII5.h>
|
|
#include <WII5Strings.h>
|
|
|
|
class WII5Strings {
|
|
public:
|
|
WII5Strings() {}
|
|
virtual WII5_CONTROLLERS controllerId() {return WII5CONTROLLER_STRINGS;}
|
|
WII5_COMMANDS parseCommand(char *in1, char *in2 = NULL, char *in3 = NULL);
|
|
WII5_DEVICES parseDevice(char *in);
|
|
WII5_DRIVERS parseDriver(char *in);
|
|
WII5_PORTS parsePort(char *in);
|
|
WII5GPS_MODES parseGPSMode(char *in);
|
|
WII5_SWITCH parseSwitch(char *in);
|
|
WII5_MODES parseMode(char *in);
|
|
|
|
// char* strDevice();
|
|
char* strCommand(WII5_COMMANDS c);
|
|
char* strDevice(WII5_DEVICES d);
|
|
char* strDriver(WII5_DRIVERS d);
|
|
char* strPort(WII5_PORTS p);
|
|
char* strStatus(WII5_STATUS s);
|
|
char* strError(WII5_ERRORS e);
|
|
char* strSwitch(WII5_SWITCH s);
|
|
char* strGPSMode(WII5GPS_MODES m);
|
|
char* strPinMode(uint8_t p);
|
|
char* strState(uint8_t p);
|
|
char* strMode(WII5_MODES p);
|
|
char* strPinArduinoName(uint8_t p);
|
|
char* strPinWII5Name(uint8_t p);
|
|
char* strSelfTestStatus(WII5SELFTEST_STATUS in);
|
|
char* strSelfTestStatusLong(WII5SELFTEST_STATUS in);
|
|
char* strSelfTestDevice(WII5SELFTEST_DEVICES in);
|
|
|
|
protected:
|
|
// TODO - remove anything hard coded
|
|
// TODO - use protected memory - strncpy et al
|
|
void setBufferUnknown();
|
|
};
|
|
|
|
extern WII5Strings wii5Strings;
|
|
|
|
#endif
|