Page 1 of 1

Porting esp matter light example to application

Posted: Thu May 04, 2023 2:13 pm
by bipin_c@shoreline
Hi all,
I have just started working on the Matter protocol with matter sdk and esp32 device.My device (which is a electric kettle)needs matter protocol to be integrated in its application code.I an using esp32 with sdk v4.4. Later as matter example codes supports sdk from v4.4.2,i upgraded my sdk version to 4.4.2 to support the matter protocol in it.I am able to run independently Light example on my custom board.
When i tried to port this Light example code in my kettle code ,it started giving me compilation errors.As soon as i included "esp_matter.h" file in my main.c,it gave me lots of error and there is no chance to understand where those errors are coming from.A little help regarding this issue will be a great help.My existing code compiles and runs well with new idf.issue comes when i try to add headers required for matter protocol.

Please see the logs below:

/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:24: error: invalid use of incomplete type 'struct blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^~
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:24: note: in definition of macro 'OS_MBUF_PKTHDR'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))


/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:238:43: error: cannot convert 'os_mbuf*' to 'blens::os_mbuf*'
rc = gatt_svr_chr_write(ctxt->om, sizeof(buffer), sizeof(buffer), buffer, &out_len);
~~~~~~^~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:148:36: note: initializing argument 1 of 'int blens::gatt_svr_chr_write(blens::os_mbuf*, uint16_t, uint16_t, void*, uint16_t*)'
gatt_svr_chr_write(struct os_mbuf *om, uint16_t min_len, uint16_t max_len,
~~~~~~~~~~~~~~~~^~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:271:43: error: cannot convert 'os_mbuf*' to 'blens::os_mbuf*'
rc = gatt_svr_chr_write(ctxt->om, sizeof(settings_record), sizeof(settings_record), &settings_record, NULL);
~~~~~~^~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:148:36: note: initializing argument 1 of 'int blens::gatt_svr_chr_write(blens::os_mbuf*, uint16_t, uint16_t, void*, uint16_t*)'
gatt_svr_chr_write(struct os_mbuf *om, uint16_t min_len, uint16_t max_len,

/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:57: error: invalid application of 'sizeof' to incomplete type 'blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:146:31: note: in expansion of macro 'OS_MBUF_PKTHDR'
#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
^~~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:421:137: note: in expansion of macro 'OS_MBUF_PKTLEN'
if (level==ESP_LOG_ERROR ) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:443:41: note: in expansion of macro 'ESP_LOG_LEVEL'
if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
^~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:351:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:273:17: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "gatt_svr_chr_write len %d failed %d", OS_MBUF_PKTLEN(ctxt->om), rc);
^~~~~~~~
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:57: error: invalid application of 'sizeof' to incomplete type 'blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:146:31: note: in expansion of macro 'OS_MBUF_PKTHDR'
#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
^~~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:422:137: note: in expansion of macro 'OS_MBUF_PKTLEN'
else if (level==ESP_LOG_WARN ) { esp_log_write(ESP_LOG_WARN, tag, LOG_FORMAT(W, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:443:41: note: in expansion of macro 'ESP_LOG_LEVEL'
if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
^~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:351:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:273:17: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "gatt_svr_chr_write len %d failed %d", OS_MBUF_PKTLEN(ctxt->om), rc);
^~~~~~~~
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:57: error: invalid application of 'sizeof' to incomplete type 'blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:146:31: note: in expansion of macro 'OS_MBUF_PKTHDR'
#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
^~~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:423:137: note: in expansion of macro 'OS_MBUF_PKTLEN'
else if (level==ESP_LOG_DEBUG ) { esp_log_write(ESP_LOG_DEBUG, tag, LOG_FORMAT(D, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:443:41: note: in expansion of macro 'ESP_LOG_LEVEL'
if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
^~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:351:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:273:17: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "gatt_svr_chr_write len %d failed %d", OS_MBUF_PKTLEN(ctxt->om), rc);
^~~~~~~~
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:57: error: invalid application of 'sizeof' to incomplete type 'blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:146:31: note: in expansion of macro 'OS_MBUF_PKTHDR'
#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
^~~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:424:137: note: in expansion of macro 'OS_MBUF_PKTLEN'
else if (level==ESP_LOG_VERBOSE ) { esp_log_write(ESP_LOG_VERBOSE, tag, LOG_FORMAT(V, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:443:41: note: in expansion of macro 'ESP_LOG_LEVEL'
if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
^~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:351:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:273:17: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "gatt_svr_chr_write len %d failed %d", OS_MBUF_PKTLEN(ctxt->om), rc);
^~~~~~~~
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:57: error: invalid application of 'sizeof' to incomplete type 'blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:146:31: note: in expansion of macro 'OS_MBUF_PKTHDR'
#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
^~~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:425:137: note: in expansion of macro 'OS_MBUF_PKTLEN'
else { esp_log_write(ESP_LOG_INFO, tag, LOG_FORMAT(I, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:443:41: note: in expansion of macro 'ESP_LOG_LEVEL'
if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
^~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:351:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:273:17: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "gatt_svr_chr_write len %d failed %d", OS_MBUF_PKTLEN(ctxt->om), rc);
^~~~~~~~
In file included from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:692:
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:303:43: error: cannot convert 'os_mbuf*' to 'blens::os_mbuf*'
rc = gatt_svr_chr_write(ctxt->om, 2, sizeof(http_scratch_buffer), http_scratch_buffer, &out_len);
~~~~~~^~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:148:36: note: initializing argument 1 of 'int blens::gatt_svr_chr_write(blens::os_mbuf*, uint16_t, uint16_t, void*, uint16_t*)'
gatt_svr_chr_write(struct os_mbuf *om, uint16_t min_len, uint16_t max_len,
~~~~~~~~~~~~~~~~^~
In file included from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os.h:56,
from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble.h:26,
from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/hci_common.h:23,
from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/host/include/host/ble_hs.h:30,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/BLEManagerImpl.h:47,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/internal/BLEManager.h:106,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/ConnectivityManagerImpl.h:45,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/ConnectivityManager.h:329,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/ConfigurationManagerImpl.h:28,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/ConfigurationManager.h:219,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/CHIPDeviceLayer.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/CASESessionManager.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/ReadHandler.h:31,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/InteractionModelEngine.h:53,
from /home/bipin/esp/esp-matter/components/esp_matter/esp_matter_core.h:18,
from /home/bipin/esp/esp-matter/components/esp_matter/esp_matter_attribute.h:18,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/esp_matter.h:22,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:23:
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:57: error: invalid application of 'sizeof' to incomplete type 'blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:146:31: note: in expansion of macro 'OS_MBUF_PKTHDR'
#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
^~~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:421:137: note: in expansion of macro 'OS_MBUF_PKTLEN'
if (level==ESP_LOG_ERROR ) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:443:41: note: in expansion of macro 'ESP_LOG_LEVEL'
if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
^~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:351:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:305:17: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "gatt_svr_chr_write len %d failed %d", OS_MBUF_PKTLEN(ctxt->om), rc);
^~~~~~~~
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:57: error: invalid application of 'sizeof' to incomplete type 'blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:146:31: note: in expansion of macro 'OS_MBUF_PKTHDR'
#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
^~~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:422:137: note: in expansion of macro 'OS_MBUF_PKTLEN'
else if (level==ESP_LOG_WARN ) { esp_log_write(ESP_LOG_WARN, tag, LOG_FORMAT(W, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:443:41: note: in expansion of macro 'ESP_LOG_LEVEL'
if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
^~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:351:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:305:17: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "gatt_svr_chr_write len %d failed %d", OS_MBUF_PKTLEN(ctxt->om), rc);
^~~~~~~~
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:57: error: invalid application of 'sizeof' to incomplete type 'blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:146:31: note: in expansion of macro 'OS_MBUF_PKTHDR'
#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
^~~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:423:137: note: in expansion of macro 'OS_MBUF_PKTLEN'
else if (level==ESP_LOG_DEBUG ) { esp_log_write(ESP_LOG_DEBUG, tag, LOG_FORMAT(D, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:443:41: note: in expansion of macro 'ESP_LOG_LEVEL'
if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
^~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:351:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:305:17: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "gatt_svr_chr_write len %d failed %d", OS_MBUF_PKTLEN(ctxt->om), rc);
^~~~~~~~
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:57: error: invalid application of 'sizeof' to incomplete type 'blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:146:31: note: in expansion of macro 'OS_MBUF_PKTHDR'
#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
^~~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:424:137: note: in expansion of macro 'OS_MBUF_PKTLEN'
else if (level==ESP_LOG_VERBOSE ) { esp_log_write(ESP_LOG_VERBOSE, tag, LOG_FORMAT(V, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:443:41: note: in expansion of macro 'ESP_LOG_LEVEL'
if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
^~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:351:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:305:17: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "gatt_svr_chr_write len %d failed %d", OS_MBUF_PKTLEN(ctxt->om), rc);
^~~~~~~~
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:57: error: invalid application of 'sizeof' to incomplete type 'blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:146:31: note: in expansion of macro 'OS_MBUF_PKTHDR'
#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
^~~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:425:137: note: in expansion of macro 'OS_MBUF_PKTLEN'
else { esp_log_write(ESP_LOG_INFO, tag, LOG_FORMAT(I, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:443:41: note: in expansion of macro 'ESP_LOG_LEVEL'
if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
^~~~~~~~~~~~~
/home/bipin/esp/esp-idf/components/log/include/esp_log.h:351:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:305:17: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "gatt_svr_chr_write len %d failed %d", OS_MBUF_PKTLEN(ctxt->om), rc);
^~~~~~~~
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:57: error: invalid application of 'sizeof' to incomplete type 'blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:146:31: note: in expansion of macro 'OS_MBUF_PKTHDR'
#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
^~~~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:352:27: note: in expansion of macro 'OS_MBUF_PKTLEN'
int pkt_len = OS_MBUF_PKTLEN(ctxt->om);
^~~~~~~~~~~~~~
In file included from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:692:
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:356:47: error: cannot convert 'os_mbuf*' to 'blens::os_mbuf*'
rc = gatt_svr_chr_write(ctxt->om, pkt_len, pkt_len, ptr, &len);
~~~~~~^~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:148:36: note: initializing argument 1 of 'int blens::gatt_svr_chr_write(blens::os_mbuf*, uint16_t, uint16_t, void*, uint16_t*)'
gatt_svr_chr_write(struct os_mbuf *om, uint16_t min_len, uint16_t max_len,
~~~~~~~~~~~~~~~~^~
In file included from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os.h:56,
from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble.h:26,
from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/hci_common.h:23,
from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/host/include/host/ble_hs.h:30,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/BLEManagerImpl.h:47,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/internal/BLEManager.h:106,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/ConnectivityManagerImpl.h:45,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/ConnectivityManager.h:329,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/ConfigurationManagerImpl.h:28,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/ConfigurationManager.h:219,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/CHIPDeviceLayer.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/CASESessionManager.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/ReadHandler.h:31,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/InteractionModelEngine.h:53,
from /home/bipin/esp/esp-matter/components/esp_matter/esp_matter_core.h:18,
from /home/bipin/esp/esp-matter/components/esp_matter/esp_matter_attribute.h:18,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/esp_matter.h:22,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:23:
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp: In function 'int blens::gatt_svr_chr_access_sec_prov(uint16_t, uint16_t, ble_gatt_access_ctxt*, void*)':
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:136:57: error: invalid application of 'sizeof' to incomplete type 'blens::os_mbuf'
((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
^
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:146:31: note: in expansion of macro 'OS_MBUF_PKTHDR'
#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
^~~~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:515:29: note: in expansion of macro 'OS_MBUF_PKTLEN'
uint16_t data_len = OS_MBUF_PKTLEN(ctxt->om), data_buf_len;
^~~~~~~~~~~~~~
In file included from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:692:
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:525:69: error: 'data_buf_len' was not declared in this scope
int rc = ble_hs_mbuf_to_flat(ctxt->om, data_buf, data_len, &data_buf_len);
^~~~~~~~~~~~
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:525:69: note: maximum limit of 1000 namespaces searched for 'data_buf_len'
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:525:69: note: suggested alternative: 'data_buf'
int rc = ble_hs_mbuf_to_flat(ctxt->om, data_buf, data_len, &data_buf_len);
^~~~~~~~~~~~
data_buf
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp: In function 'bool blens::ble_send_notification(int, const void*, size_t, const char*)':
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:648:48: error: cannot convert 'os_mbuf*' to 'blens::os_mbuf*' in initialization
struct os_mbuf *txom = ble_hs_mbuf_att_pkt();
^
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:653:29: error: cannot convert 'blens::os_mbuf*' to 'os_mbuf*'
int rc = os_mbuf_append(txom, record, record_size);
^~~~
In file included from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os.h:56,
from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble.h:26,
from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/hci_common.h:23,
from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/host/include/host/ble_hs.h:30,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/BLEManagerImpl.h:47,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/internal/BLEManager.h:106,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/ConnectivityManagerImpl.h:45,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/ConnectivityManager.h:329,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/ConfigurationManagerImpl.h:28,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/ConfigurationManager.h:219,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/CHIPDeviceLayer.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/CASESessionManager.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/ReadHandler.h:31,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/InteractionModelEngine.h:53,
from /home/bipin/esp/esp-matter/components/esp_matter/esp_matter_core.h:18,
from /home/bipin/esp/esp-matter/components/esp_matter/esp_matter_attribute.h:18,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/esp_matter.h:22,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:23:
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:425:36: note: initializing argument 1 of 'int os_mbuf_append(os_mbuf*, const void*, uint16_t)'
int os_mbuf_append(struct os_mbuf *m, const void *, uint16_t);
~~~~~~~~~~~~~~~~^
In file included from /home/bipin/esp/esp-idf/components/bt/host/nimble/esp-hci/include/esp_nimble_hci.h:25,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:6,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:692:
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble_hci_trans.h:30:8: note: class type 'blens::os_mbuf' is incomplete
struct os_mbuf;
^~~~~~~
In file included from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:692:
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:659:28: error: cannot convert 'blens::os_mbuf*' to 'os_mbuf*'
os_mbuf_free_chain(txom);
^~~~
In file included from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os.h:56,
from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble.h:26,
from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/hci_common.h:23,
from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/host/include/host/ble_hs.h:30,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/BLEManagerImpl.h:47,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/internal/BLEManager.h:106,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/ConnectivityManagerImpl.h:45,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/ConnectivityManager.h:329,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/ConfigurationManagerImpl.h:28,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/ConfigurationManager.h:219,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/CHIPDeviceLayer.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/CASESessionManager.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/ReadHandler.h:31,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/InteractionModelEngine.h:53,
from /home/bipin/esp/esp-matter/components/esp_matter/esp_matter_core.h:18,
from /home/bipin/esp/esp-matter/components/esp_matter/esp_matter_attribute.h:18,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/esp_matter.h:22,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:23:
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mbuf.h:463:40: note: initializing argument 1 of 'int os_mbuf_free_chain(os_mbuf*)'
int os_mbuf_free_chain(struct os_mbuf *om);
~~~~~~~~~~~~~~~~^~
In file included from /home/bipin/esp/esp-idf/components/bt/host/nimble/esp-hci/include/esp_nimble_hci.h:25,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:6,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:692:
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble_hci_trans.h:30:8: note: class type 'blens::os_mbuf' is incomplete
struct os_mbuf;
^~~~~~~
In file included from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:692:
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:663:62: error: cannot convert 'blens::os_mbuf*' to 'os_mbuf*'
rc = ble_gattc_notify_custom(conn_handle, notify_handle, txom);
^~~~
In file included from /home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/host/include/host/ble_hs.h:34,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/BLEManagerImpl.h:47,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/internal/BLEManager.h:106,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/ConnectivityManagerImpl.h:45,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/ConnectivityManager.h:329,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/ConfigurationManagerImpl.h:28,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/ConfigurationManager.h:219,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/include/platform/CHIPDeviceLayer.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/CASESessionManager.h:27,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/ReadHandler.h:31,
from /home/bipin/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/InteractionModelEngine.h:53,
from /home/bipin/esp/esp-matter/components/esp_matter/esp_matter_core.h:18,
from /home/bipin/esp/esp-matter/components/esp_matter/esp_matter_attribute.h:18,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/esp_matter.h:22,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:23:
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/host/include/host/ble_gatt.h:474:45: note: initializing argument 3 of 'int ble_gattc_notify_custom(uint16_t, uint16_t, os_mbuf*)'
struct os_mbuf *om);
~~~~~~~~~~~~~~~~^~
In file included from /home/bipin/esp/esp-idf/components/bt/host/nimble/esp-hci/include/esp_nimble_hci.h:25,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:6,
from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:692:
/home/bipin/esp/esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble_hci_trans.h:30:8: note: class type 'blens::os_mbuf' is incomplete
struct os_mbuf;
^~~~~~~
In file included from /home/bipin/esp/SB_Test/EKG_Pro/firmware/main/main.cpp:692:
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp: In member function 'bool blens::BLE::start()':
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:1024:19: error: expected unqualified-id before '.' token
ble_hs_cfg.reset_cb = on_reset;//host resets itself and the controller due to fatal error
^
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:1025:19: error: expected unqualified-id before '.' token
ble_hs_cfg.sync_cb = on_sync;//host and controller become synced - happens at startup and after a reset.
^
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:1026:19: error: expected unqualified-id before '.' token
ble_hs_cfg.gatts_register_cb = gatt_svr_register_cb; //Optional
^
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:1027:19: error: expected unqualified-id before '.' token
ble_hs_cfg.store_status_cb = ble_store_util_status_rr; //Optional
^
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:1029:19: error: expected unqualified-id before '.' token
ble_hs_cfg.sm_io_cap =
^
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:1037:19: error: expected unqualified-id before '.' token
ble_hs_cfg.sm_bonding = 1;//Store keys distributed during bonding
^
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:1038:19: error: expected unqualified-id before '.' token
ble_hs_cfg.sm_mitm = 1;//requiring Man-In-The-Middle protection when pairing.
^
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:1039:19: error: expected unqualified-id before '.' token
ble_hs_cfg.sm_sc = 1;//using LE Secure Connections for pairing if also supported by remote device
^
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:1041:19: error: expected unqualified-id before '.' token
ble_hs_cfg.sm_our_key_dist = BLE_SM_PAIR_KEY_DIST_ENC | BLE_SM_PAIR_KEY_DIST_ID;
^
/home/bipin/esp/SB_Test/EKG_Pro/firmware/main/ble.hpp:1042:19: error: expected unqualified-id before '.' token
ble_hs_cfg.sm_their_key_dist = BLE_SM_PAIR_KEY_DIST_ENC | BLE_SM_PAIR_KEY_DIST_ID;
^

Re: Porting esp matter light example to application

Posted: Thu May 04, 2023 10:16 pm
by MicroController
cannot convert 'os_mbuf*' to 'blens::os_mbuf*'
indicates that somehow the C structure "os_mbuf" was (re-)declared in the C++ namespace "blens", and "os_mbuf" is considered a different type than "blens::os_mbuf".
Haven't seen your code, or esp matter, but could it be that you accidentally added a #include ... of a (C-)header inside the "blens" namespace?

Like

Code: Select all

namespace blens {
...
#include ...
...
} // namespace blens
instead of

Code: Select all

#include ...

namespace blens {
...
} // namespace blens
?