From d398cf79dc67517407712303a2af15fbbe152eb3 Mon Sep 17 00:00:00 2001 From: Przemyslaw Bida Date: Mon, 16 Dec 2024 12:41:48 +0100 Subject: [PATCH] [nrf fromtree] net: openthread: Add tcat platform function implementation Commit add tcat related function implementation Signed-off-by: Przemyslaw Bida (cherry picked from commit 150af78d6c21063ad46d5b219f38e2a766f55428) Signed-off-by: Adrian Gielniewski --- modules/openthread/platform/ble.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/modules/openthread/platform/ble.c b/modules/openthread/platform/ble.c index b3d841d46d5c..ca40ae117be9 100644 --- a/modules/openthread/platform/ble.c +++ b/modules/openthread/platform/ble.c @@ -433,6 +433,30 @@ otError otPlatBleGapAdvSetData(otInstance *aInstance, uint8_t *aAdvertisementDat return OT_ERROR_NONE; } +otError otPlatBleGapAdvUpdateData(otInstance *aInstance, uint8_t *aAdvertisementData, + uint16_t aAdvertisementLen) +{ + ARG_UNUSED(aInstance); + + int err; + + if (aAdvertisementLen > OT_TCAT_ADVERTISEMENT_MAX_LEN || aAdvertisementData == NULL) { + LOG_ERR("Invalid TCAT Advertisement parameters advlen: %d", aAdvertisementLen); + return OT_ERROR_INVALID_ARGS; + } + + ad[1].data_len = (uint8_t)aAdvertisementLen; + sd[1].data_len = (uint8_t)aAdvertisementLen; + + err = bt_le_adv_update_data(ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd)); + + if (err != 0) { + return OT_ERROR_FAILED; + } + + return OT_ERROR_NONE; +} + otError otPlatBleGapAdvStart(otInstance *aInstance, uint16_t aInterval) { ARG_UNUSED(aInstance);