BlueSync - BLE Time Sync for Zephyr
High-precision time synchronization for BLE Mesh networks
Loading...
Searching...
No Matches
synced_time_logger.c File Reference
#include "synced_time_logger.h"
#include <zephyr/kernel.h>
#include "posix_native_task.h"
#include "bsim_args_runner.h"
#include <stdio.h>
#include <string.h>
#include <zephyr/logging/log.h>
#include <bluesync/bluesync.h>
Include dependency graph for synced_time_logger.c:

Go to the source code of this file.

Data Structures

struct  msg_statistic
 
struct  ble_node_stat
 

Macros

#define SEPARATION_TOKEN   ";"
 
#define TICKS_PER_SECOND   32768
 

Functions

 LOG_MODULE_REGISTER (synced_time_logger, CONFIG_APP_LOG_LEVEL)
 
void synced_time_logger_new_msg (struct msg_statistic *msg)
 
void my_work_handler (struct k_work *work)
 
void timer_handler (struct k_timer *timer_id)
 
 K_TIMER_DEFINE (aligned_timer, timer_handler, NULL)
 
void init_sync_overall_timer (void)
 
static FILE * open_stat (char *filename, uint32_t device_number)
 
void synced_time_logger_init ()
 Initialize the timer that store regularly timestamp of the node.
 
void synced_time_logger_deinit ()
 Deinitialize the timer that store regularly timestamp of the node.
 

Variables

struct k_work my_work
 
static int64_t val_ref = 0
 
static struct ble_node_stat node
 

Macro Definition Documentation

◆ SEPARATION_TOKEN

#define SEPARATION_TOKEN   ";"

Definition at line 39 of file synced_time_logger.c.

◆ TICKS_PER_SECOND

#define TICKS_PER_SECOND   32768

Definition at line 41 of file synced_time_logger.c.

Function Documentation

◆ init_sync_overall_timer()

void init_sync_overall_timer ( void  )

Definition at line 69 of file synced_time_logger.c.

◆ K_TIMER_DEFINE()

K_TIMER_DEFINE ( aligned_timer  ,
timer_handler  ,
NULL   
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( synced_time_logger  ,
CONFIG_APP_LOG_LEVEL   
)

◆ my_work_handler()

void my_work_handler ( struct k_work *  work)

Definition at line 52 of file synced_time_logger.c.

◆ open_stat()

static FILE * open_stat ( char *  filename,
uint32_t  device_number 
)
static

Definition at line 95 of file synced_time_logger.c.

◆ synced_time_logger_deinit()

void synced_time_logger_deinit ( )

Deinitialize the timer that store regularly timestamp of the node.

Definition at line 135 of file synced_time_logger.c.

◆ synced_time_logger_init()

void synced_time_logger_init ( )

Initialize the timer that store regularly timestamp of the node.

Definition at line 111 of file synced_time_logger.c.

◆ synced_time_logger_new_msg()

void synced_time_logger_new_msg ( struct msg_statistic msg)

Definition at line 123 of file synced_time_logger.c.

◆ timer_handler()

void timer_handler ( struct k_timer *  timer_id)

Definition at line 62 of file synced_time_logger.c.

Variable Documentation

◆ my_work

struct k_work my_work

Definition at line 42 of file synced_time_logger.c.

◆ node

struct ble_node_stat node
static

Definition at line 93 of file synced_time_logger.c.

◆ val_ref

int64_t val_ref = 0
static

Definition at line 43 of file synced_time_logger.c.