1414 * See the License for the specific language governing permissions and
1515 * limitations under the License.
1616 */
17- #include "ns_list.h"
17+ #ifndef FHSS_COMMON_H_
18+ #define FHSS_COMMON_H_
1819#define FHSS_TASKLET_INIT_EVENT 0
1920#define FHSS_TIMER_EVENT 1
2021#define FHSS_COMPARE_SYNCH_PARENT 2
2122#define FHSS_BROADCAST_CHANNEL 3
2223#define FHSS_UPDATE_SYNCH_INFO_STORAGE 4
2324
24- typedef struct fhss_structure fhss_structure_t ;
25- struct fhss_ws ;
26-
27- typedef struct fhss_beacon_info
28- {
29- uint16_t pan_id ;
30- uint8_t source_address [8 ];
31- uint32_t timestamp ;
32- uint8_t synch_info [FHSS_SYNCH_INFO_LENGTH ];
33- struct fhss_beacon_info * next ;
34- }fhss_beacon_info_t ;
35-
36- typedef struct fhss_failed_tx
37- {
38- uint8_t handle ;
39- uint8_t bad_channel ;
40- uint8_t retries_done ;
41- ns_list_link_t link ;
42- }fhss_failed_tx_t ;
43-
4425typedef NS_LIST_HEAD (fhss_failed_tx_t , link ) fhss_failed_tx_list_t ;
4526
46- typedef struct
47- {
48- int32_t avg_synch_fix ;
49- int avg_synch_fix_counter ;
50- int drift_compensation ;
51- int channel_counter ;
52- } fhss_synch_monitor_s ;
53-
5427/**
5528 * @brief Update listening channel.
5629 * @param fhss_structure FHSS structure.
@@ -120,7 +93,7 @@ struct fhss_structure
12093 /*Indexes in this table will be used to extend the repeated channel sequence*/
12194 uint8_t * fhss_scramble_table ;
12295 /** Used to monitor and fix synchronization drift*/
123- fhss_synch_monitor_s synch_monitor ;
96+ struct fhss_synch_monitor synch_monitor ;
12497 /** Used to drop multiple synch info messages on same broadcast channel*/
12598 bool beacon_received_on_this_bc_channel ;
12699 /** Timer used for events other than synchronization.*/
@@ -135,7 +108,7 @@ struct fhss_structure
135108 /* Bit mask for FHSS events pushed to event queue. Prevents pushing same event to queue multiple times*/
136109 uint8_t active_fhss_events ;
137110 struct fhss_callback callbacks ;
138- fhss_beacon_info_t * fhss_beacon_info_store ;
111+ struct fhss_beacon_info * fhss_beacon_info_store ;
139112 fhss_failed_tx_list_t fhss_failed_tx_list ;
140113 fhss_statistics_t * fhss_stats_ptr ;
141114
@@ -146,8 +119,7 @@ struct fhss_structure
146119 fhss_handle_state_set_cb * handle_state_set ; /**< Set FHSS state */
147120};
148121
149-
150- fhss_structure_t * fhss_enable (fhss_api_t * fhss_api , const fhss_configuration_t * fhss_configuration , const fhss_timer_t * fhss_timer , fhss_statistics_t * fhss_statistics );
122+ fhss_structure_t * fhss_enable (fhss_api_t * fhss_api , const fhss_configuration_t * fhss_configuration , const fhss_timer_t * fhss_timer , fhss_statistics_t * fhss_statistics );
151123int fhss_down (fhss_structure_t * fhss_structure );
152124int8_t fhss_set_datarate (fhss_structure_t * fhss_structure , uint32_t datarate );
153125int8_t fhss_set_synch_configuration (fhss_structure_t * fhss_structure , const fhss_synch_configuration_t * fhss_synch_configuration );
@@ -161,4 +133,6 @@ int fhss_update_synch_parent_address(fhss_structure_t *fhss_structure);
161133void fhss_trig_event (fhss_structure_t * fhss_structure , uint8_t event_type );
162134int fhss_get_parent_address (fhss_structure_t * fhss_structure , uint8_t * p_addr );
163135int fhss_compare_with_synch_parent_address (fhss_structure_t * fhss_structure , const uint8_t * source_addr );
136+
164137void fhss_superframe_handler (const fhss_api_t * fhss_api , uint16_t delay );
138+ #endif /*FHSS_COMMON_H_*/
0 commit comments