mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-15 00:46:31 +02:00
Merge pull request #66 from airgradienthq/feature/add-mdns-attributes
Add mDNS attribute
This commit is contained in:
@ -40,3 +40,7 @@ BoardType AirGradient::getBoardType(void) { return boardType; }
|
||||
double AirGradient::round2(double value) {
|
||||
return (int)(value * 100 + 0.5) / 100.0;
|
||||
}
|
||||
|
||||
String AirGradient::getBoardName(void) {
|
||||
return String(getBoardDefName(boardType));
|
||||
}
|
||||
|
@ -107,6 +107,13 @@ public:
|
||||
*/
|
||||
String getVersion(void);
|
||||
|
||||
/**
|
||||
* @brief Get the Board Name object
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
String getBoardName(void);
|
||||
|
||||
/**
|
||||
* @brief Round double value with for 2 decimal
|
||||
*
|
||||
|
@ -335,6 +335,19 @@ const BoardDef *getBoardDef(BoardType def) {
|
||||
return &bsps[def];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the Board Name
|
||||
*
|
||||
* @param type BoarType
|
||||
* @return const char*
|
||||
*/
|
||||
const char *getBoardDefName(BoardType type) {
|
||||
if (type >= _BOARD_MAX) {
|
||||
return NULL;
|
||||
}
|
||||
return bsps[type].name;
|
||||
}
|
||||
|
||||
#if defined(ESP8266)
|
||||
#define bspPrintf(c, ...) \
|
||||
if (_debug != nullptr) { \
|
||||
|
@ -83,6 +83,7 @@ struct BoardDef {
|
||||
};
|
||||
|
||||
const BoardDef *getBoardDef(BoardType def);
|
||||
const char *getBoardDefName(BoardType type);
|
||||
void printBoardDef(Stream *_debug);
|
||||
|
||||
#endif /** _AIR_GRADIENT_BOARD_DEF_H_ */
|
||||
|
Reference in New Issue
Block a user