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.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
fhss_ws_extension.h
00001 /* 00002 * Copyright (c) 2018, 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 /** 00019 * \file fhss_ws_extension.h 00020 * \brief 00021 */ 00022 00023 #ifndef FHSS_WS_EXT_H 00024 #define FHSS_WS_EXT_H 00025 00026 #include "ns_types.h" 00027 #include "fhss_api.h " 00028 00029 #ifdef __cplusplus 00030 extern "C" { 00031 #endif 00032 00033 /** 00034 * @brief unicast_timing_info Unicast timing/hopping schedule information structure. 00035 */ 00036 typedef struct unicast_timing_info { 00037 unsigned unicast_channel_function: 3; /**< Unicast schedule channel function */ 00038 uint8_t unicast_dwell_interval; /**< Unicast dwell interval */ 00039 uint16_t unicast_number_of_channels; /**< Unicast number of channels */ 00040 uint16_t fixed_channel; /**< Unicast fixed channel*/ 00041 uint_fast24_t ufsi; /**< Unicast fractional sequence interval */ 00042 uint32_t utt_rx_timestamp; /**< UTT-IE reception timestamp */ 00043 } unicast_timing_info_t; 00044 00045 /** 00046 * @brief broadcast_timing_info Broadcast timing/hopping schedule information structure. 00047 */ 00048 typedef struct broadcast_timing_info { 00049 unsigned broadcast_channel_function: 3; /**< Broadcast schedule channel function */ 00050 uint8_t broadcast_dwell_interval; /**< Broadcast dwell interval */ 00051 uint16_t fixed_channel; /**< Broadcast fixed channel*/ 00052 uint16_t broadcast_slot; /**< Broadcast slot number */ 00053 uint16_t broadcast_schedule_id; /**< Broadcast schedule identifier */ 00054 uint_fast24_t broadcast_interval_offset; /**< Broadcast interval offset */ 00055 uint32_t broadcast_interval; /**< Broadcast interval */ 00056 uint32_t bt_rx_timestamp; /**< BT-IE reception timestamp */ 00057 } broadcast_timing_info_t; 00058 00059 /** 00060 * @brief fhss_ws_neighbor_timing_info Neighbor timing/hopping schedule information structure. 00061 */ 00062 typedef struct fhss_ws_neighbor_timing_info { 00063 uint8_t clock_drift; /**< Neighbor clock drift */ 00064 uint8_t timing_accuracy; /**< Neighbor timing accuracy */ 00065 unicast_timing_info_t uc_timing_info; /**< Neighbor unicast timing info */ 00066 broadcast_timing_info_t bc_timing_info; /**< Neighbor broadcast timing info */ 00067 uint32_t *excluded_channels; /**< Neighbor excluded channels (bit mask) */ 00068 } fhss_ws_neighbor_timing_info_t; 00069 00070 /** 00071 * @brief Get neighbor timing/hopping schedule. 00072 * @param api FHSS instance. 00073 * @param eui64 EUI-64 address of node for which the info is requested. 00074 * @return Neighbor timing/hopping schedule. 00075 */ 00076 typedef fhss_ws_neighbor_timing_info_t *fhss_get_neighbor_info(const fhss_api_t *api, uint8_t eui64[8]); 00077 00078 /** 00079 * @brief Set parent which broadcast channels must be listened by FHSS. 00080 * @param fhss_api FHSS instance. 00081 * @param eui64 EUI-64 address of parent. 00082 * @param bc_timing_info Pointer to parent broadcast timing/hopping schedule info. 00083 * @param force_synch If false, synchronization is done only if minimum (internal) synchronization interval is exceed. 00084 * @return 0 on success, -1 on fail. 00085 */ 00086 extern int ns_fhss_ws_set_parent(const fhss_api_t *fhss_api, const uint8_t eui64[8], const broadcast_timing_info_t *bc_timing_info, const bool force_synch); 00087 00088 /** 00089 * @brief Remove parent which was set by ns_fhss_ws_set_parent function. 00090 * @param fhss_api FHSS instance. 00091 * @param eui64 EUI-64 address of parent. 00092 * @return 0 on success, -1 on fail. 00093 */ 00094 extern int ns_fhss_ws_remove_parent(const fhss_api_t *fhss_api, const uint8_t eui64[8]); 00095 00096 /** 00097 * @brief Set neighbor timing/hopping schedule request function. 00098 * @param fhss_api FHSS instance. 00099 * @param get_neighbor_info Neighbor info function pointer. 00100 * @return 0 on success, -1 on fail. 00101 */ 00102 extern int ns_fhss_set_neighbor_info_fp(const fhss_api_t *fhss_api, fhss_get_neighbor_info *get_neighbor_info); 00103 00104 /** 00105 * @brief Set node hop count. Hop count is used to specify TX/RX slot. When hop count is set to 0xFF, TX/RX slots are ignored. 00106 * @param fhss_api FHSS instance. 00107 * @param hop_count Hop count to be set. 00108 * @return 0 on success, -1 on fail. 00109 */ 00110 extern int ns_fhss_ws_set_hop_count(const fhss_api_t *fhss_api, const uint8_t hop_count); 00111 00112 #ifdef __cplusplus 00113 } 00114 #endif 00115 00116 #endif // FHSS_WS_EXT_H
Generated on Tue Jul 12 2022 13:54:21 by
