6#include "dawn/proto/shell/pretty.hxx"
7#include "dawn/dev/shutdown.hxx"
18#include "dawn/io/common.hxx"
19#include "dawn/io/sdata.hxx"
20#include "dawn/prog/common.hxx"
21#include "system/readline.h"
23#ifdef CONFIG_DAWN_PROTO_SHELL_INSPECT
24# include "dawn/dev/inspector.hxx"
28using namespace std::chrono_literals;
30#define DAWN_PROTO_SHELL_LINELEN 64
31#define SHELLPRINT printf
33#define GETANDPRINT_DIM_MAX 128
34#define SHELL_SEEK_CHUNK_SIZE 64
35#define SHELL_SEEK_LINE_BYTES 16
40static bool parseU32Token(
const char *token, uint32_t *out)
43 char *endptr =
nullptr;
45 if (token ==
nullptr || out ==
nullptr || *token ==
'\0')
50 parsed = strtoul(token, &endptr, 0);
51 if (*endptr !=
'\0' || parsed > UINT32_MAX)
56 *out =
static_cast<uint32_t
>(parsed);
61static void printTypedDataHelper(FILE *outstream,
68#ifdef CONFIG_DAWN_IO_TIMESTAMP
71 fprintf(outstream,
" ts:%" PRId64
" ", ts);
75 for (
size_t i = 0; i < ddim; i++)
77 fprintf(outstream, fmt, data_ptr[i]);
81#ifdef CONFIG_DAWN_DTYPE_CHAR
82static void printCharDataHelper(FILE *outstream,
88# ifdef CONFIG_DAWN_IO_TIMESTAMP
91 fprintf(outstream,
" ts:%" PRId64
" ", ts);
95 for (
size_t i = 0; i < ddim; i++)
97 if (data_ptr[i] ==
'\0')
102 fprintf(outstream,
"%c", data_ptr[i]);
108static bool getAndPrintTyped(FILE *outstream,
CIOCommon *io,
size_t ddim,
const char *fmt)
113 fprintf(outstream,
"Data dimension %zu exceeds buffer size %zu\n", ddim, data.
getItems());
117 int ret = io->
getData(data, 1);
120 fprintf(outstream,
"getio failed %d\n", ret);
124 printTypedDataHelper<T>(outstream, io, ddim, fmt, &data(0), data[0]);
128#ifdef CONFIG_DAWN_DTYPE_CHAR
129static bool getAndPrintChar(FILE *outstream,
CIOCommon *io,
size_t ddim)
134 fprintf(outstream,
"Data dimension %zu exceeds buffer size %zu\n", ddim, data.
getItems());
138 int ret = io->
getData(data, 1);
141 fprintf(outstream,
"getio failed %d\n", ret);
145 printCharDataHelper(outstream, io, ddim, &data(0), data[0]);
150#ifdef CONFIG_DAWN_IO_NOTIFY
151int CProtoShellPretty::notifierCb(
void *priv,
io_ddata_t *data)
157 DAWNERR(
"NULL io pointer in notifier callback\n");
167# ifdef CONFIG_DAWN_IO_TIMESTAMP
175# ifdef CONFIG_DAWN_DTYPE_BOOL
177 printTypedDataHelper<bool>(
outstream_, io, ddim,
"%" PRId8
" ", &data->
get<
bool>(0), ts);
181# ifdef CONFIG_DAWN_DTYPE_INT8
183 printTypedDataHelper<int8_t>(
184 outstream_, io, ddim,
"%" PRId8
" ", &data->
get<int8_t>(0), ts);
188# ifdef CONFIG_DAWN_DTYPE_UINT8
190 printTypedDataHelper<uint8_t>(
191 outstream_, io, ddim,
"%" PRId8
" ", &data->
get<uint8_t>(0), ts);
195# ifdef CONFIG_DAWN_DTYPE_INT16
197 printTypedDataHelper<int16_t>(
198 outstream_, io, ddim,
"%" PRId16
" ", &data->
get<int16_t>(0), ts);
202# ifdef CONFIG_DAWN_DTYPE_UINT16
204 printTypedDataHelper<uint16_t>(
205 outstream_, io, ddim,
"%" PRId16
" ", &data->
get<uint16_t>(0), ts);
209# ifdef CONFIG_DAWN_DTYPE_INT32
211 printTypedDataHelper<int32_t>(
212 outstream_, io, ddim,
"%" PRId32
" ", &data->
get<int32_t>(0), ts);
216# ifdef CONFIG_DAWN_DTYPE_UINT32
218 printTypedDataHelper<uint32_t>(
219 outstream_, io, ddim,
"%" PRId32
" ", &data->
get<uint32_t>(0), ts);
223# ifdef CONFIG_DAWN_DTYPE_UINT64
225 printTypedDataHelper<uint64_t>(
226 outstream_, io, ddim,
"%" PRId64
" ", &data->
get<uint64_t>(0), ts);
230# ifdef CONFIG_DAWN_DTYPE_FLOAT
232 printTypedDataHelper<float>(
outstream_, io, ddim,
"%.4f ", &data->
get<
float>(0), ts);
236# ifdef CONFIG_DAWN_DTYPE_CHAR
238 printCharDataHelper(
outstream_, io, ddim, &data->
get<
char>(0), ts);
243 fprintf(
outstream_,
"missing print support for dtype=%d\n", dtype);
253int CProtoShellPretty::configureDesc(
const CDescObject &desc)
258 for (
size_t i = 0; i < desc.
getSize(); i++)
264 DAWNERR(
"Unsupported Shell config 0x%08" PRIx32
"\n", item->
cfgid.
v);
272 const size_t wpe =
sizeof(SProtoShellIOBind) / 4;
277 const SProtoShellIOBind *tmp =
278 reinterpret_cast<SProtoShellIOBind *
>(item->
data + j * wpe);
280 allocObject(tmp->objid);
288 path =
reinterpret_cast<const char *
>(&item->
data);
294 const char *tmp =
reinterpret_cast<const char *
>(&item->
data);
301 DAWNERR(
"Unsupported Shell config 0x%08" PRIx32
"\n", item->
cfgid.
v);
312 DAWNINFO(
"allocate object 0x%" PRIx32
"\n", obj.
v);
319void CProtoShellPretty::setPrompt(
const char *p)
324void CProtoShellPretty::getAndPrintSeek(
CIOCommon *io)
const
332 fprintf(
outstream_,
"IO 0x%" PRIx32
" seekable data (%zu bytes):\n", objid, total);
335 if (chunk ==
nullptr)
341 while (offset < total)
348 ret = io->
getData(*chunk, 1, offset);
351 fprintf(
outstream_,
"getio seek failed at offset %zu: %d\n", offset, ret);
355 avail = total - offset;
357 ptr =
static_cast<const uint8_t *
>(chunk->
getDataPtr());
359 for (i = 0; i < chunk_bytes; i += SHELL_SEEK_LINE_BYTES)
362 (chunk_bytes - i) < SHELL_SEEK_LINE_BYTES ? (chunk_bytes - i) : SHELL_SEEK_LINE_BYTES;
367 for (j = 0; j < SHELL_SEEK_LINE_BYTES; j++)
386 for (j = 0; j < line_len; j++)
388 uint8_t c = ptr[i + j];
389 fprintf(
outstream_,
"%c", (c >= 0x20 && c < 0x7f) ? (
char)c :
'.');
395 offset += chunk_bytes;
401void CProtoShellPretty::getAndPrint(
CIOCommon *io)
const
410 if (io->
isRead() ==
false)
412 fprintf(
outstream_,
"IO 0x%" PRIx32
"is write-only\n", objid);
424 fprintf(
outstream_,
"IO 0x%" PRIx32
" data:\n\t", objid);
428#ifdef CONFIG_DAWN_DTYPE_BOOL
430 getAndPrintTyped<bool>(
outstream_, io, ddim,
"%" PRId8
" ");
433#ifdef CONFIG_DAWN_DTYPE_INT8
435 getAndPrintTyped<int8_t>(
outstream_, io, ddim,
"%" PRId8
" ");
438#ifdef CONFIG_DAWN_DTYPE_UINT8
440 getAndPrintTyped<uint8_t>(
outstream_, io, ddim,
"%" PRId8
" ");
443#ifdef CONFIG_DAWN_DTYPE_INT16
445 getAndPrintTyped<int16_t>(
outstream_, io, ddim,
"%" PRId16
" ");
448#ifdef CONFIG_DAWN_DTYPE_UINT16
450 getAndPrintTyped<uint16_t>(
outstream_, io, ddim,
"%" PRId16
" ");
453#ifdef CONFIG_DAWN_DTYPE_INT32
455 getAndPrintTyped<int32_t>(
outstream_, io, ddim,
"%" PRId32
" ");
458#ifdef CONFIG_DAWN_DTYPE_UINT32
460 getAndPrintTyped<uint32_t>(
outstream_, io, ddim,
"%" PRId32
" ");
463#ifdef CONFIG_DAWN_DTYPE_UINT64
465 getAndPrintTyped<uint64_t>(
outstream_, io, ddim,
"%" PRId64
" ");
468#ifdef CONFIG_DAWN_DTYPE_FLOAT
470 getAndPrintTyped<float>(
outstream_, io, ddim,
"%.4f ");
473#ifdef CONFIG_DAWN_DTYPE_CHAR
479 fprintf(
outstream_,
"missing print support for dtype=%d\n", dtype);
486void CProtoShellPretty::getcfgAndPrint(
CObject *obj)
const
496void CProtoShellPretty::cmdHelp()
499 fprintf(
outstream_,
"\t help - print this message\n");
501 fprintf(
outstream_,
"\t info - show shell-bound IO inventory\n");
502 fprintf(
outstream_,
"\t getio <IO objectID> - get value for a given objectID\n");
503 fprintf(
outstream_,
"\t setio <IO objectID> <v1..vN> - set IO value words\n");
504 fprintf(
outstream_,
"\t getioloop - get all objects in loop\n");
505#ifdef CONFIG_DAWN_IO_NOTIFY
506 fprintf(
outstream_,
"\t getionotify <objectID> - get io with notification\n");
508 fprintf(
outstream_,
"\t getcfg <objectID> [cfgID] - get object configuration\n");
509 fprintf(
outstream_,
"\t setcfg <objectID> <cfgID> <v1..vN> - set object config words\n");
510#ifdef CONFIG_DAWN_PROTO_SHELL_INSPECT
511 fprintf(
outstream_,
"\n Object Inspector:\n");
512 fprintf(
outstream_,
"\t list [io|prog|proto] [verbose] - show object inventory\n");
513 fprintf(
outstream_,
"\t inspect <objectID> - detailed object introspection\n");
514 fprintf(
outstream_,
"\t tree - show object hierarchy\n");
515 fprintf(
outstream_,
"\t stats - show runtime statistics\n");
517 fprintf(
outstream_,
"\n\t NOTE: all values must be in hex format: 0xYYYYYYYY\n");
520void CProtoShellPretty::cmdExit()
526void CProtoShellPretty::cmdInfo()
528 fprintf(
outstream_,
"INFO: shell IO bindings\n");
529 fprintf(
outstream_,
" Name ObjID DType[Dim] Flags\n");
530 fprintf(
outstream_,
" -------------- ---------- ---------- ------\n");
532 for (
auto const &[
id, io] :
getIOMap())
537 outstream_,
" %-14s 0x%08" PRIx32
" %-10s %s\n",
"(unbound)",
id,
"-",
"unbound");
542 " %-14s 0x%08" PRIx32
" %s[%zu] %c%c%c%c%c\n",
543#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
552 io->isWrite() ?
'W' :
'-',
553 io->isNotify() ?
'N' :
'-',
554 io->isTimestamp() ?
'T' :
'-',
558 fprintf(
outstream_,
"Flags: R=Read W=Write N=Notify T=Timestamp C=Config\n");
559#ifdef CONFIG_DAWN_PROTO_SHELL_INSPECT
560 fprintf(
outstream_,
"Use 'list io' for all runtime IOs or 'list verbose' for details.\n");
564void CProtoShellPretty::cmdSetio(
const char *arg)
569 char argbuf[DAWN_PROTO_SHELL_LINELEN];
570 char *saveptr =
nullptr;
578 if (arg ==
nullptr || *arg ==
'\0')
584 strncpy(argbuf, arg,
sizeof(argbuf) - 1);
585 argbuf[
sizeof(argbuf) - 1] =
'\0';
587 token = strtok_r(argbuf,
" \t", &saveptr);
588 if (!parseU32Token(token, &objid))
590 fprintf(
outstream_,
"invalid argument: %s\n", arg);
594 token = strtok_r(
nullptr,
" \t", &saveptr);
595 if (token ==
nullptr)
598 "invalid argument: %s."
599 " Must be string in 0xXXXXXXXX format\n",
609 fprintf(
outstream_,
"no IO with objID = 0x%" PRIx32
"\n", objid);
613 if (io->
getIdV() != objid)
616 "IO ID mismatch: expected 0x%" PRIx32
", got 0x%" PRIx32
"\n",
626 fprintf(
outstream_,
"IO 0x%" PRIx32
"is read-only\n", objid);
631 if (words == 0 || words > GETANDPRINT_DIM_MAX)
633 fprintf(
outstream_,
"unsupported io dim %zu\n", words);
638 if (data_size == 0 || data_size % words != 0)
640 fprintf(
outstream_,
"unsupported io data shape size=%zu dim=%zu\n", data_size, words);
644 elem_size = data_size / words;
645 if (elem_size == 0 || elem_size > 4)
647 fprintf(
outstream_,
"io set supported only for element size <= 4\n");
654 fprintf(
outstream_,
"setio buffer alloc failed\n");
658 for (i = 0; i < words; i++)
664 token = strtok_r(
nullptr,
" \t", &saveptr);
667 if (!parseU32Token(token, &value))
670 outstream_,
"invalid data: expected %zu words for IO 0x%" PRIx32
"\n", words, objid);
675 std::memcpy(
static_cast<uint8_t *
>(data->
getDataPtr()) + i * elem_size, &value, elem_size);
678 if (strtok_r(
nullptr,
" \t", &saveptr) !=
nullptr)
680 fprintf(
outstream_,
"too many data words for IO 0x%" PRIx32
"\n", objid);
688 fprintf(
outstream_,
"setio failed %d\n", ret);
694void CProtoShellPretty::cmdGetio(
const char *arg)
701 if (!parseU32Token(arg, &objid))
703 fprintf(
outstream_,
"invalid argument: %s\n", arg);
712 fprintf(
outstream_,
"no IO with objID = 0x%" PRIx32
"\n", objid);
716 if (io->
getIdV() != objid)
719 "IO ID mismatch: expected 0x%" PRIx32
", got 0x%" PRIx32
"\n",
730void CProtoShellPretty::cmdGetioloop(
const char *arg)
738 for (
auto const &[
id, io] :
getIOMap())
742 fprintf(
outstream_,
"IO 0x%" PRIx32
" is not bound\n",
id);
750 std::this_thread::sleep_for(1000ms);
755#ifdef CONFIG_DAWN_IO_NOTIFY
756void CProtoShellPretty::cmdGetioNotify(
const char *arg)
764 if (!parseU32Token(arg, &objid))
766 fprintf(
outstream_,
"invalid argument: %s\n", arg);
775 fprintf(
outstream_,
"no IO with objID = 0x%" PRIx32
"\n", objid);
779 if (io->
getIdV() != objid)
782 "IO ID mismatch: expected 0x%" PRIx32
", got 0x%" PRIx32
"\n",
790 ret = io->setNotifier(notifierCb, 0, io);
793 fprintf(
outstream_,
"ERROR: set notifier failed for objId = 0x%" PRIx32
"\n", objid);
799void CProtoShellPretty::cmdSetcfg(
const char *arg)
804 std::vector<uint32_t> data;
805 char argbuf[DAWN_PROTO_SHELL_LINELEN];
806 char *saveptr =
nullptr;
812 if (arg ==
nullptr || *arg ==
'\0')
818 strncpy(argbuf, arg,
sizeof(argbuf) - 1);
819 argbuf[
sizeof(argbuf) - 1] =
'\0';
821 token = strtok_r(argbuf,
" \t", &saveptr);
822 if (!parseU32Token(token, &objid))
824 fprintf(
outstream_,
"invalid object ID: %s\n", arg);
828 token = strtok_r(
nullptr,
" \t", &saveptr);
829 if (!parseU32Token(token, &objcfg))
831 fprintf(
outstream_,
"invalid cfg ID: %s\n", arg);
838 fprintf(
outstream_,
"invalid cfg word count for cfgID = 0x%" PRIx32
"\n", objcfg);
843 for (i = 0; i < words; i++)
845 token = strtok_r(
nullptr,
" \t", &saveptr);
846 if (!parseU32Token(token, &data[i]))
849 "invalid data: expected %zu words for cfgID 0x%" PRIx32
"\n",
856 if (strtok_r(
nullptr,
" \t", &saveptr) !=
nullptr)
858 fprintf(
outstream_,
"too many data words for cfgID 0x%" PRIx32
"\n", objcfg);
865 fprintf(
outstream_,
"no object with objID = 0x%" PRIx32
"\n", objid);
872 fprintf(
outstream_,
"failed to update objectCfg = 0x%" PRIx32
"\n", objcfg);
877void CProtoShellPretty::cmdGetcfg(
const char *arg)
882 std::vector<uint32_t> data;
883 char argbuf[DAWN_PROTO_SHELL_LINELEN];
884 char *saveptr =
nullptr;
889 if (arg ==
nullptr || *arg ==
'\0')
895 strncpy(argbuf, arg,
sizeof(argbuf) - 1);
896 argbuf[
sizeof(argbuf) - 1] =
'\0';
898 token = strtok_r(argbuf,
" \t", &saveptr);
899 if (!parseU32Token(token, &objid))
901 fprintf(
outstream_,
"invalid object ID: %s\n", arg);
908 fprintf(
outstream_,
"no object with objID = 0x%" PRIx32
"\n", objid);
912 token = strtok_r(
nullptr,
" \t", &saveptr);
913 if (token ==
nullptr)
919 if (!parseU32Token(token, &objcfg))
921 fprintf(
outstream_,
"invalid cfg ID: %s\n", arg);
925 if (strtok_r(
nullptr,
" \t", &saveptr) !=
nullptr)
927 fprintf(
outstream_,
"invalid argument: %s\n", arg);
934 fprintf(
outstream_,
"invalid cfg word count for cfgID = 0x%" PRIx32
"\n", objcfg);
941 fprintf(
outstream_,
"failed to read objectCfg = 0x%" PRIx32
"\n", objcfg);
945 fprintf(
outstream_,
"CFG 0x%" PRIx32
":\n", objcfg);
946 for (i = 0; i < words; i++)
948 fprintf(
outstream_,
"\t0x%08" PRIx32
"\n", data[i]);
952void CProtoShellPretty::cmdHandle(
char *cmd,
const char *arg)
954 std::string scmd = cmd;
958 switch (cmdmap[scmd])
960 case PROTO_SHELL_CMDID_HELP:
966 case PROTO_SHELL_CMDID_EXIT:
972 case PROTO_SHELL_CMDID_INFO:
978 case PROTO_SHELL_CMDID_SETIO:
984 case PROTO_SHELL_CMDID_GETIO:
990#ifdef CONFIG_DAWN_IO_NOTIFY
991 case PROTO_SHELL_CMDID_GETIONOTIFY:
998 case PROTO_SHELL_CMDID_GETIOLOOP:
1004 case PROTO_SHELL_CMDID_SETCFG:
1010 case PROTO_SHELL_CMDID_GETCFG:
1016#ifdef CONFIG_DAWN_PROTO_SHELL_INSPECT
1017 case PROTO_SHELL_CMDID_LIST:
1023 case PROTO_SHELL_CMDID_INSPECT:
1029 case PROTO_SHELL_CMDID_TREE:
1035 case PROTO_SHELL_CMDID_STATS:
1044 fprintf(
outstream_,
"ERROR:invalid command %s\n", cmd);
1051void CProtoShellPretty::thread()
1053 char buffer[DAWN_PROTO_SHELL_LINELEN];
1059 fprintf(
outstream_,
"\n*Start DAWN Shell*\n\n");
1067 fprintf(outstream,
"%s", prompt);
1071 auto len = readline_stream(buffer,
sizeof(buffer), instream, outstream);
1084 while (len > 0 && (buffer[len - 1] ==
'\n' || buffer[len - 1] ==
'\r'))
1086 buffer[len - 1] =
'\0';
1097 cmd = strtok_r(buffer,
" \r\n", &arg);
1112 cmdHandle(cmd, arg);
1122CProtoShellPretty::~CProtoShellPretty()
1145 DAWNERR(
"Only one shell instance is supported\n");
1153 ret = configureDesc(
getDesc());
1156 DAWNERR(
"Shell configure failed (error %d)\n", ret);
1163 DAWNINFO(
"CProtoShellPretty path= %s\n", path);
1165 instream = fopen(path,
"r");
1166 if (instream ==
nullptr)
1168 DAWNERR(
"Failed to open input stream: %s\n", path);
1173 outstream = fopen(path,
"w");
1174 if (outstream ==
nullptr)
1176 DAWNERR(
"Failed to open output stream: %s\n", path);
CObject * getObject(SObjectId::ObjectId id)
Get an object by ID.
CIOCommon * getIO(SObjectId::ObjectId id)
Get an I/O object by ID.
void setObjectMapItem(SObjectId::ObjectId id, CObject *obj)
Set an item in the object map.
const std::map< SObjectId::ObjectId, CIOCommon * > & getIOMap() const
Get the I/O map for this object.
Descriptor wrapper for individual object configuration.
size_t getSizeBytes() const
Get total size in bytes for this object definition.
size_t getSize() const
Get number of configuration items for this object.
uint32_t getAtOffset(size_t offset) const
Get 32-bit word at specified offset.
SObjectCfg::SObjectCfgItem * objectCfgItemNext(size_t &offset) const
Get config item at current offset and advance past it.
Base class for all I/O objects.
virtual bool isWrite() const =0
Check if IO supports write operations.
int setData(IODataCmn &data, size_t offset=0)
Set data for I/O (public interface with stats tracking).
int getData(IODataCmn &data, size_t len, size_t offset=0)
Get data from I/O (public interface with stats tracking).
virtual bool isSeekable() const
Check if IO supports partial (seekable) access.
bool isTimestamp() const
Check if I/O supports timestamp.
virtual size_t getDataDim() const =0
Get data vector dimension.
io_ddata_t * ddata_alloc(size_t batch, size_t chunk_size=0)
Allocate data buffer for this I/O.
virtual size_t getDataSize() const =0
Get data size in bytes.
virtual bool isRead() const =0
Check if IO supports read operations.
Base class for all Dawn objects (IOs, Programs, Protocols).
SObjectId::ObjectId getIdV() const
Get object identifier as raw 32-bit value.
CDescObject & getDesc()
Get descriptor object for this object.
int getObjConfig(SObjectCfg::ObjectCfgId objcfg, uint32_t *data, size_t len)
Get object configuration item.
int setObjConfig(SObjectCfg::ObjectCfgId objcfg, uint32_t *data, size_t len)
Set object configuration item.
uint8_t getDtype() const
Get data type field.
bool getCfgFlag() const
Check if configuration flag is set.
@ PROTO_CLASS_SHELL_STD
Interactive shell on stdin/stdout.
int doStart()
Start implementation hook.
@ PROTO_SHELL_CFG_PATH
Shell device path (TTY/serial).
@ PROTO_SHELL_CFG_PROMPT
Custom prompt string.
@ PROTO_SHELL_CFG_IOBIND
I/O object binding configuration.
static int inst
Global instance counter for multiple shell instances.
int doStop()
Stop implementation hook.
static FILE * outstream_
Global output stream for shell messages.
bool hasThread() const
Check if a background thread is active.
int configure()
Configure object from descriptor data.
static void request()
Request application shutdown.
bool workerThreadRunning() const
Check if the worker thread is running.
int stopWorkerThread()
Stop the worker thread.
int startWorkerThread(Func &&func)
Start the worker thread with a given function.
CThreadedObject & workerThread()
Get a reference to this thread controller.
uint32_t ObjectCfgId
ConfigID type - single 32-bit value.
static uint16_t objectCfgGetSize(const ObjectCfgId objcfg)
Extract configuration data size from ConfigID.
Out-of-tree user-extension hooks for Dawn.
Single configuration item within object.
ObjectCfgData_t data[]
Configuration data array (flexible, size from cfgid.s.size).
UObjectCfgId cfgid
Configuration ID header (type, class, id, size, rw, dtype).
static const char * dtypeToString(uint8_t dtype)
Convert data type to human-readable string.
@ DTYPE_FLOAT
IEEE 754 single-precision floating point (32-bit).
@ DTYPE_INT32
Signed 32-bit integer (-2147483648 to 2147483647).
@ DTYPE_UINT8
Unsigned 8-bit integer (0 to 255).
@ DTYPE_INT16
Signed 16-bit integer (-32768 to 32767).
@ DTYPE_INT8
Signed 8-bit integer (-128 to 127).
@ DTYPE_UINT64
Unsigned 64-bit integer.
@ DTYPE_UINT16
Unsigned 16-bit integer (0 to 65535).
@ DTYPE_CHAR
Character/string type (null-terminated, 4-byte aligned).
@ DTYPE_UINT32
Unsigned 32-bit integer (0 to 4294967295).
@ DTYPE_BOOL
Boolean data type (stored in 32-bit container).
uint32_t ObjectId
ObjectID type - single 32-bit value.
Heap-allocated dynamic I/O data buffer.
size_t getDataSize()
Get data size in bytes.
void * getDataPtr(size_t batch=0)
Get pointer to data only (skips timestamp if present).
T & get(size_t index, size_t batch=0)
Get data element by index and batch (type-safe).
Static (compile-time) I/O data buffer (no timestamp).
size_t getItems()
Get number of items per batch.
ObjectCfgId v
Raw 32-bit ConfigID value (for storage, comparison).
uint32_t cls
Object class (bits 21-29, max 511).
uint32_t id
Configuration identifier (bits 0-4, max 31).
uint32_t size
Configuration data size in 32-bit words (bits 5-14, max 1023).
struct dawn::SObjectCfg::UObjectCfgId::@10 s
Bit-field structure for named member access.
32-bit encoded object identifier (union with bit field).
ObjectId v
Raw 32-bit ObjectID value (for comparison, hashing, storage).