26
26
#define NUMBER_OF_BC_START_SUPERFRAMES 3
27
27
#define MAX_FHSS_TIMER_DIVIDER 100
28
28
#define SYNCH_MONITOR_AVG_SAMPLES 5
29
+ #define FHSS_DATA_START_DELIMETER 0x00
30
+ #define FHSS_SYNCHRONIZATION_LOST 10
31
+ #define BEACON_INTERVAL_INIT_DIVIDER 100
32
+ #define FHSS_SYNCH_DRIFT_TOO_HIGH_LIMIT 20000
33
+ #define CLOSE_TO_SUPERFRAME_LENGTH 2000
34
+ #define BEACON_FIELD_SIZE (field ) (sizeof((fhss_synchronization_beacon_payload_s*)0)->field)
29
35
30
36
typedef struct fhss_structure fhss_structure_t ;
31
37
typedef struct fhss_beacon_info fhss_beacon_info_t ;
32
38
typedef struct fhss_synch_monitor fhss_synch_monitor_s ;
33
39
typedef struct fhss_failed_tx fhss_failed_tx_t ;
34
40
typedef struct fhss_bs fhss_bs_t ;
41
+ typedef struct fhss_synchronization_beacon_payload fhss_synchronization_beacon_payload_s ;
42
+
43
+ struct fhss_synchronization_beacon_payload
44
+ {
45
+ /** Start delimeter */
46
+ uint8_t data_start_delimeter ;
47
+ /** Channel index */
48
+ uint8_t channel_index ;
49
+ /** Sender unicast channel index */
50
+ uint8_t sender_unicast_channel ;
51
+ /** Current superframe */
52
+ uint16_t current_superframe ;
53
+ /** Remaining time (us) to next superframe */
54
+ uint16_t remaining_slots ;
55
+ /** Channel list counter */
56
+ uint16_t channel_list_counter ;
57
+ /** Hop count */
58
+ uint8_t hop_count ;
59
+ /** Number of broadcast channels */
60
+ uint8_t number_of_broadcast_channels ;
61
+ /** Number of TX slots per channel */
62
+ uint8_t number_of_tx_slots ;
63
+ /** Time since last beacon (us) */
64
+ uint32_t time_since_last_beacon ;
65
+ /** Processing delay (us) */
66
+ uint16_t processing_delay ;
67
+ /** Superframe length */
68
+ uint16_t superframe_length ;
69
+ /** Number of superframes per channel */
70
+ uint8_t number_of_superframes_per_channel ;
71
+ };
35
72
36
73
struct fhss_beacon_info
37
74
{
@@ -86,7 +123,6 @@ struct fhss_bs
86
123
87
124
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 );
88
125
bool fhss_is_synch_root (fhss_structure_t * fhss_structure );
89
- void fhss_update_beacon_info_lifetimes (fhss_structure_t * fhss_structure , uint32_t timestamp );
90
126
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 );
91
127
/**
92
128
* Calculate time in microseconds to start of next superframe.
@@ -97,5 +133,6 @@ uint32_t fhss_get_tx_time(fhss_structure_t *fhss_structure, uint16_t bytes_to_se
97
133
uint32_t fhss_get_remaining_time_to_next_superframe (const fhss_structure_t * fhss_struct );
98
134
int8_t fhss_set_synch_configuration (fhss_structure_t * fhss_structure , const fhss_synch_configuration_t * fhss_synch_configuration );
99
135
int fhss_set_callbacks (fhss_structure_t * fhss_structure );
136
+ uint8_t fhss_calculate_uc_index (uint8_t channel_index , uint16_t number_of_channels , uint8_t number_of_broadcast_channels );
100
137
101
138
#endif /* FHSS_H_ */
0 commit comments