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_statistics.c
00001 /* 00002 * Copyright (c) 2017-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 #include "nsconfig.h" 00018 #include "ns_types.h" 00019 #include "fhss_api.h " 00020 #include "fhss_config.h " 00021 #include "fhss.h" 00022 #include "fhss_common.h" 00023 #include "fhss_statistics.h" 00024 00025 void fhss_stats_update(fhss_structure_t *fhss_structure, fhss_stats_type_t type, uint32_t update_val) 00026 { 00027 if (fhss_structure->fhss_stats_ptr) { 00028 switch (type) { 00029 case STATS_FHSS_DRIFT_COMP: 00030 fhss_structure->fhss_stats_ptr->fhss_drift_compensation = update_val; 00031 break; 00032 case STATS_FHSS_HOP_COUNT: 00033 fhss_structure->fhss_stats_ptr->fhss_hop_count = update_val; 00034 break; 00035 case STATS_FHSS_SYNCH_INTERVAL: 00036 fhss_structure->fhss_stats_ptr->fhss_synch_interval = update_val; 00037 break; 00038 case STATS_FHSS_AVG_SYNCH_FIX: 00039 fhss_structure->fhss_stats_ptr->fhss_prev_avg_synch_fix = update_val; 00040 break; 00041 case STATS_FHSS_SYNCH_LOST: 00042 fhss_structure->fhss_stats_ptr->fhss_synch_lost += update_val; 00043 break; 00044 case STATS_FHSS_UNKNOWN_NEIGHBOR: 00045 fhss_structure->fhss_stats_ptr->fhss_unknown_neighbor += update_val; 00046 break; 00047 case STATS_FHSS_CHANNEL_RETRY: 00048 fhss_structure->fhss_stats_ptr->fhss_channel_retry += update_val; 00049 break; 00050 } 00051 } 00052 } 00053 00054 int fhss_statistics_start(fhss_structure_t *fhss_structure, fhss_statistics_t *fhss_statistics) 00055 { 00056 fhss_structure->fhss_stats_ptr = fhss_statistics; 00057 return 0; 00058 }
Generated on Tue Jul 12 2022 13:54:21 by
