herald  2.0.0
proximity.h
1 // Copyright 2020-2021 Herald Project Contributors
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #ifndef HERALD_PROXIMITY_H
6 #define HERALD_PROXIMITY_H
7 
8 #include <string>
9 
10 namespace herald {
11 namespace datatype {
12 
13 enum class ProximityMeasurementUnit : short {
14  RSSI, RTT
15 };
16 
17 struct Proximity {
18  ProximityMeasurementUnit unit;
19  double value;
20 
21  std::string description() const noexcept {
22  return std::to_string((short)unit) + ":" + std::to_string(value);
23  }
24 
25  operator std::string() const noexcept {
26  return description();
27  }
28 };
29 
30 
31 } // end namespace
32 } // end namespace
33 
34 #endif
Acts as a non-global memory arena for arbitrary classes.
Definition: aggregates.h:15
Definition: proximity.h:17