Skip to content

Commit

Permalink
Pull request #62: Thermostat updates
Browse files Browse the repository at this point in the history
Merge in WMN_TOOLS/matter from thermostat_updates to RC_0.3.0

Squashed commit of the following:

commit 7d27ef4020e859b35c1f43b142c82af1eaed7a60
Author: shayna <shkausha@silabs.com>
Date:   Tue Sep 6 16:24:44 2022 -0400

    [thermo] get/set attributes done

commit ae9eee59524145a062dcf950ce07996c02c631aa
Author: Shayna Kaushal <shkausha@silabs.com>
Date:   Tue Sep 6 12:15:09 2022 -0400

    [thermo] jenkins: wifi thermostat build

commit 7ec590237f1c3de688953f0a408561275ea386c6
Author: Shayna Kaushal <shkausha@silabs.com>
Date:   Tue Sep 6 10:32:08 2022 -0400

    [thermo] jenkins trial

commit a6b5f390ab08c43611770d553f2b3b03985c4cbd
Author: Shayna Kaushal <shkausha@silabs.com>
Date:   Fri Sep 2 17:26:28 2022 -0400

    no changes - added comments to be removed

commit 818fb2fd098b5eb12f800c76329380d9cbdb5617
Author: Shayna Kaushal <shkausha@silabs.com>
Date:   Fri Sep 2 11:12:28 2022 -0400

    [thermo] some comments resolved, todo: read attributes

commit 64a2cf609bdfa0f40dab187aaedb4a24d95f205a
Author: Shayna Kaushal <shkausha@silabs.com>
Date:   Thu Sep 1 15:47:58 2022 -0400

    [thermo] cleaned

commit bb75e776644941054d06069608d370ee00f8f8f8
Author: Shayna Kaushal <shkausha@silabs.com>
Date:   Thu Sep 1 15:47:06 2022 -0400

    [thermo] cleaned

commit cec89f46cfa7011d5e8eabd6bdb09152a675a5b2
Author: Shayna Kaushal <shkausha@silabs.com>
Date:   Thu Sep 1 15:40:33 2022 -0400

    [thermo] readme edits

commit 20f1608706c0cdacefb8fbf72c62b54db0c64e64
Author: Shayna Kaushal <shkausha@silabs.com>
Date:   Thu Sep 1 15:23:06 2022 -0400

    [thermo] added limits

commit 9d012ab60ec602f809c6f1c2d8b7a8f1cfc465e7
Author: Shayna Kaushal <shkausha@silabs.com>
Date:   Thu Sep 1 12:56:23 2022 -0400

    [thermo] cleaned - todo: add limits, docs

commit 23150e76b129b9e0181965a987e6a0b62fbda651
Author: Shayna Kaushal <shkausha@silabs.com>
Date:   Thu Sep 1 10:16:27 2022 -0400

    code added, todo: clean+docs
  • Loading branch information
