Dawn Framework 1.0
Universal data acquisition framework for embedded systems
uuid.hxx
1// dawn/include/dawn/io/uuid.hxx
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#pragma once
7
8#include "dawn/io/common.hxx"
9#include "dawn/porting/config.hxx"
10
11namespace dawn
12{
21class CIOUuid : public CIOCommon
22{
23public:
24 explicit CIOUuid(CDescObject &desc)
25 : CIOCommon(desc)
26 {
27 }
28
29 ~CIOUuid() override = default;
30
31#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
32 const char *getClassNameStr() const override
33 {
34 return "uuid";
35 }
36#endif
37
38 int init() override;
39 int getDataImpl(IODataCmn &data, size_t len) override;
40 int setDataImpl(IODataCmn &data) override;
41 size_t getDataSize() const override;
42 size_t getDataDim() const override;
43
44 bool isRead() const override
45 {
46 return true;
47 };
48
49 bool isWrite() const override
50 {
51 return false;
52 };
53
54 bool isNotify() const override
55 {
56 return false;
57 };
58
59 bool isBatch() const override
60 {
61 return false;
62 };
63
64 constexpr static SObjectId::ObjectId objectId(uint8_t instance)
65 {
69 instance,
70 CONFIG_BOARDCTL_UNIQUEID_SIZE);
71 }
72};
73} // Namespace dawn
Descriptor wrapper for individual object configuration.
Base class for all I/O objects.
Definition common.hxx:27
@ IO_CLASS_SYSTEM_UUID
UUID.
Definition common.hxx:156
System UUID I/O providing unique device identifier.
Definition uuid.hxx:22
int getDataImpl(IODataCmn &data, size_t len)
Get data implementation (override in derived classes).
Definition uuid.cxx:28
bool isNotify() const
Check if IO supports notifications.
Definition uuid.hxx:54
int init()
One-time initialize object after bindings are resolved.
Definition uuid.cxx:12
bool isRead() const
Check if IO supports read operations.
Definition uuid.hxx:44
bool isWrite() const
Check if IO supports write operations.
Definition uuid.hxx:49
size_t getDataSize() const
Get data size in bytes.
Definition uuid.cxx:62
int setDataImpl(IODataCmn &data)
Set data implementation (override in derived classes).
Definition uuid.cxx:55
bool isBatch() const
Check if IO supports batch operations.
Definition uuid.hxx:59
size_t getDataDim() const
Get data vector dimension.
Definition uuid.cxx:23
Out-of-tree user-extension hooks for Dawn.
Definition bindable.hxx:13
Base interface for I/O data buffers (static and dynamic).
Definition idata.hxx:21
@ OBJTYPE_IO
Input/Output object type.
Definition objectid.hxx:184
@ DTYPE_UINT8
Unsigned 8-bit integer (0 to 255).
Definition objectid.hxx:80
uint32_t ObjectId
ObjectID type - single 32-bit value.
Definition objectid.hxx:44
static ObjectId objectId(uint8_t type, uint16_t cls, uint8_t dtype, uint8_t flags, uint16_t priv)
Construct 32-bit ObjectID from component fields.
Definition objectid.hxx:290