mirror of
https://github.com/Lurkars/esp-ena.git
synced 2026-05-08 20:10:37 +02:00
rename interface component, update docs, added cleanup of old beacons
This commit is contained in:
@@ -11,11 +11,18 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief handles scanned data by storing temporary beacons, check for threshold and store beacons permanently
|
||||
*
|
||||
*/
|
||||
#ifndef _ena_BEACON_H_
|
||||
#define _ena_BEACON_H_
|
||||
|
||||
#define ENA_BEACON_LOG "ESP-ENA-beacon" // TAG for Logging
|
||||
#define ENA_BEACON_TRESHOLD (CONFIG_ENA_BEACON_TRESHOLD) // meet for longer than 5 minutes
|
||||
#define ENA_BEACON_LOG "ESP-ENA-beacon" // TAG for Logging
|
||||
#define ENA_BEACON_TRESHOLD (CONFIG_ENA_BEACON_TRESHOLD) // meet for longer than 5 minutes
|
||||
#define ENA_BEACON_CLEANUP_TRESHOLD (CONFIG_ENA_BEACON_CLEANUP_TRESHOLD) // threshold (in days) for stored beacons to be removed
|
||||
|
||||
/**
|
||||
* @brief check temporary beacon for threshold or expiring
|
||||
@@ -23,11 +30,21 @@
|
||||
* This function checks all current temporary beacons if the contact threshold is
|
||||
* reached or if the temporary contact can be discarded.
|
||||
*
|
||||
* @param[in] unix_timestamp current time as UNIX timestamp to compate
|
||||
* @param[in] unix_timestamp current time as UNIX timestamp to compare
|
||||
*
|
||||
*/
|
||||
void ena_beacons_temp_refresh(uint32_t unix_timestamp);
|
||||
|
||||
/**
|
||||
* @brief check stored beacons to expire
|
||||
*
|
||||
* This function checks for all stored beacons if the last timestamp is over a threshold to remove the beacon.
|
||||
*
|
||||
* @param[in] unix_timestamp current time as UNIX timestamp to compate
|
||||
*
|
||||
*/
|
||||
void ena_beacons_cleanup(uint32_t unix_timestamp);
|
||||
|
||||
/**
|
||||
* @brief handle new beacon received from a BLE scan
|
||||
*
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief BLE advertising to send own beacons
|
||||
*
|
||||
*/
|
||||
#ifndef _ena_BLUETOOTH_ADVERTISE_H_
|
||||
#define _ena_BLUETOOTH_ADVERTISE_H_
|
||||
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief BLE scans for detecting other beacons
|
||||
*
|
||||
*/
|
||||
#ifndef _ena_BLUETOOTH_SCAN_H_
|
||||
#define _ena_BLUETOOTH_SCAN_H_
|
||||
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief covers cryptography part (key creation, encryption etc.)
|
||||
*
|
||||
*/
|
||||
#ifndef _ena_CRYPTO_H_
|
||||
#define _ena_CRYPTO_H_
|
||||
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief decode Exposure Key export, compare with stored beacons, calculate score and risk
|
||||
*
|
||||
*/
|
||||
#ifndef _ena_EXPOSURE_H_
|
||||
#define _ena_EXPOSURE_H_
|
||||
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief storage part to store own TEKs and beacons
|
||||
*
|
||||
*/
|
||||
#ifndef _ena_STORAGE_H_
|
||||
#define _ena_STORAGE_H_
|
||||
|
||||
@@ -190,6 +196,13 @@ void ena_storage_get_beacon(uint32_t index, ena_beacon_t *beacon);
|
||||
*/
|
||||
void ena_storage_add_beacon(ena_beacon_t *beacon);
|
||||
|
||||
/**
|
||||
* @brief remove beacon at given index
|
||||
*
|
||||
* @param[in] index the index of the beacon to remove
|
||||
*/
|
||||
void ena_storage_remove_beacon(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief erase the storage
|
||||
*
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief run all other ena parts together to time scanning, advertising and exposure checks
|
||||
*
|
||||
*/
|
||||
#ifndef _ena_H_
|
||||
#define _ena_H_
|
||||
|
||||
|
||||
Reference in New Issue
Block a user