Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
mbed-os/features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack/nanostack/net_sleep.h@0:02dd72d1d465, 2018-04-24 (annotated)
- Committer:
- borlanic
- Date:
- Tue Apr 24 11:45:18 2018 +0000
- Revision:
- 0:02dd72d1d465
BaBoRo_test2 - backup 1
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| borlanic | 0:02dd72d1d465 | 1 | /* |
| borlanic | 0:02dd72d1d465 | 2 | * Copyright (c) 2014-2017, Arm Limited and affiliates. |
| borlanic | 0:02dd72d1d465 | 3 | * SPDX-License-Identifier: Apache-2.0 |
| borlanic | 0:02dd72d1d465 | 4 | * |
| borlanic | 0:02dd72d1d465 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| borlanic | 0:02dd72d1d465 | 6 | * you may not use this file except in compliance with the License. |
| borlanic | 0:02dd72d1d465 | 7 | * You may obtain a copy of the License at |
| borlanic | 0:02dd72d1d465 | 8 | * |
| borlanic | 0:02dd72d1d465 | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| borlanic | 0:02dd72d1d465 | 10 | * |
| borlanic | 0:02dd72d1d465 | 11 | * Unless required by applicable law or agreed to in writing, software |
| borlanic | 0:02dd72d1d465 | 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| borlanic | 0:02dd72d1d465 | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| borlanic | 0:02dd72d1d465 | 14 | * See the License for the specific language governing permissions and |
| borlanic | 0:02dd72d1d465 | 15 | * limitations under the License. |
| borlanic | 0:02dd72d1d465 | 16 | */ |
| borlanic | 0:02dd72d1d465 | 17 | |
| borlanic | 0:02dd72d1d465 | 18 | #ifndef NET_SLEEP_H_ |
| borlanic | 0:02dd72d1d465 | 19 | #define NET_SLEEP_H_ |
| borlanic | 0:02dd72d1d465 | 20 | |
| borlanic | 0:02dd72d1d465 | 21 | #include "ns_types.h" |
| borlanic | 0:02dd72d1d465 | 22 | |
| borlanic | 0:02dd72d1d465 | 23 | /** |
| borlanic | 0:02dd72d1d465 | 24 | * \file net_sleep.h |
| borlanic | 0:02dd72d1d465 | 25 | * \brief Checks if there is a sleep possibility for the stack and the max sleep time. |
| borlanic | 0:02dd72d1d465 | 26 | * |
| borlanic | 0:02dd72d1d465 | 27 | * \section check-slp-poss Checking sleep possibility. |
| borlanic | 0:02dd72d1d465 | 28 | * - arm_net_check_enter_deep_sleep_possibility(), Checks whether the stack can enter a sleep cycle. |
| borlanic | 0:02dd72d1d465 | 29 | * - arm_net_enter_sleep(), A function to enter sleep cycle. |
| borlanic | 0:02dd72d1d465 | 30 | * - arm_net_wakeup_and_timer_synch(), Restarts the stack and synchronizes the timer. |
| borlanic | 0:02dd72d1d465 | 31 | */ |
| borlanic | 0:02dd72d1d465 | 32 | |
| borlanic | 0:02dd72d1d465 | 33 | /** |
| borlanic | 0:02dd72d1d465 | 34 | *\brief Check sleep possibility. |
| borlanic | 0:02dd72d1d465 | 35 | * \return Time in milliseconds for sleep. |
| borlanic | 0:02dd72d1d465 | 36 | * \return 0, No possibility to enter deep sleep. |
| borlanic | 0:02dd72d1d465 | 37 | */ |
| borlanic | 0:02dd72d1d465 | 38 | uint32_t arm_net_check_enter_deep_sleep_possibility(void); |
| borlanic | 0:02dd72d1d465 | 39 | |
| borlanic | 0:02dd72d1d465 | 40 | /** |
| borlanic | 0:02dd72d1d465 | 41 | * \brief Set stack to sleep. |
| borlanic | 0:02dd72d1d465 | 42 | * |
| borlanic | 0:02dd72d1d465 | 43 | * \return 0 Stack stopped. |
| borlanic | 0:02dd72d1d465 | 44 | * \return -1 Not supported action at the moment. |
| borlanic | 0:02dd72d1d465 | 45 | * |
| borlanic | 0:02dd72d1d465 | 46 | */ |
| borlanic | 0:02dd72d1d465 | 47 | |
| borlanic | 0:02dd72d1d465 | 48 | int arm_net_enter_sleep(void); |
| borlanic | 0:02dd72d1d465 | 49 | /** |
| borlanic | 0:02dd72d1d465 | 50 | * \brief Restart stack after sleep. |
| borlanic | 0:02dd72d1d465 | 51 | * |
| borlanic | 0:02dd72d1d465 | 52 | * Stack enable and synch timers after sleep. |
| borlanic | 0:02dd72d1d465 | 53 | * |
| borlanic | 0:02dd72d1d465 | 54 | * \param sleeped_time_in_ms The total sleep time in milliseconds. The stack needs to synch with this. |
| borlanic | 0:02dd72d1d465 | 55 | * |
| borlanic | 0:02dd72d1d465 | 56 | * \return 0 Stack restarted. |
| borlanic | 0:02dd72d1d465 | 57 | * \return 1 Stack can continue sleep for the time defined in sleeped_time_in_ms. |
| borlanic | 0:02dd72d1d465 | 58 | * \return -1 Stack already active. |
| borlanic | 0:02dd72d1d465 | 59 | * |
| borlanic | 0:02dd72d1d465 | 60 | */ |
| borlanic | 0:02dd72d1d465 | 61 | int arm_net_wakeup_and_timer_synch(uint32_t sleeped_time_in_ms); |
| borlanic | 0:02dd72d1d465 | 62 | |
| borlanic | 0:02dd72d1d465 | 63 | |
| borlanic | 0:02dd72d1d465 | 64 | #endif /* NET_SLEEP_H_ */ |