27#ifndef DETERMINISTICESPASYNCWEBSERVER_MTCONNECT_H
28#define DETERMINISTICESPASYNCWEBSERVER_MTCONNECT_H
34#if DETWS_ENABLE_MTCONNECT
37enum class DetwsMtcCategory : uint8_t
60void detws_mtc_streams_begin(DetwsMtcStreams *s,
char *buf,
size_t cap, uint64_t instance_id, uint64_t next_seq,
61 const char *device_name);
72void detws_mtc_streams_add(DetwsMtcStreams *s, DetwsMtcCategory cat,
const char *type,
const char *data_id,
73 uint64_t seq,
const char *timestamp,
const char *value);
76size_t detws_mtc_streams_end(DetwsMtcStreams *s);
82size_t detws_mtc_error(uint64_t instance_id,
const char *error_code,
const char *message,
char *out,
size_t cap);
93void detws_mtc_devices_begin(DetwsMtcStreams *s,
char *buf,
size_t cap, uint64_t instance_id,
const char *device_id,
94 const char *device_name,
const char *uuid);
104void detws_mtc_devices_add_item(DetwsMtcStreams *s, DetwsMtcCategory cat,
const char *
id,
const char *type,
105 const char *name,
const char *units);
108size_t detws_mtc_devices_end(DetwsMtcStreams *s);
118void detws_mtc_assets_begin(DetwsMtcStreams *s,
char *buf,
size_t cap, uint64_t instance_id, uint32_t asset_count,
119 uint32_t asset_buffer_size);
129void detws_mtc_assets_cutting_tool_begin(DetwsMtcStreams *s,
const char *asset_id,
const char *serial_number,
130 const char *tool_id,
const char *device_uuid,
const char *timestamp);
139void detws_mtc_assets_tool_life(DetwsMtcStreams *s,
const char *type,
const char *count_direction,
const char *limit,
143void detws_mtc_assets_cutting_tool_end(DetwsMtcStreams *s);
146size_t detws_mtc_assets_end(DetwsMtcStreams *s);
151struct DetwsMtcObservation
153 DetwsMtcCategory cat;
170struct DetwsMtcSampleBuffer
183void detws_mtc_sample_buffer_init(DetwsMtcSampleBuffer *b, uint64_t start_seq);
189uint64_t detws_mtc_sample_buffer_add(DetwsMtcSampleBuffer *b, DetwsMtcCategory cat,
const char *type,
190 const char *data_id,
const char *timestamp,
const char *value);
201size_t detws_mtc_sample_query(DetwsMtcSampleBuffer *b,
char *buf,
size_t cap, uint64_t instance_id,
202 const char *device_name, uint64_t from, uint32_t count);
User-facing configuration for DeterministicESPAsyncWebServer.
#define DETWS_MTC_VAL_MAX
#define DETWS_MTC_STR_MAX
#define DETWS_MTC_SAMPLE_BUFFER
MTConnect rolling sample buffer sizing (DETWS_ENABLE_MTCONNECT).