Shayna Kaushal authored and jmartinez-silabs committed Sep 8, 2022
1 parent 2d55b46 commit 2a7fdc4
Show file tree
Hide file tree
Showing 3 changed files with 447 additions and 20 deletions.
38 changes: 30 additions & 8 deletions examples/thermostat/efr32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@ An example showing the use of CHIP on the Silicon Labs EFR32 MG12.
- [CHIP EFR32 Light Switch Example](#chip-efr32-light-switch-example)
- [Introduction](#introduction)
- [Building](#building)
- [Note](#note)
- [Linux](#linux)
- [Mac OS X](#mac-os-x)
- [Flashing the Application](#flashing-the-application)
- [Viewing Logging Output](#viewing-logging-output)
- [Running the Complete Example](#running-the-complete-example)
- [Notes](#notes)
- [On Border Router:](#on-border-router)
- [On PC(Linux):](#on-pclinux)
- [Running RPC console](#running-rpc-console)
- [Memory settings](#memory-settings)
- [OTA Software Update](#ota-software-update)
- [Building options](#building-options)
- [Disabling logging](#disabling-logging)
- [Debug build / release build](#debug-build--release-build)
- [Disabling LCD](#disabling-lcd)
- [KVS maximum entry count](#kvs-maximum-entry-count)

<hr>

Expand Down Expand Up @@ -253,14 +261,28 @@ combination with JLinkRTTClient as follows:

**Push Button 0**

- _Press and Release_ : Start, or restart, BLE advertisement in fast mode. It will advertise in this mode
for 30 seconds. The device will then switch to a slower interval advertisement.
After 15 minutes, the advertisement stops.
- _Press and Release_ :

- _Pressed and hold for 6 s_ : Initiates the factory reset of the device.
Releasing the button within the 6-second window cancels the factory reset
procedure. **LEDs** blink in unison when the factory reset procedure is
initiated.
- Decreases temperature by 0.01C depending on current mode.

- Start, or restart, BLE advertisement in fast mode. It will advertise
in this mode for 30 seconds. The device will then switch to a
slower interval advertisement.
After 15 minutes, the advertisement stops.

- _Pressed and hold for 6.5 s_ : Initiates the factory reset of the device.
Releasing button within the 0.5-second window cancels initiation of factory
reset.
Releasing the button within the 6-second window post that cancels the
factory reset procedure. **LEDs** blink in unison when the factory reset
procedure is initiated.

**Push Button 1**

- _Press and Release_ : Increases temperature by 0.01C depending on current
mode.

- _Pressed and hold for 1 s_ : Toggles the mode of the thermostat.

* You can provision and control the Chip device using the python controller,
[CHIPTool](https://github.com/project-chip/connectedhomeip/blob/master/examples/chip-tool/README.md)
Expand Down
72 changes: 68 additions & 4 deletions examples/thermostat/efr32/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ class AppTask : public BaseApplication
*/
static void OnIdentifyStop(Identify * identify);

enum ThermoFunction_t
{
kFunction_Nothing = 0,
kFunction_AppFn = 1,
kFunction_Temp = 2,

kFunction_Invalid
} ThermoFunction;

private:
static AppTask sAppTask;

Expand All @@ -113,10 +122,65 @@ class AppTask : public BaseApplication
static void ButtonHandler(AppEvent * aEvent);

/**
* @brief PB1 Button event processing function
* Function triggers a thermostat action sent to the CHIP task
* @brief Function called to start the mode timer
*
* @param aEvent button event being processed
* @param aTimeoutMs timer duration in ms
*/
static void StartModeTimer(uint32_t aTimeoutInMs);

/**
* @brief Function to stop the mode timer
*/
static void CancelModeTimer();

/**
* @brief Function called to start the app function timer
*
* @param aTimeoutMs timer duration in ms
*/
static void StartAppFnTimer(uint32_t aTimeoutInMs);

/**
* @brief Function to stop app function timer
*/
static void CancelAppFnTimer();

/**
* @brief Mode Timer finished callback function
* Post an ModeHandler event
*
* @param xTimer timer that finished
*/
static void ModeTimerEventHandler(TimerHandle_t xTimer);

/**
* @brief App Function Timer finished callback function
* Post an AppFnHandler event
*
* @param xTimer timer that finished
*/
static void AppFnTimerEventHandler(TimerHandle_t xTimer);

/**
* @brief Mode Timer Event processing function
* Handles toggling the mode
*
* @param aEvent post event being processed
*/
static void ModeHandler(AppEvent * aEvent);

/**
* @brief App Function Timer Event processing function
* Calls factory reset handler from BaseApplication.cpp
*
* @param aEvent post event being processed
*/
static void AppFnHandler(AppEvent * aEvent);

/**
* @brief Handles temperature changes depending on timer status
*
* @param aEvent post event being processed
*/
static void ThermostatActionEventHandler(AppEvent * aEvent);
static void TemperatureHandler(AppEvent * aEvent);
};
Loading

0 comments on commit 2a7fdc4

Please sign in to comment.