Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
edmont committed Oct 2, 2024
1 parent 86bf28c commit 4632397
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 156 deletions.
23 changes: 16 additions & 7 deletions include/openthread/link.h
Original file line number Diff line number Diff line change
Expand Up @@ -1132,14 +1132,21 @@ otError otLinkSetWakeupChannel(otInstance *aInstance, uint8_t aChannel);
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aEnable true to enable listening for wake-up frames, or false otherwise.
*
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
*
* @retval OT_ERROR_NONE Successfully enabled / disabled the listening for wake-up frames.
* @retval OT_ERROR_INVALID_STATE Could not enable listening for wake-up frames due to bad configuration.
*/
otError otLinkWedListenSetEnabled(otInstance *aInstance, bool aEnable);
otError otLinkSetWedListenEnabled(otInstance *aInstance, bool aEnable);

/**
* Returns whether listening for wake-up frames is enabled.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
*
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
* @retval TRUE If listening for wake-up frames is enabled.
* @retval FALSE If listening for wake-up frames is not enabled.
*/
Expand All @@ -1148,6 +1155,8 @@ bool otLinkIsWedListenEnabled(otInstance *aInstance);
/**
* Gets the WED listen interval in microseconds.
*
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @returns The WED listen interval in microseconds.
Expand All @@ -1157,20 +1166,18 @@ uint32_t otLinkGetWedListenInterval(otInstance *aInstance);
/**
* Sets the WED listen interval in microseconds.
*
* The WED listen interval must be a multiple of `OT_LINK_CSL_PERIOD_TEN_SYMBOLS_UNIT_IN_USEC`, otherwise
* `OT_ERROR_INVALID_ARGS` is returned.
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aInterval The WED listen interval in microseconds.
*
* @retval OT_ERROR_NONE Successfully set the WED listen interval.
* @retval OT_ERROR_INVALID_ARGS Invalid WED listen interval.
*/
otError otLinkSetWedListenInterval(otInstance *aInstance, uint32_t aInterval);
void otLinkSetWedListenInterval(otInstance *aInstance, uint32_t aInterval);

/**
* Gets the WED listen duration.
*
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @returns The WED listen duration in microseconds.
Expand All @@ -1180,6 +1187,8 @@ uint16_t otLinkGetWedListenDuration(otInstance *aInstance);
/**
* Sets the WED listen duration in microseconds.
*
* Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aDuration The WED listen duration in microseconds.
*
Expand Down
74 changes: 42 additions & 32 deletions src/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ Done
- [vendor](#vendor-name)
- [verhoeff](#verhoeff-calculate)
- [version](#version)
- [wakeup](#wakeup)
- [wakeupchannel](#wakeupchannel)
- [wakeup](#wakeup-channel)

## OpenThread Command Details

Expand Down Expand Up @@ -4394,83 +4393,94 @@ Factory Diagnostics module is enabled only when building OpenThread with `OPENTH
[diag]: ../../src/core/diags/README.md
### wakeup
### wakeup channel
Get the Wake-up End Device listen configuration.
Get the wake-up channel.
`OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE` is required.
Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` or `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
```bash
> wakeup
channel: 12
interval: 1000000us
duration: 8000us
> wakeup channel
12
Done
```
### wakeup enable
### wakeup channel \<channel\>
Enable the WED listening feature.
Set the wake-up channel.
`OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE` is required.
Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` or `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
```bash
> wakeup enable
> wakeupchannel 12
Done
```
### wakeup disable
### wakeup interval
Disable the WED listening feature.
Get the wake-up interval.
`OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE` is required.
Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
```bash
> wakeup disable
> wakeup interval
1000000
Done
```
### wakeup state
### wakeup interval \<interval\>
Shows the WED listening state, among `disabled` and `enabled`.
Set the wake-up interval.
`OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE` is required.
Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
```bash
> wakeup state
enabled
> wakeup interval 1000000
Done
```
### wakeup interval \<interval\>
### wakeup duration
Set the WED listen interval in microseconds. Disable WED listening by setting this parameter to `0`.
Get the wake-up duration.
`OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE` is required.
Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
```bash
> wakeup interval 1000000
> wakeup duration
8000
Done
```
### wakeup duration \<duration\>
Set the WED listen duration in microseconds.
Set the wake-up duration.
`OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE` is required.
Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
```bash
> wakeup duration 8000
Done
```
### wakeupchannel \<channel\>
### wakeup listen
Set the wake-up channel.
Show the state of wake-up listening feature.
Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` or `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
`OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE` is required.
```bash
> wakeupchannel 12
> wakeup listen
Enabled
Done
```
### wakeup listen \[enable|disable\]
Enable/disable listening for wake-up frames.
`OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE` is required.
```bash
> wakeup listen enable
Done
```
Loading

0 comments on commit 4632397

Please sign in to comment.