Skip to content

Commit 150af78

Browse files
Przemyslaw Bidakartben
authored andcommitted
net: openthread: Add tcat platform function implementation
Commit add tcat related function implementation Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
1 parent 6c989de commit 150af78

File tree

1 file changed

+24
-0
lines changed
  • modules/openthread/platform

1 file changed

+24
-0
lines changed

modules/openthread/platform/ble.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,30 @@ otError otPlatBleGapAdvSetData(otInstance *aInstance, uint8_t *aAdvertisementDat
433433
return OT_ERROR_NONE;
434434
}
435435

436+
otError otPlatBleGapAdvUpdateData(otInstance *aInstance, uint8_t *aAdvertisementData,
437+
uint16_t aAdvertisementLen)
438+
{
439+
ARG_UNUSED(aInstance);
440+
441+
int err;
442+
443+
if (aAdvertisementLen > OT_TCAT_ADVERTISEMENT_MAX_LEN || aAdvertisementData == NULL) {
444+
LOG_ERR("Invalid TCAT Advertisement parameters advlen: %d", aAdvertisementLen);
445+
return OT_ERROR_INVALID_ARGS;
446+
}
447+
448+
ad[1].data_len = (uint8_t)aAdvertisementLen;
449+
sd[1].data_len = (uint8_t)aAdvertisementLen;
450+
451+
err = bt_le_adv_update_data(ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));
452+
453+
if (err != 0) {
454+
return OT_ERROR_FAILED;
455+
}
456+
457+
return OT_ERROR_NONE;
458+
}
459+
436460
otError otPlatBleGapAdvStart(otInstance *aInstance, uint16_t aInterval)
437461
{
438462
ARG_UNUSED(aInstance);

0 commit comments

Comments
 (0)