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.
fhss_common.h
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 #ifndef FHSS_COMMON_H_ 00018 #define FHSS_COMMON_H_ 00019 #include "ns_list.h" 00020 00021 #define FHSS_TASKLET_INIT_EVENT 0 00022 #define FHSS_TIMER_EVENT 1 00023 #define FHSS_COMPARE_SYNCH_PARENT 2 00024 #define FHSS_BROADCAST_CHANNEL 3 00025 #define FHSS_UPDATE_SYNCH_INFO_STORAGE 4 00026 00027 struct fhss_failed_tx 00028 { 00029 uint8_t handle; 00030 uint8_t bad_channel; 00031 uint8_t retries_done; 00032 ns_list_link_t link; 00033 }; 00034 typedef NS_LIST_HEAD (fhss_failed_tx_t, link) fhss_failed_tx_list_t; 00035 00036 struct fhss_structure 00037 { 00038 uint8_t own_hop; 00039 uint8_t fhss_resolution_divider; 00040 uint8_t rx_channel; 00041 int8_t beacon_tasklet_id; 00042 int8_t fhss_event_timer; 00043 uint8_t active_fhss_events; 00044 uint16_t number_of_channels; 00045 fhss_states fhss_state; 00046 uint32_t fhss_timeout; 00047 uint32_t fhss_timer; 00048 struct fhss_api *fhss_api; 00049 struct fhss_bs *bs; 00050 struct fhss_ws *ws; 00051 struct fhss_timer platform_functions; 00052 struct fhss_callback callbacks; 00053 fhss_failed_tx_list_t fhss_failed_tx_list; 00054 uint8_t synch_parent[8]; 00055 }; 00056 00057 fhss_structure_t *fhss_allocate_instance(fhss_api_t *fhss_api, const fhss_timer_t *fhss_timer); 00058 int8_t fhss_free_instance(fhss_api_t *fhss_api); 00059 int8_t fhss_set_datarate(fhss_structure_t *fhss_structure, uint32_t datarate); 00060 fhss_structure_t *fhss_get_object_with_api(const fhss_api_t *fhss_api); 00061 void fhss_clear_active_event(fhss_structure_t *fhss_structure, uint8_t event_type); 00062 int8_t fhss_disable(fhss_structure_t *fhss_structure); 00063 void fhss_start_timer(fhss_structure_t *fhss_structure, uint32_t time, void (*callback)(const fhss_api_t *fhss_api, uint16_t)); 00064 int fhss_timeout_start(fhss_structure_t *fhss_structure, uint32_t time); 00065 int fhss_timeout_stop(fhss_structure_t *fhss_structure); 00066 int fhss_update_synch_parent_address(fhss_structure_t *fhss_structure); 00067 void fhss_trig_event(fhss_structure_t *fhss_structure, uint8_t event_type); 00068 int fhss_get_parent_address(fhss_structure_t *fhss_structure, uint8_t *p_addr); 00069 int fhss_compare_with_synch_parent_address(fhss_structure_t *fhss_structure, const uint8_t *source_addr); 00070 uint32_t fhss_read_timestamp_cb(const fhss_api_t *api); 00071 int fhss_init_callbacks_cb(const fhss_api_t *api, fhss_callback_t *callbacks); 00072 int fhss_failed_handle_remove(fhss_structure_t *fhss_structure, uint8_t handle); 00073 int fhss_failed_handle_add(fhss_structure_t *fhss_structure, uint8_t handle, uint8_t bad_channel); 00074 fhss_failed_tx_t *fhss_failed_handle_find(fhss_structure_t *fhss_structure, uint8_t handle); 00075 void fhss_failed_list_free(fhss_structure_t *fhss_structure); 00076 uint32_t fhss_get_tx_time(fhss_structure_t *fhss_structure, uint16_t bytes_to_send, uint8_t phy_header_length, uint8_t phy_tail_length); 00077 #endif /*FHSS_COMMON_H_*/
Generated on Tue Aug 9 2022 00:37:07 by
1.7.2