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
Macros | Functions | Variables
uart.c File Reference

UART sample. More...

#include <stdio.h>
#include <string.h>
#include "sol-mainloop.h"
#include "sol-uart.h"
#include "sol-util.h"
#include "sol-str-slice.h"
#include "soletta.h"

Macros

#define FEED_SIZE   (512)
 
#define MAX_PACKETS   (100)
 

Functions

static ssize_t consumer_read_available (void *data, struct sol_uart *uart, const struct sol_buffer *buf)
 [uart write] More...
 
static void producer_data_written (void *data, struct sol_uart *uart, struct sol_blob *blob, int status)
 [uart write completed] More...
 
static bool producer_make_data (void *data)
 
static bool send_blob (struct sol_blob *blob)
 [uart write completed] More...
 
static void shutdown (void)
 [uart configure] More...
 
 SOL_MAIN_DEFAULT (startup, shutdown)
 
static void startup (void)
 [uart read] More...
 

Variables

static struct sol_uartconsumer
 
static struct sol_blobpending_blob
 
static struct sol_uartproducer
 
static struct sol_timeoutproducer_timeout
 

Detailed Description

UART sample.

This sample simulates an UART producer and consumer. In order to run this sample, you will need to cross connect two uart cables. This means the TX from one cable must be connect to the RX of the another cable and vice-versa.

Macro Definition Documentation

#define FEED_SIZE   (512)
Examples:
/src/samples/common/uart.c.

Referenced by startup().

#define MAX_PACKETS   (100)

Function Documentation

static ssize_t consumer_read_available ( void *  data,
struct sol_uart uart,
const struct sol_buffer buf 
)
static
static void producer_data_written ( void *  data,
struct sol_uart uart,
struct sol_blob blob,
int  status 
)
static
static bool producer_make_data ( void *  data)
static
static bool send_blob ( struct sol_blob blob)
static
static void shutdown ( void  )
static
SOL_MAIN_DEFAULT ( startup  ,
shutdown   
)
static void startup ( void  )
static

Variable Documentation

struct sol_uart* consumer
static
struct sol_blob* pending_blob
static
struct sol_uart* producer
static
struct sol_timeout* producer_timeout
static