REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
ping.h
Go to the documentation of this file.
1// Copyright (c) 2024 anabrid GmbH
2// Contact: https://www.anabrid.com/licensing/
3//
4// SPDX-License-Identifier: MIT OR GPL-2.0-or-later
5
6#pragma once
7
8#include "protocol/handler.h"
9#include "utils/error.h"
10
11namespace msg {
12namespace handlers {
13
15class PingRequestHandler : public MessageHandler {
16public:
17 utils::status replyWithObject(const Request& req, JsonObject &msg_out) override {
18 // msg_out["now"] = "2007-08-31T16:47+01:00";
19 // Note, with some initial NTP call we could get micro-second time resolution if we need it
20 // for whatever reason.
21 msg_out["micros"] = micros();
22
23 return utils::status::success();
24 }
25};
26
27} // namespace handlers
28
29} // namespace msg
utils::status replyWithObject(const Request &req, JsonObject &msg_out) override
Definition ping.h:17
Definition carrier.h:10