Xively C library

Dependents:   Application-xively-jumpstart-demo Application-xively-jumpstart-demo Modified_Xively_Jumpstart HW7-1_Xively_Thermostat

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers xi_printf.h Source File

xi_printf.h

Go to the documentation of this file.
00001 // Copyright (c) 2003-2013, LogMeIn, Inc. All rights reserved.
00002 // This is part of Xively C library, it is under the BSD 3-Clause license.
00003 
00004 /**
00005  * \file    xi_printf.h
00006  * \author  Olgierd Humenczuk
00007  * \brief   Our custom `printf()` hook
00008  *
00009  *    This is needed on embedded devices, as there is no way to redirect
00010  *    the output neither it has any logging facilities out of the box.
00011  *    We currently use a function pointer (`user_print_t`) and and the
00012  *    user can assign to an external variable (`USER_PRINTF`) to call
00013  *    whatever device platform may have available.
00014  */
00015 
00016 #ifndef __XI_PRINTF_H__
00017 #define __XI_PRINTF_H__
00018 
00019 #ifdef __cplusplus
00020 extern "C" {
00021 #endif
00022 
00023 typedef void ( *user_print_t )( const char* );
00024 
00025 extern user_print_t USER_PRINT;
00026 
00027 int xi_printf( const char *fmt, ... );
00028 
00029 #ifdef __cplusplus
00030 }
00031 #endif
00032 
00033 #endif //__XI_PRINTF_H__