From 9e2630a8f3887df3d8f11ee6a27d0d34b331ef28 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Tue, 18 Nov 2025 11:21:53 +0800
Subject: [PATCH] update thingsboard defconfig file

---
 project/lightd/config.h |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/project/lightd/config.h b/project/lightd/config.h
index 5bff2bc..0e9e131 100644
--- a/project/lightd/config.h
+++ b/project/lightd/config.h
@@ -13,6 +13,7 @@
 #ifndef  __CONF_H_
 #define  __CONF_H_
 
+#include <stddef.h>
 #include "gpio.h"
 
 enum
@@ -28,7 +29,8 @@
 
 typedef struct mqtt_ctx_s
 {
-    char          devid[32];    /*  device ID */
+    char            devid[32];    /*  device ID */
+    void           *userdata;      /* user data pointer */
 
     /* Broker settings  */
     char            host[128];  /* MQTT broker server name  */
@@ -61,6 +63,8 @@
     gpio_t          gpio;         /* gpio information */
     int             light_intval; /* light on interval */
     float           lux_threshold;/* lux threshold value  */
+    int             ds18b20;      /* ds18b20 enable or not */
+    int             tsl2561;      /* tsl2561 enable or not */
 } hwinfo_t;
 
 typedef struct iotd_ctx_s
@@ -70,6 +74,10 @@
     mqtt_ctx_t      mqtt;
 } iotd_ctx_t;
 
+/* get iotd_ctx address by mqtt_ctx address */
+#define container_of(ptr, type, member) ((type *)((char *)(ptr) - offsetof(type, member)))
+#define to_iotd(ctx)	container_of(ctx, iotd_ctx_t, mqtt);
+
 extern int parser_conf(const char *conf_file, iotd_ctx_t *ctx, int debug);
 
 #endif   /* ----- #ifndef _CONF_H_  ----- */

--
Gitblit v1.9.1