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.
Wi-sun neighbor hopping infor storage API definition
- Loading branch information
Showing
1 changed file
with
90 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* Copyright (c) 2018, 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. | ||
*/ | ||
|
||
#ifndef WS_NEIGHBOUR_CLASS_H_ | ||
#define WS_NEIGHBOUR_CLASS_H_ | ||
|
||
/** | ||
* Neighbour Channel hopping information | ||
*/ | ||
typedef struct ws_fhss_s { | ||
uint32_t utt_timestamp; /*!< Timestamp from MAC for Unicast time UTT-IE */ | ||
uint32_t bt_timestamp; /*!< Timestamp from MAC for Broadcast time BT-IE */ | ||
uint32_t broadcast_interval; | ||
uint32_t ufsi; /*!< Unicast Fractional Sequence Interval 24-bit */ | ||
uint32_t bti; /*!< Broadcast Interval_offset 24-bit */ | ||
uint16_t broadcast_slot_number; /*!< Broadcast Slot number */ | ||
uint16_t bsi; /*!< Broadcast schedule identifier */ | ||
uint8_t broadcast_dwell; | ||
uint8_t unicast_dwell; | ||
unsigned channel_function:3; | ||
} ws_fhss_t; | ||
|
||
|
||
typedef struct ws_neighbour_class_entry_s { | ||
ws_fhss_t fhhs_data; | ||
} ws_neighbour_class_entry_t; | ||
|
||
/** | ||
* Neighbour hopping info data base | ||
*/ | ||
typedef struct ws_neighbour_class_s { | ||
ws_neighbour_class_entry_t *neigh_info_list; /*!< Allocated hopping info array*/ | ||
uint8_t list_size; /*!< List size*/ | ||
} ws_neighbour_class_t; | ||
|
||
/** | ||
* ws_neighbour_class_alloc a function for allocate giving list size | ||
* | ||
* \param class_data pointer to structure which will be initialized by this function | ||
* \param list_size define list size | ||
* | ||
* \return true Allocate Ok | ||
* \return false Allocate Fail | ||
* | ||
*/ | ||
bool ws_neighbour_class_alloc(ws_neighbour_class_t *class_data, uint8_t list_size); | ||
|
||
/** | ||
* ws_neighbour_class_dealloc a function for free allocated neighbor hopping info | ||
* | ||
* \param class_data pointer to structure which will be initialized by this function | ||
* | ||
*/ | ||
void ws_neighbour_class_dealloc(ws_neighbour_class_t *class_data); | ||
|
||
/** | ||
* ws_neighbour_class_entry_get a function for search hopping info for giving neighbor attribut | ||
* | ||
* \param class_data pointer to structure which will be initialized by this function | ||
* \param attribute_index define pointer to storage info | ||
* | ||
* \return NULL when Attribute is not correct | ||
* \return Pointer to neighbor hopping info | ||
* | ||
*/ | ||
ws_neighbour_class_entry_t * ws_neighbour_class_entry_get(ws_neighbour_class_t *class_data, uint8_t attribute_index); | ||
/** | ||
* ws_neighbour_class_entry_remove a function for clean information should be call when neighbor is removed | ||
* | ||
* \param class_data pointer to structure which will be initialized by this function | ||
* \param attribute_index define pointer to storage info | ||
* | ||
*/ | ||
void ws_neighbour_class_entry_remove(ws_neighbour_class_t *class_data, uint8_t attribute_index); | ||
|
||
#endif /* WS_NEIGHBOUR_CLASS_H_ */ |