|
21 | 21 |
|
22 | 22 | using namespace chip::DeviceLayer::Silabs;
|
23 | 23 |
|
24 |
| -namespace { |
25 |
| - |
26 |
| -// TODO: Once the platform sleep calls are unified, we can removed this ifdef |
27 |
| -#if SLI_SI917 // 917 SoC & NCP |
28 |
| - |
29 |
| -/** |
30 |
| - * @brief Configures the Wi-Fi Chip to go to LI based sleep. |
31 |
| - * Function sets the listen interval the ICD Transort Slow Poll configuration and enables the broadcast filter. |
32 |
| - * |
33 |
| - * @return CHIP_ERROR CHIP_NO_ERROR if the configuration of the Wi-Fi chip was successful; otherwise CHIP_ERROR_INTERNAL |
34 |
| - */ |
35 |
| -CHIP_ERROR ConfigureLIBasedSleep() |
36 |
| -{ |
37 |
| - ReturnLogErrorOnFailure(WifiInterface::GetInstance().ConfigureBroadcastFilter(true)); |
38 |
| - |
39 |
| - // Allowing the device to go to sleep must be the last actions to avoid configuration failures. |
40 |
| - ReturnLogErrorOnFailure(WifiInterface::GetInstance().ConfigurePowerSave( |
41 |
| - RSI_SLEEP_MODE_2, ASSOCIATED_POWER_SAVE, chip::ICDConfigurationData::GetInstance().GetSlowPollingInterval().count())); |
42 |
| - |
43 |
| - return CHIP_NO_ERROR; |
44 |
| -} |
45 |
| - |
46 |
| -/** |
47 |
| - * @brief Configures the Wi-Fi Chip to go to DTIM based sleep. |
48 |
| - * Function sets the listen interval to be synced with the DTIM beacon and disables the broadcast filter. |
49 |
| - * |
50 |
| - * @return CHIP_ERROR CHIP_NO_ERROR if the configuration of the Wi-Fi chip was successful; otherwise CHIP_ERROR_INTERNAL |
51 |
| - */ |
52 |
| -CHIP_ERROR ConfigureDTIMBasedSleep() |
53 |
| -{ |
54 |
| - ReturnLogErrorOnFailure(WifiInterface::GetInstance().ConfigureBroadcastFilter(false)); |
55 |
| - |
56 |
| - // Allowing the device to go to sleep must be the last actions to avoid configuration failures. |
57 |
| - ReturnLogErrorOnFailure(WifiInterface::GetInstance().ConfigurePowerSave(RSI_SLEEP_MODE_2, ASSOCIATED_POWER_SAVE, 0)); |
58 |
| - |
59 |
| - return CHIP_NO_ERROR; |
60 |
| -} |
61 |
| - |
62 |
| -/** |
63 |
| - * @brief Configures the Wi-Fi chip to go Deep Sleep. |
64 |
| - * Function doesn't change the state of the broadcast filter. |
65 |
| - * |
66 |
| - * @return CHIP_ERROR CHIP_NO_ERROR if the configuration of the Wi-Fi chip was successful; otherwise CHIP_ERROR_INTERNAL |
67 |
| - */ |
68 |
| -CHIP_ERROR ConfigureDeepSleep() |
69 |
| -{ |
70 |
| - ReturnLogErrorOnFailure(WifiInterface::GetInstance().ConfigurePowerSave(RSI_SLEEP_MODE_8, DEEP_SLEEP_WITH_RAM_RETENTION, 0)); |
71 |
| - return CHIP_NO_ERROR; |
72 |
| -} |
73 |
| - |
74 |
| -/** |
75 |
| - * @brief Configures the Wi-Fi chip to go to High Performance. |
76 |
| - * Function doesn't change the broad cast filter configuration. |
77 |
| - * |
78 |
| - * @return CHIP_ERROR CHIP_NO_ERROR if the configuration of the Wi-Fi chip was successful; otherwise CHIP_ERROR_INTERNAL |
79 |
| - */ |
80 |
| -CHIP_ERROR ConfigureHighPerformance() |
81 |
| -{ |
82 |
| - ReturnLogErrorOnFailure(WifiInterface::GetInstance().ConfigurePowerSave(RSI_ACTIVE, HIGH_PERFORMANCE, 0)); |
83 |
| - return CHIP_NO_ERROR; |
84 |
| -} |
85 |
| -#endif // SLI_SI917 |
86 |
| - |
87 |
| -} // namespace |
88 |
| - |
89 | 24 | namespace chip {
|
90 | 25 | namespace DeviceLayer {
|
91 | 26 | namespace Silabs {
|
|
0 commit comments