Skip to content

Commit 4ff2071

Browse files
authored
Merge branch 'master' into add-water-heater-mode-sdk-code
2 parents 16198cd + ba949bf commit 4ff2071

File tree

14 files changed

+378
-180
lines changed

14 files changed

+378
-180
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
65 : [nrfconnect] Update nRF Connect SDK version.
1+
66 : [Telink] Update Docker image (Zephyr update)

integrations/docker/images/stage-2/chip-build-telink/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN set -x \
1818
&& : # last line
1919

2020
# Setup Zephyr
21-
ARG ZEPHYR_REVISION=ab81a585fca6a83b30e1f4e58a021113d6a3acb8
21+
ARG ZEPHYR_REVISION=ef7bfc2214602ecf237332b71e6a2bdd69205fbd
2222
WORKDIR /opt/telink/zephyrproject
2323
RUN set -x \
2424
&& python3 -m pip install --break-system-packages -U --no-cache-dir west \

scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307
{ (uint16_t) 0xBB8, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MaxHeatSetpointLimit */ \
308308
{ (uint16_t) 0x640, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MinCoolSetpointLimit */ \
309309
{ (uint16_t) 0xC80, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MaxCoolSetpointLimit */ \
310-
{ (uint16_t) 0x19, (uint16_t) 0x0, (uint16_t) 0x7F }, /* MinSetpointDeadBand */ \
310+
{ (uint16_t) 0x19, (uint16_t) 0x0, (uint16_t) 0x19 }, /* MinSetpointDeadBand */ \
311311
{ (uint16_t) 0x4, (uint16_t) 0x0, (uint16_t) 0x5 }, /* ControlSequenceOfOperation */ \
312312
{ (uint16_t) 0x1, (uint16_t) 0x0, (uint16_t) 0x9 }, /* SystemMode */ \
313313
\

src/app/ReadClient.cpp

+21-1
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,11 @@ CHIP_ERROR ReadClient::BuildDataVersionFilterList(DataVersionFilterIBs::Builder
403403
const Span<DataVersionFilter> & aDataVersionFilters,
404404
bool & aEncodedDataVersionList)
405405
{
406+
#if CHIP_PROGRESS_LOGGING
407+
size_t encodedFilterCount = 0;
408+
size_t irrelevantFilterCount = 0;
409+
size_t skippedFilterCount = 0;
410+
#endif
406411
for (auto & filter : aDataVersionFilters)
407412
{
408413
VerifyOrReturnError(filter.IsValidDataVersionFilter(), CHIP_ERROR_INVALID_ARGUMENT);
@@ -420,6 +425,9 @@ CHIP_ERROR ReadClient::BuildDataVersionFilterList(DataVersionFilterIBs::Builder
420425

421426
if (!intersected)
422427
{
428+
#if CHIP_PROGRESS_LOGGING
429+
++irrelevantFilterCount;
430+
#endif
423431
continue;
424432
}
425433

@@ -428,19 +436,31 @@ CHIP_ERROR ReadClient::BuildDataVersionFilterList(DataVersionFilterIBs::Builder
428436
CHIP_ERROR err = EncodeDataVersionFilter(aDataVersionFilterIBsBuilder, filter);
429437
if (err == CHIP_NO_ERROR)
430438
{
439+
#if CHIP_PROGRESS_LOGGING
440+
++encodedFilterCount;
441+
#endif
431442
aEncodedDataVersionList = true;
432443
}
433444
else if (err == CHIP_ERROR_NO_MEMORY || err == CHIP_ERROR_BUFFER_TOO_SMALL)
434445
{
435446
// Packet is full, ignore the rest of the list
436447
aDataVersionFilterIBsBuilder.Rollback(backup);
437-
return CHIP_NO_ERROR;
448+
#if CHIP_PROGRESS_LOGGING
449+
ssize_t nonSkippedFilterCount = &filter - aDataVersionFilters.data();
450+
skippedFilterCount = aDataVersionFilters.size() - static_cast<size_t>(nonSkippedFilterCount);
451+
#endif // CHIP_PROGRESS_LOGGING
452+
break;
438453
}
439454
else
440455
{
441456
return err;
442457
}
443458
}
459+
460+
ChipLogProgress(DataManagement,
461+
"%lu data version filters provided, %lu not relevant, %lu encoded, %lu skipped due to lack of space",
462+
static_cast<unsigned long>(aDataVersionFilters.size()), static_cast<unsigned long>(irrelevantFilterCount),
463+
static_cast<unsigned long>(encodedFilterCount), static_cast<unsigned long>(skippedFilterCount));
444464
return CHIP_NO_ERROR;
445465
}
446466

src/app/chip_data_model.gni

+1
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ template("chip_data_model") {
414414
":${_data_model_name}_zapgen",
415415
"${chip_root}/src/access",
416416
"${chip_root}/src/app",
417+
"${chip_root}/src/app/cluster-building-blocks",
417418
"${chip_root}/src/app/common:attribute-type",
418419
"${chip_root}/src/app/common:cluster-objects",
419420
"${chip_root}/src/app/common:enums",

src/app/clusters/level-control/level-control.cpp

+129-69
Large diffs are not rendered by default.

src/app/clusters/thermostat-server/thermostat-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ MatterThermostatClusterServerPreAttributeChangedCallback(const app::ConcreteAttr
409409
requested = *value;
410410
if (!AutoSupported)
411411
return imcode::UnsupportedAttribute;
412-
if (requested < 0 || requested > 127)
412+
if (requested < 0 || requested > 25)
413413
return imcode::InvalidValue;
414414
return imcode::Success;
415415
}

src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ tests:
243243
response:
244244
constraints:
245245
type: int8s
246-
minValue: -127
247-
maxValue: 127
246+
minValue: -25
247+
maxValue: 25
248248

249249
- label: "Step 13a: TH reads attribute OccupiedCoolingSetpoint from the DUT"
250250
PICS: TSTAT.S.F01 && TSTAT.S.A0017 && TSTAT.S.A0018
@@ -426,7 +426,7 @@ tests:
426426
constraints:
427427
type: int8s
428428
minValue: 0
429-
maxValue: 127
429+
maxValue: 25
430430

431431
- label: "Step 22: TH reads the RemoteSensing attribute from the DUT"
432432
PICS: TSTAT.S.A001a

src/app/zap-templates/zcl/data-model/chip/global-structs.xml

+21
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,25 @@ TODO: Make these structures global rather than defining them for each cluster.
3131
<item fieldId="1" name="FloorNumber" type="int16s" isNullable="true" optional="false"/>
3232
<item fieldId="2" name="AreaType" type="AreaTypeTag" isNullable="true" optional="false"/>
3333
</struct>
34+
35+
<!--
36+
These are test global items (no cluster attached) for testing only.
37+
Their usage is defined for UnitTestCluster only.
38+
-->
39+
<bitmap name="TestGlobalBitmap" type="bitmap32">
40+
<field mask="0x01" name="FirstBit" />
41+
<field mask="0x02" name="SecondBit" />
42+
</bitmap>
43+
44+
<enum name="TestGlobalEnum" type="enum8">
45+
<item name="SomeValue" value="0x00"/>
46+
<item name="SomeOtherValue" value="0x01"/>
47+
<item name="FinalValue" value="0x02"/>
48+
</enum>
49+
50+
<struct name="TestGlobalStruct">
51+
<item fieldId="0" name="Name" type="char_string" length="128" isNullable="false" optional="false"/>
52+
<item fieldId="1" name="MyBitmap" type="TestGlobalBitmap" isNullable="true" optional="false"/>
53+
<item fieldId="2" name="MyEnum" type="TestGlobalEnum" isNullable="true" optional="true"/>
54+
</struct>
3455
</configurator>

src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ limitations under the License.
337337
<access op="read" privilege="view"/>
338338
<access op="write" privilege="manage"/>
339339
</attribute>
340-
<attribute side="server" code="0x0010" define="LOCAL_TEMPERATURE_CALIBRATION" type="int8s" min="-127" max="127" writable="true" default="0x00" optional="true">
340+
<attribute side="server" code="0x0010" define="LOCAL_TEMPERATURE_CALIBRATION" type="int8s" min="0xE7" max="0x19" writable="true" default="0x00" optional="true">
341341
<description>LocalTemperatureCalibration</description>
342342
<access op="write" privilege="manage"/>
343343
</attribute>
@@ -361,7 +361,7 @@ limitations under the License.
361361
<description>MaxCoolSetpointLimit</description>
362362
<access op="write" privilege="manage"/>
363363
</attribute>
364-
<attribute side="server" code="0x0019" define="MIN_SETPOINT_DEAD_BAND" type="int8s" min="0" max="127" writable="true" default="25" optional="true">
364+
<attribute side="server" code="0x0019" define="MIN_SETPOINT_DEAD_BAND" type="int8s" min="0" max="25" writable="true" default="25" optional="true">
365365
<description>MinSetpointDeadBand</description>
366366
<access op="write" privilege="manage"/>
367367
</attribute>

src/controller/python/ChipDeviceController-ScriptBinding.cpp

+58-3
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ PyChipError pychip_DeviceCommissioner_CloseBleConnection(chip::Controller::Devic
213213
const char * pychip_Stack_StatusReportToString(uint32_t profileId, uint16_t statusCode);
214214

215215
PyChipError pychip_GetConnectedDeviceByNodeId(chip::Controller::DeviceCommissioner * devCtrl, chip::NodeId nodeId,
216-
chip::Controller::Python::PyObject * context, DeviceAvailableFunc callback);
216+
chip::Controller::Python::PyObject * context, DeviceAvailableFunc callback,
217+
int transportPayloadCapability);
217218
PyChipError pychip_FreeOperationalDeviceProxy(chip::OperationalDeviceProxy * deviceProxy);
218219
PyChipError pychip_GetLocalSessionId(chip::OperationalDeviceProxy * deviceProxy, uint16_t * localSessionId);
219220
PyChipError pychip_GetNumSessionsToPeer(chip::OperationalDeviceProxy * deviceProxy, uint32_t * numSessions);
@@ -239,6 +240,13 @@ void pychip_Storage_ShutdownAdapter(chip::Controller::Python::StorageAdapter * s
239240
// ICD
240241
//
241242
void pychip_CheckInDelegate_SetOnCheckInCompleteCallback(PyChipCheckInDelegate::OnCheckInCompleteCallback * callback);
243+
244+
//
245+
// LargePayload and TCP
246+
PyChipError pychip_SessionAllowsLargePayload(chip::OperationalDeviceProxy * deviceProxy, bool * allowsLargePayload);
247+
PyChipError pychip_IsSessionOverTCPConnection(chip::OperationalDeviceProxy * deviceProxy, bool * isSessionOverTCP);
248+
PyChipError pychip_IsActiveSession(chip::OperationalDeviceProxy * deviceProxy, bool * isActiveSession);
249+
PyChipError pychip_CloseTCPConnectionWithPeer(chip::OperationalDeviceProxy * deviceProxy);
242250
}
243251

244252
void * pychip_Storage_InitializeStorageAdapter(chip::Controller::Python::PyObject * context,
@@ -807,11 +815,58 @@ struct GetDeviceCallbacks
807815
} // anonymous namespace
808816

809817
PyChipError pychip_GetConnectedDeviceByNodeId(chip::Controller::DeviceCommissioner * devCtrl, chip::NodeId nodeId,
810-
chip::Controller::Python::PyObject * context, DeviceAvailableFunc callback)
818+
chip::Controller::Python::PyObject * context, DeviceAvailableFunc callback,
819+
int transportPayloadCapability)
811820
{
812821
VerifyOrReturnError(devCtrl != nullptr, ToPyChipError(CHIP_ERROR_INVALID_ARGUMENT));
813822
auto * callbacks = new GetDeviceCallbacks(context, callback);
814-
return ToPyChipError(devCtrl->GetConnectedDevice(nodeId, &callbacks->mOnSuccess, &callbacks->mOnFailure));
823+
return ToPyChipError(devCtrl->GetConnectedDevice(nodeId, &callbacks->mOnSuccess, &callbacks->mOnFailure,
824+
static_cast<chip::TransportPayloadCapability>(transportPayloadCapability)));
825+
}
826+
827+
PyChipError pychip_SessionAllowsLargePayload(chip::OperationalDeviceProxy * deviceProxy, bool * allowsLargePayload)
828+
{
829+
VerifyOrReturnError(deviceProxy->GetSecureSession().HasValue(), ToPyChipError(CHIP_ERROR_MISSING_SECURE_SESSION));
830+
VerifyOrReturnError(allowsLargePayload != nullptr, ToPyChipError(CHIP_ERROR_INVALID_ARGUMENT));
831+
832+
*allowsLargePayload = deviceProxy->GetSecureSession().Value()->AsSecureSession()->AllowsLargePayload();
833+
834+
return ToPyChipError(CHIP_NO_ERROR);
835+
}
836+
837+
PyChipError pychip_IsSessionOverTCPConnection(chip::OperationalDeviceProxy * deviceProxy, bool * isSessionOverTCP)
838+
{
839+
VerifyOrReturnError(deviceProxy->GetSecureSession().HasValue(), ToPyChipError(CHIP_ERROR_MISSING_SECURE_SESSION));
840+
VerifyOrReturnError(isSessionOverTCP != nullptr, ToPyChipError(CHIP_ERROR_INVALID_ARGUMENT));
841+
842+
*isSessionOverTCP = deviceProxy->GetSecureSession().Value()->AsSecureSession()->GetTCPConnection() != nullptr;
843+
844+
return ToPyChipError(CHIP_NO_ERROR);
845+
}
846+
847+
PyChipError pychip_IsActiveSession(chip::OperationalDeviceProxy * deviceProxy, bool * isActiveSession)
848+
{
849+
VerifyOrReturnError(isActiveSession != nullptr, ToPyChipError(CHIP_ERROR_INVALID_ARGUMENT));
850+
851+
*isActiveSession = false;
852+
if (deviceProxy->GetSecureSession().HasValue())
853+
{
854+
*isActiveSession = deviceProxy->GetSecureSession().Value()->AsSecureSession()->IsActiveSession();
855+
}
856+
857+
return ToPyChipError(CHIP_NO_ERROR);
858+
}
859+
860+
PyChipError pychip_CloseTCPConnectionWithPeer(chip::OperationalDeviceProxy * deviceProxy)
861+
{
862+
VerifyOrReturnError(deviceProxy->GetSecureSession().HasValue(), ToPyChipError(CHIP_ERROR_MISSING_SECURE_SESSION));
863+
VerifyOrReturnError(deviceProxy->GetSecureSession().Value()->AsSecureSession()->AllowsLargePayload(),
864+
ToPyChipError(CHIP_ERROR_INVALID_ARGUMENT));
865+
866+
deviceProxy->GetExchangeManager()->GetSessionManager()->TCPDisconnect(
867+
deviceProxy->GetSecureSession().Value()->AsSecureSession()->GetTCPConnection(), /* shouldAbort = */ false);
868+
869+
return ToPyChipError(CHIP_NO_ERROR);
815870
}
816871

817872
PyChipError pychip_FreeOperationalDeviceProxy(chip::OperationalDeviceProxy * deviceProxy)

0 commit comments

Comments
 (0)