forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FHSS: Added copyright headers, comments etc.
- Loading branch information
Jarkko Paso
committed
Jan 10, 2018
1 parent
5d0f44e
commit 89a85a8
Showing
2 changed files
with
95 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2016-2017, Arm Limited and affiliates. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* @brief Calculate channel table based on TR51 channel function. | ||
* @param number_of_channels Number of channels in table. | ||
* @param nearest_prime Nearest prime number. Must be equal to or larger than number_of_channels. | ||
* @param channel_table Output channel table. Has to be at least nearest_prime in length. | ||
*/ | ||
void tr51_calculate_channel_table(uint16_t number_of_channels, uint16_t nearest_prime, int32_t *channel_table); | ||
|
||
/** | ||
* @brief Calculate hopping sequence for a specific peer. | ||
* @param channel_table Used channel table. | ||
* @param channel_table_length Length of the used channel table. | ||
* @param first_element Start generated by CFD function. | ||
* @param step_size Step size generated by CFD function. | ||
* @param output_table Output hopping sequence table. | ||
* @param excluded_channels List of not used channels. | ||
* @param number_of_excluded_channels Number of not used channels. | ||
* @return Number of channels in sequence. | ||
*/ | ||
uint16_t tr51_calculate_hopping_sequence(int32_t *channel_table, uint16_t channel_table_length, uint8_t first_element, uint8_t step_size, int32_t *output_table, uint16_t *excluded_channels, uint16_t number_of_excluded_channels); | ||
|
||
/** | ||
* @brief Compute the unicast schedule channel index. | ||
* @param slot_number Current slot number. | ||
* @param mac MAC address of the node for which the index is calculated. | ||
* @param number_of_channels Number of channels. | ||
* @return Channel index. | ||
*/ | ||
int32_t dh1cf_get_uc_channel_index(uint16_t slot_number, uint8_t *mac, int16_t number_of_channels); | ||
|
||
/** | ||
* @brief Compute the broadcast schedule channel index. | ||
* @param slot_number Current slot number. | ||
* @param bsi Broadcast schedule identifier of the node for which the index is calculated. | ||
* @param number_of_channels Number of channels. | ||
* @return Channel index. | ||
*/ | ||
int32_t dh1cf_get_bc_channel_index(uint16_t slot_number, uint16_t bsi, int16_t number_of_channels); |