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.
Fork of OmniWheels by
net_polling_api.h File Reference
ZigBeeIP Sleepy Host Data Poll API. More...
Go to the source code of this file.
Enumerations | |
| enum | net_host_mode { NET_HOST_FAST_POLL_MODE, NET_HOST_SLOW_POLL_MODE, NET_HOST_RX_ON_IDLE, NET_HOST_MODE_NOT_ACTIVE } |
Functions | |
| int8_t | arm_nwk_host_mode_set (int8_t interface_id, net_host_mode_t mode, uint32_t poll_time) |
| Set new host state. | |
| int8_t | arm_nwk_host_mode_get (int8_t interface_id, net_host_mode_t *mode) |
| Read current host state. | |
| void | arm_net_host_enter_sleep_state_set (int8_t interface_id, uint8_t state) |
| Host sleep state control. | |
Detailed Description
ZigBeeIP Sleepy Host Data Poll API.
- arm_nwk_host_mode_set(), Set sleepy host new state.
- arm_nwk_host_mode_get(), Read current host state.
- net_host_enter_sleep_state_set(), Enable deep sleep state.
The sleepy host default state is NET_HOST_FAST_POLL_MODE after bootstrap. The stack always disables radio automatically between data polls. The stack can also enable deep sleep when application net_host_enter_sleep_state_set().
A sleepy host can change the host state to normal, which saves time and resources when the client is waiting for a large amount of data.
- nwk_host_mode_set(NET_HOST_RX_ON_IDLE,0) A function call to trigger MLE handshake update automatically. From NET_HOST_RX_ON_IDLE state back to polling state causes an MLE handshake with parent:
- nwk_host_mode_set (NET_HOST_FAST_POLL_MODE,0), Enter fast mode.
- nwk_host_mode_set (NET_HOST_SLOW_POLL_MODE,10), Enter slow poll mode by 10 seconds max data poll period.
The stack will tell max sleepy time to the application by selecting min values from the following cases:
- Next active system timer trigger
- ND protocol next state trigger
- MLE handshake trigger
- PANA key pull trigger
- Next data poll period
Definition in file net_polling_api.h.
Enumeration Type Documentation
| enum net_host_mode |
- Enumerator:
Definition at line 58 of file net_polling_api.h.
Function Documentation
| void arm_net_host_enter_sleep_state_set | ( | int8_t | interface_id, |
| uint8_t | state | ||
| ) |
Host sleep state control.
- Parameters:
-
interface_id Network interface ID. state >0 enables power saving between data polling. Otherwise, only radio is disabled.
When the application wants to save more power it can call net_host_enter_sleep_state_set(nwk_interface_id, 1). When the application wants to disable sleep it just calls net_host_enter_sleep_state_set(nwk_interface_id, 0).
Host sleep state control.
- Parameters:
-
state equals to 1 if the sleep mode is to be enabled, 0 if the sleep mode is to be disabled.
| int8_t arm_nwk_host_mode_get | ( | int8_t | interface_id, |
| net_host_mode_t * | mode | ||
| ) |
Read current host state.
- Parameters:
-
interface_id Network interface ID. mode A pointer to the location for saving the host state.
- Returns:
- 0, State read update OK.
- -1, The host role is router or the stack is idle.
Read current host state.
- Parameters:
-
mode pointer where host state will be saved
- Returns:
- 0, State Read update OK
- -1, Net Role is Router or stack is idle
| int8_t arm_nwk_host_mode_set | ( | int8_t | interface_id, |
| net_host_mode_t | mode, | ||
| uint32_t | poll_time | ||
| ) |
Set new host state.
- Parameters:
-
interface_id Network interface ID. mode New host state. poll_time Poll time in seconds, only handled when NET_HOST_SLOW_POLL_MODE is enabled.
Valid poll time for NET_HOST_SLOW_POLL_MODE is 0 < poll_time poll_time < 864001 (1 Day)
- Returns:
- 0, State update OK.
- -1, Unknown state.
- -2, Invalid time.
- -3 MLE handshake trigger failure.
Set new host state.
- Parameters:
-
mode new host state poll_time poll time in seconds only handled when NET_HOST_SLOW_POLL_MODE is enabled
Valid poll time for NET_HOST_SLOW_POLL_MODE is 0 < poll_time poll_time < 864001 (1 Day)
- Returns:
- 0, State update OK
- -1, unknown state
- -2, invalid time
- -3 MLE handshake trig Fail
Generated on Fri Jul 22 2022 04:54:07 by
1.7.2
