Initial Commit:
- Create single library for all Core RedA functions/classes - Working version
This commit is contained in:
45
LogCore.cpp
Normal file
45
LogCore.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* LogCore.cpp
|
||||
*
|
||||
* Created on: 17 May 2016
|
||||
* Author: wentzelc
|
||||
*/
|
||||
|
||||
// redA Libraries
|
||||
#include "LogCore.h"
|
||||
|
||||
// Standard C/C++ Libraries
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void ShowOutput( const char * Name, const char * Buffer, const int Len, const long Duration )
|
||||
{
|
||||
// Show Duration delay
|
||||
if (Duration) {
|
||||
printf( "Delay: %ld", Duration );
|
||||
}
|
||||
|
||||
// Show Hex output
|
||||
if (ShowOutBytes) {
|
||||
printf( "%s in (hex): ", Name );
|
||||
for (int i=0; i<Len; i++) {
|
||||
printf( "%02X ", Buffer[i] );
|
||||
}
|
||||
printf( "\n" );
|
||||
}
|
||||
|
||||
// Show normal output
|
||||
if (ShowOutHex) {
|
||||
printf( "%s in [%d]: %s", Name, Len, Buffer );
|
||||
if (Buffer[Len-1] != '\n') {
|
||||
printf( "\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user