Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers net_sleep.h Source File

net_sleep.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2014-2017, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef NET_SLEEP_H_
00019 #define NET_SLEEP_H_
00020 
00021 #include "ns_types.h"
00022 
00023 /**
00024  * \file net_sleep.h
00025  * \brief Checks if there is a sleep possibility for the stack and the max sleep time.
00026  *
00027  * \section check-slp-poss Checking sleep possibility.
00028  * - arm_net_check_enter_deep_sleep_possibility(), Checks whether the stack can enter a sleep cycle.
00029  * - arm_net_enter_sleep(), A function to enter sleep cycle.
00030  * - arm_net_wakeup_and_timer_synch(), Restarts the stack and synchronizes the timer.
00031  */
00032 
00033 /**
00034  *\brief Check sleep possibility.
00035  * \return Time in milliseconds for sleep.
00036  * \return 0,  No possibility to enter deep sleep.
00037  */
00038 uint32_t arm_net_check_enter_deep_sleep_possibility(void);
00039 
00040 /**
00041  * \brief Set stack to sleep.
00042  *
00043  * \return 0 Stack stopped.
00044  * \return -1 Not supported action at the moment.
00045  *
00046  */
00047 
00048 int arm_net_enter_sleep(void);
00049 /**
00050  * \brief Restart stack after sleep.
00051  *
00052  *  Stack enable and synch timers after sleep.
00053  *
00054  *  \param sleeped_time_in_ms The total sleep time in milliseconds. The stack needs to synch with this.
00055  *
00056  * \return 0 Stack restarted.
00057  * \return 1 Stack can continue sleep for the time defined in sleeped_time_in_ms.
00058  * \return -1 Stack already active.
00059  *
00060  */
00061 int arm_net_wakeup_and_timer_synch(uint32_t sleeped_time_in_ms);
00062 
00063 
00064 #endif /* NET_SLEEP_H_ */