libcontrac
A library for contact tracing
|
Provides a way to match collected RPIs with downloaded DTKs. More...
Files | |
file | match.c |
Provides a way to match collected RPIs with downloaded DTKs. | |
file | match.h |
Provides a way to match collected RPIs with downloaded DTKs. | |
Data Structures | |
struct | MatchListItem |
A match list element. More... | |
struct | MatchList |
The head of a match list. More... | |
Functions | |
MatchListItem * | match_list_item_new () |
void | match_list_item_delete (MatchListItem *data) |
void | match_list_append (MatchList *data, MatchListItem *item) |
MatchList * | match_list_new () |
void | match_list_delete (MatchList *data) |
void | match_list_clear (MatchList *data) |
size_t | match_list_count (MatchList *data) |
MatchListItem const * | match_list_first (MatchList const *data) |
MatchListItem const * | match_list_next (MatchListItem const *data) |
uint32_t | match_list_get_day_number (MatchListItem const *data) |
uint8_t | match_list_get_time_interval_number (MatchListItem const *data) |
void | match_list_find_matches (MatchList *data, RpiList *beacons, DtkList *diagnosis_keys) |
Provides a way to match collected RPIs with downloaded DTKs.
This class provides functionality allowing RPIs that have been collected over Bluetooth to be matched against DTKs downloaded from a Diagnosis Server.
void match_list_append | ( | MatchList * | data, |
MatchListItem * | item | ||
) |
Adds an item to the list.
This adds a match to the list. It's primarily for internal use.
data | The list to append to. |
item | The match to append. |
void match_list_clear | ( | MatchList * | data | ) |
Clears all items from the list.
Removes all items from the list to create an empty list. The memory associated with the items in the list is freed.
data | The list to operate on. |
size_t match_list_count | ( | MatchList * | data | ) |
Returns the number of items in the list.
Immediately after creation, or after the match_list_clear() function has been called, this will return zero.
data | The list to operate on. |
void match_list_delete | ( | MatchList * | data | ) |
Deletes an instance of the class, freeing up the memory allocated to it.
This will also delete all items contained in the list.
data | The instance to free. |
void match_list_find_matches | ( | MatchList * | data, |
RpiList * | beacons, | ||
DtkList * | diagnosis_keys | ||
) |
Returns a list of matches found between the beacons and diagnoses.
This searches through the list of DTKs and the list of RPIs provided, and returns a list of matches.
If the returned list has any elements in, this would suggest that the user has been in contact with someone who tested positive and uploaded their DTK to a Diagnosis Server.
The match list isn't cleared by this call and so any new values will be appended to it.
data | The list that any matches will be appended to. |
beacons | A list of RPIs extracted from overheard BLE beacons. |
diagnosis_keys | A list of DTKs downloaed from a Diagnosis Server. |
MatchListItem const * match_list_first | ( | MatchList const * | data | ) |
Returns the first item in the list.
Useful for iterating through the items in the list.
data | The list to operate on. |
uint32_t match_list_get_day_number | ( | MatchListItem const * | data | ) |
Returns the day number of the item in the list.
This will represent the day number of when an interaction occurred with someone who has subsequently uploaded their DTK to a diagnosis server due to testing positive.
data | The list to operate on. |
uint8_t match_list_get_time_interval_number | ( | MatchListItem const * | data | ) |
Returns the time interval number of the item in the list.
This will represent the time interval number of when an interaction occurred with someone who has subsequently uploaded their DTK to a diagnosis server due to testing positive.
data | The list to operate on. |
void match_list_item_delete | ( | MatchListItem * | data | ) |
Deletes an instance of the class, freeing up the memory allocated to it.
data | The instance to free. |
MatchListItem * match_list_item_new | ( | ) |
Creates a new instance of the class.
MatchList * match_list_new | ( | ) |
Creates a new instance of the class.
MatchListItem const * match_list_next | ( | MatchListItem const * | data | ) |
Returns the next item in the list.
Useful for iterating through the items in the list.
data | The current item in the list. |