Skip to content

Commit

Permalink
add M ans S bit in tlv 0x4
Browse files Browse the repository at this point in the history
  • Loading branch information
canisLupus1313 committed May 16, 2024
1 parent 96aa99e commit d6df44f
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 1 deletion.
6 changes: 6 additions & 0 deletions examples/platforms/simulation/ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,9 @@ otError otPlatBleGapAdvSetData(otInstance *aInstance, uint8_t *aAdvertisementDat
OT_UNUSED_VARIABLE(aAdvertisementLen);
return OT_ERROR_NONE;
}

bool otPlatMultiradioSupport(otInstance *aInstance)
{
OT_UNUSED_VARIABLE(aInstance);
return false;
}
7 changes: 7 additions & 0 deletions include/openthread/platform/ble.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,13 @@ extern void otPlatBleGattServerOnWriteRequest(otInstance *aInstance, uint16_t aH
*/
otBleLinkCapabilities otPlatGetBleLinkCapabilities(otInstance *aInstance);

/**
* Function to retrieve from platform multiradio support of BLE and IEEE.
*
* @param[in] aInstance The OpenThread instance structure.
*
*/
bool otPlatMultiradioSupport(otInstance *aInstance);
/**
* @}
*
Expand Down
1 change: 1 addition & 0 deletions src/core/meshcop/tcat_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ uint8_t *TcatAgent::GetAdvertisementData(uint16_t &aLen)

DeviceTypeAndStatus tas;
tas.mRsv = 0;
tas.mMultiradioSupport = otPlatMultiradioSupport(&GetInstance());
tas.mIsCommisionned = Get<ActiveDatasetManager>().IsCommissioned();
tas.mThreadNetworkActive = Get<Mle::Mle>().IsAttached();
tas.mDeviceType = Get<Mle::Mle>().GetDeviceMode().IsFullThreadDevice();
Expand Down
4 changes: 3 additions & 1 deletion src/core/meshcop/tcat_agent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,9 @@ typedef UintTlvInfo<MeshCoP::TcatAgent::kTlvResponseWithStatus, uint8_t> Respons
*/
struct DeviceTypeAndStatus
{
uint8_t mRsv : 3;
uint8_t mRsv : 1;
bool mMultiradioSupport : 1;
bool mStoresActiveopertonalDataset : 1;
bool mIsCommisionned : 1;
bool mThreadNetworkActive : 1;
bool mIsBorderRouter : 1;
Expand Down
6 changes: 6 additions & 0 deletions src/posix/platform/ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,9 @@ otError otPlatBleGapAdvSetData(otInstance *aInstance, uint8_t *aAdvertisementDat
OT_UNUSED_VARIABLE(aAdvertisementLen);
return OT_ERROR_NONE;
}

bool otPlatMultiradioSupport(otInstance *aInstance)
{
OT_UNUSED_VARIABLE(aInstance);
return false;
}
6 changes: 6 additions & 0 deletions tests/unit/test_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,12 @@ otBleLinkCapabilities otPlatGetBleLinkCapabilities(otInstance *aInstance)
return dummy;
}

bool otPlatMultiradioSupport(otInstance *aInstance)
{
OT_UNUSED_VARIABLE(aInstance);
return false;
}

otError otPlatBleGapAdvSetData(otInstance *aInstance, uint8_t *aAdvertisementData, uint16_t aAdvertisementLen)
{
OT_UNUSED_VARIABLE(aInstance);
Expand Down

0 comments on commit d6df44f

Please sign in to comment.