Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers net_fhss.h Source File

net_fhss.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2015-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 net_fhss.h
00020  * \brief FHSS API
00021  *
00022  */
00023 
00024 #ifndef NET_FHSS_H_
00025 #define NET_FHSS_H_
00026 #include "ns_types.h"
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032 /**
00033  * @brief Creates FHSS API instance which will be registered to software MAC.
00034  * @param fhss_configuration Basic FHSS configuration.
00035  * @param fhss_timer FHSS platform timer interface and configuration.
00036  * @param fhss_statistics FHSS statistics storage.
00037  * @return New FHSS instance if successful, NULL otherwise.
00038  */
00039 extern fhss_api_t *ns_fhss_create(const fhss_configuration_t *fhss_configuration, const fhss_timer_t *fhss_timer, fhss_statistics_t *fhss_statistics);
00040 
00041 /**
00042  * @brief Creates FHSS WS API instance which will be registered to software MAC.
00043  * @param fhss_configuration Basic FHSS configuration.
00044  * @param fhss_timer FHSS platform timer interface and configuration.
00045  * @return New FHSS instance if successful, NULL otherwise.
00046  */
00047 extern fhss_api_t *ns_fhss_ws_create(const fhss_ws_configuration_t *fhss_configuration, const fhss_timer_t *fhss_timer);
00048 
00049 /**
00050  * @brief Set synchronization time configuration for FHSS network. Should be only called from Border router.
00051  * @param fhss_api FHSS instance.
00052  * @param fhss_synch_configuration FHSS synchronization time configuration.
00053  * @return 0 on success, -1 on fail.
00054  */
00055 extern int ns_fhss_configuration_set(fhss_api_t *fhss_api, const fhss_synch_configuration_t *fhss_synch_configuration);
00056 
00057 /**
00058  * @brief Get WS configuration.
00059  * @param fhss_api FHSS instance.
00060  * @return WS configuration.
00061  */
00062 extern const fhss_ws_configuration_t *ns_fhss_ws_configuration_get(const fhss_api_t *fhss_api);
00063 
00064 /**
00065  * @brief Set WS configuration.
00066  * @param fhss_api FHSS instance.
00067  * @param fhss_configuration Basic FHSS configuration.
00068  * @return 0 on success, -1 on fail.
00069  */
00070 extern int ns_fhss_ws_configuration_set(const fhss_api_t *fhss_api, const fhss_ws_configuration_t *fhss_configuration);
00071 
00072 /**
00073  * @brief Deletes a FHSS API instance and removes it from software MAC.
00074  * @param fhss_api FHSS instance.
00075  * @return 0 on success, -1 on fail.
00076  */
00077 extern int ns_fhss_delete(fhss_api_t *fhss_api);
00078 
00079 /**
00080  * @brief Starts collecting FHSS statistics.
00081  * @param fhss_api FHSS instance.
00082  * @param fhss_statistics Pointer to stored statistics.
00083  * @return 0 on success, -1 on fail.
00084  */
00085 extern int ns_fhss_statistics_start(const fhss_api_t *fhss_api, fhss_statistics_t *fhss_statistics);
00086 
00087 
00088 #ifdef __cplusplus
00089 }
00090 #endif
00091 
00092 #endif /* NET_FHSS_H_ */