File tree 3 files changed +18
-2
lines changed
examples/tv-app/tv-common/include
protocols/user_directed_commissioning
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 30
30
// TVs need to be commissioners and likely want to be discoverable
31
31
#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 1
32
32
33
+ // TVs can handle the memory impact of supporting a larger list
34
+ #define CHIP_DEVICE_CONFIG_UDC_MAX_TARGET_APPS 10
35
+
33
36
// TVs will often enable this feature
34
37
#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_PASSCODE 1
35
38
Original file line number Diff line number Diff line change @@ -749,6 +749,19 @@ static_assert(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN <= CHIP_DEVICE
749
749
#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 0
750
750
#endif
751
751
752
+ /**
753
+ * CHIP_DEVICE_CONFIG_UDC_MAX_TARGET_APPS
754
+ *
755
+ * The number of target apps that a client can include in a UDC message.
756
+ *
757
+ * Depends upon CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY set to 1
758
+ *
759
+ * For Video Players, this value should be set to 10
760
+ */
761
+ #ifndef CHIP_DEVICE_CONFIG_UDC_MAX_TARGET_APPS
762
+ #define CHIP_DEVICE_CONFIG_UDC_MAX_TARGET_APPS 3
763
+ #endif
764
+
752
765
/**
753
766
* CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
754
767
*
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ class UDCClientState
143
143
144
144
bool AddTargetAppInfo (TargetAppInfo vid)
145
145
{
146
- if (mNumTargetAppInfos >= sizeof ( mTargetAppInfos ) )
146
+ if (mNumTargetAppInfos >= kMaxTargetAppInfos )
147
147
{
148
148
// already at max
149
149
return false ;
@@ -225,7 +225,7 @@ class UDCClientState
225
225
char mPairingInst [chip::Dnssd::kMaxPairingInstructionLen + 1 ] = {};
226
226
uint16_t mPairingHint = 0 ;
227
227
228
- constexpr static size_t kMaxTargetAppInfos = 10 ;
228
+ constexpr static size_t kMaxTargetAppInfos = CHIP_DEVICE_CONFIG_UDC_MAX_TARGET_APPS ;
229
229
uint8_t mNumTargetAppInfos = 0 ; // number of vendor Ids
230
230
TargetAppInfo mTargetAppInfos [kMaxTargetAppInfos ];
231
231
You can’t perform that action at this time.
0 commit comments