Skip to content

Commit 695e64c

Browse files
author
Jarkko Paso
authored
Merge pull request ARMmbed#1601 from ARMmbed/IOTTHD-2214
Iotthd 2214
2 parents e6bac6a + f973986 commit 695e64c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1725
-2303
lines changed

source/Service_Libs/fhss/fhss.c

Lines changed: 274 additions & 9 deletions
Large diffs are not rendered by default.

source/Service_Libs/fhss/fhss.h

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,49 @@
2626
#define NUMBER_OF_BC_START_SUPERFRAMES 3
2727
#define MAX_FHSS_TIMER_DIVIDER 100
2828
#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)
2935

3036
typedef struct fhss_structure fhss_structure_t;
3137
typedef struct fhss_beacon_info fhss_beacon_info_t;
3238
typedef struct fhss_synch_monitor fhss_synch_monitor_s;
3339
typedef struct fhss_failed_tx fhss_failed_tx_t;
3440
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+
};
3572

3673
struct fhss_beacon_info
3774
{
@@ -86,7 +123,6 @@ struct fhss_bs
86123

87124
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);
88125
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);
90126
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);
91127
/**
92128
* 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
97133
uint32_t fhss_get_remaining_time_to_next_superframe(const fhss_structure_t *fhss_struct);
98134
int8_t fhss_set_synch_configuration(fhss_structure_t *fhss_structure, const fhss_synch_configuration_t *fhss_synch_configuration);
99135
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);
100137

101138
#endif /* FHSS_H_ */

source/Service_Libs/fhss/fhss_beacon.c

Lines changed: 0 additions & 227 deletions
This file was deleted.

0 commit comments

Comments
 (0)