Dawn Framework 1.0
Universal data acquisition framework for embedded systems
lte_signal.hxx
1// dawn/include/dawn/io/lte_signal.hxx
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#pragma once
7
8#include "dawn/io/common.hxx"
9#include "dawn/io/timerfd.hxx"
10
11namespace dawn
12{
17enum
18{
24};
25
37 : public CIOCommon
38 , public CIOTimerfd
39{
40public:
43 enum
44 {
45 LTE_SIGNAL_CFG_FIRST = 0,
47 LTE_SIGNAL_CFG_LAST = 31
48 };
49
50 explicit CIOLteSignal(CDescObject &desc)
51 : CIOCommon(desc)
52 {
53 }
54
55#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
56 const char *getClassNameStr() const override
57 {
58 return "lte_signal";
59 }
60#endif
61
62 int configure() override;
63 int init() override;
64 int deinit() override;
65 int doStart() override;
66 int doStop() override;
67 int getDataImpl(IODataCmn &data, size_t len) override;
68
69 size_t getDataSize() const override;
70 size_t getDataDim() const override;
71
72#ifdef CONFIG_DAWN_IO_NOTIFY
73 int getFd() const override;
74#endif
75
76 bool isRead() const override
77 {
78 return true;
79 };
80
81 bool isWrite() const override
82 {
83 return false;
84 };
85
86 bool isNotify() const override
87 {
88#ifdef CONFIG_DAWN_IO_NOTIFY
89 return true;
90#else
91 return false;
92#endif
93 };
94
95 bool isBatch() const override
96 {
97 return false;
98 };
99
101
102 constexpr static SObjectId::ObjectId objectId(bool ts, uint16_t inst)
103 {
104 return ObjectIdHelper::create(ts, inst);
105 }
106
107 constexpr static SObjectCfg::ObjectCfgId cfgIdInterval(bool rw = false)
108 {
112 rw,
113 1,
115 }
116};
117} // Namespace dawn
Descriptor wrapper for individual object configuration.
Template helper for creating ObjectIDs for I/O types.
Definition common.hxx:255
static SObjectId::ObjectId create(bool ts, uint16_t inst)
Create ObjectID with default data type.
Definition common.hxx:265
Base class for all I/O objects.
Definition common.hxx:27
virtual int getFd() const
Get file descriptor for notifications.
Definition common.hxx:444
@ IO_CLASS_LTE_SIGNAL
LTE signal quality (RSRP/RSRQ/SINR/RSSI)
Definition common.hxx:203
LTE modem signal-quality I/O (read-only, timer-driven).
size_t getDataDim() const
Get data vector dimension.
int getDataImpl(IODataCmn &data, size_t len)
Get data implementation (override in derived classes).
size_t getDataSize() const
Get data size in bytes.
bool isNotify() const
Check if IO supports notifications.
bool isRead() const
Check if IO supports read operations.
@ LTE_SIGNAL_CFG_INTERVAL
Poll interval, microseconds (DTYPE_UINT32)
int configure()
Configure object from descriptor data.
int doStop()
Stop implementation hook.
bool isBatch() const
Check if IO supports batch operations.
bool isWrite() const
Check if IO supports write operations.
int doStart()
Start implementation hook.
int deinit()
De-initialize object.
int init()
One-time initialize object after bindings are resolved.
Internal helper for timer-based I/O notifications.
Definition timerfd.hxx:22
static ObjectCfgId objectCfg(uint8_t type, uint16_t cls, uint8_t dtype, bool rw, uint16_t size, uint8_t id)
Construct 32-bit ConfigID from component fields.
uint32_t ObjectCfgId
ConfigID type - single 32-bit value.
Definition objectcfg.hxx:60
Out-of-tree user-extension hooks for Dawn.
Definition bindable.hxx:13
@ DAWN_LTE_SIGNAL_DIM
Number of metrics in the vector.
@ DAWN_LTE_SIGNAL_RSRP
Reference Signal Received Power (dBm)
@ DAWN_LTE_SIGNAL_SINR
Signal to Interference + Noise Ratio (dB)
@ DAWN_LTE_SIGNAL_RSRQ
Reference Signal Received Quality (dB)
@ DAWN_LTE_SIGNAL_BAND
Serving E-UTRA band number.
@ OBJTYPE_IO
Input/Output object type.
Definition objectid.hxx:184
@ DTYPE_UINT32
Unsigned 32-bit integer (0 to 4294967295).
Definition objectid.hxx:96
uint32_t ObjectId
ObjectID type - single 32-bit value.
Definition objectid.hxx:44