ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
main.cc File Reference
#include <libents/controller/controller.h>
#include <libents/controller/modules/microsd.h>
#include <libents/proto/sensor.h>
#include <libents/storage/fifo.h>
#include <libents/user_config.h>
#include <libtock-sync/services/alarm.h>
#include <libtock/kernel/ipc.h>
#include <libtock/tock.h>
#include <stdio.h>
#include <ulog.h>
#include "lorawan.h"
#include "user_config.h"

Go to the source code of this file.

Data Structures

struct  upload_stats
 

Macros

#define LOG_LINE_SIZE   240
 

Functions

void ulog_prefix_handler (ulog_event *ev, char *prefix, size_t prefix_size)
 Callback to add prefix to ulog messages.
 
int main (void)
 

Variables

upload_stats stats = {}
 

Macro Definition Documentation

◆ LOG_LINE_SIZE

#define LOG_LINE_SIZE   240

Must match the MicroSDCommand.log field, which is 240 bytes (239 chars plus the NUL). Anything smaller truncates the line here, before the proto sees it, and ulog_event_to_cstr() writes "LEVEL FILE:LINE: MESSAGE" into this buffer, so a long FILE eats into the space left for the message.

Definition at line 21 of file main.cc.

Function Documentation

◆ main()

◆ ulog_prefix_handler()

void ulog_prefix_handler ( ulog_event *  ev,
char *  prefix,
size_t  prefix_size 
)

Callback to add prefix to ulog messages.

Parameters
evPointer to ulog event.
prefixPointer to prefix buffer.
prefix_sizeSize of prefix buffer.

Definition at line 97 of file main.cc.

Referenced by main().

Variable Documentation

◆ stats

upload_stats stats = {}

Definition at line 37 of file main.cc.

Referenced by main().