Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
stream_sample.c File Reference
#include <sol-log.h>
#include <sol-mainloop.h>
#include <sol-types.h>
#include <sol-buffer.h>
#include <sol-util.h>
#include <sol-reentrant.h>
#include <soletta.h>
#include <unistd.h>
#include <stdio.h>

Data Structures

struct  my_stream_api_config
 [stream config] More...
 
struct  my_stream_api_handle
 [stream config] More...
 

Macros

#define DEFAULT_BUFFER_SIZE   (4096)
 
#define my_stream_device_add_io_monitor   sol_fd_add
 
#define my_stream_device_monitor_handle   struct sol_fd
 
#define my_stream_device_read   read
 
#define my_stream_device_remove_io_monitor   sol_fd_del
 
#define my_stream_device_write   write
 

Functions

static bool _can_read (void *data, int fd, uint32_t active_flags)
 
static bool _can_write (void *data, int fd, uint32_t active_flags)
 [stream write] More...
 
static bool _inform_user (void *data)
 [stream write] More...
 
static void api_close (struct my_stream_api_handle *handle)
 [stream handle] More...
 
void my_stream_api_close (struct my_stream_api_handle *handle)
 [stream write api] More...
 
int my_stream_api_feed (struct my_stream_api_handle *handle, struct sol_blob *blob)
 [stream write api] More...
 
struct my_stream_api_handlemy_stream_api_new (const struct my_stream_api_config *config, int dev)
 
static ssize_t on_data (void *user_data, struct my_stream_api_handle *handle, const struct sol_buffer *buf)
 
static void on_feed_done (void *data, struct my_stream_api_handle *handle, struct sol_blob *blob, int status)
 [stream read] More...
 
static void shutdown (void)
 
 SOL_MAIN_DEFAULT (startup, shutdown)
 
static void startup (void)
 

Variables

static struct
my_stream_api_handle
out_handle
 

Macro Definition Documentation

#define DEFAULT_BUFFER_SIZE   (4096)
#define my_stream_device_add_io_monitor   sol_fd_add
#define my_stream_device_monitor_handle   struct sol_fd
#define my_stream_device_read   read
#define my_stream_device_remove_io_monitor   sol_fd_del
#define my_stream_device_write   write

Function Documentation

static bool _can_read ( void *  data,
int  fd,
uint32_t  active_flags 
)
static
static bool _can_write ( void *  data,
int  fd,
uint32_t  active_flags 
)
static
static bool _inform_user ( void *  data)
static
static void api_close ( struct my_stream_api_handle handle)
static
void my_stream_api_close ( struct my_stream_api_handle handle)
int my_stream_api_feed ( struct my_stream_api_handle handle,
struct sol_blob blob 
)
struct my_stream_api_handle * my_stream_api_new ( const struct my_stream_api_config config,
int  dev 
)
static ssize_t on_data ( void *  user_data,
struct my_stream_api_handle handle,
const struct sol_buffer buf 
)
static
static void on_feed_done ( void *  data,
struct my_stream_api_handle handle,
struct sol_blob blob,
int  status 
)
static

[stream read]

References sol_str_slice_from_blob(), SOL_STR_SLICE_PRINT, and sol_util_strerrora.

Referenced by startup().

static void shutdown ( void  )
static
SOL_MAIN_DEFAULT ( startup  ,
shutdown   
)
static void startup ( void  )
static

Variable Documentation

struct my_stream_api_handle* out_handle
static