Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed BLE_API X_NUCLEO_IDB0XA1 MODSERIAL
LOGGER.h
00001 #ifndef LOGGER_H 00002 #define LOGGER_H 00003 #include "MODSERIAL.h" 00004 #include "mbed.h" 00005 #include <string> 00006 #define <queue> 00007 #define DEBUT_TRAME '!' 00008 #define FIN_TRAME '#' 00009 #define MAX_SIZE_BUFFER 6 00010 class Logger { 00011 00012 public : 00013 static Logger* Instance(); 00014 00015 void log(std::string s); 00016 void logn(std::string s); 00017 void log(double f); 00018 void logn(double f); 00019 void log(int i); 00020 void logn(int i); 00021 void log(long l); 00022 void logn(long l); 00023 string log_itos(int i); 00024 //buffer 00025 int get_buffer_index(); 00026 void flush_buffer(); 00027 protected : 00028 00029 static Logger* _instance; 00030 void rxCallback(MODSERIAL_IRQ_INFO *q); 00031 Logger(); 00032 MODSERIAL * serial; 00033 int buffer_index; 00034 bool new_event, event_detected; 00035 std::queue<char> *buffer; 00036 00037 }; 00038 00039 #endif
Generated on Thu Jul 14 2022 17:21:51 by
1.7.2