Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
chdk_pipe.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include "chdk_pipe.h"
+ Include dependency graph for chdk_pipe.c:

Go to the source code of this file.

Macros

#define READ   0
 
#define WRITE   1
 
#define MAX_FILENAME   255
 
#define SHELL   "/root/develop/allthings_obc2014/src/popcorn/popcorn.sh"
 

Functions

static void wait_for_cmd (int timeout)
 Wait for the commandline to be available TODO: add timeout. More...
 
static void wait_for_img (char *filename, int timeout)
 Wait for the image to be available TODO: add timeout. More...
 
static pid_t popen2 (const char *command, int *infp, int *outfp)
 Open a process with stdin and stdout. More...
 
void chdk_pipe_init (void)
 Initialize the CHDK pipe. More...
 
void chdk_pipe_deinit (void)
 Deinitialize CHDK pipe. More...
 
void chdk_pipe_shoot (char *filename)
 Shoot an image. More...
 

Variables

const char * setup
 
static int fo
 
static int fi
 

Macro Definition Documentation

#define MAX_FILENAME   255

Definition at line 17 of file chdk_pipe.c.

#define READ   0

Definition at line 15 of file chdk_pipe.c.

Referenced by popen2().

#define SHELL   "/root/develop/allthings_obc2014/src/popcorn/popcorn.sh"

Definition at line 18 of file chdk_pipe.c.

Referenced by chdk_pipe_init().

#define WRITE   1

Definition at line 16 of file chdk_pipe.c.

Referenced by popen2().

Function Documentation

void chdk_pipe_deinit ( void  )

Deinitialize CHDK pipe.

Definition at line 79 of file chdk_pipe.c.

References fi.

Referenced by main().

+ Here is the caller graph for this function:

void chdk_pipe_init ( void  )

Initialize the CHDK pipe.

Definition at line 50 of file chdk_pipe.c.

References fi, fo, popen2(), setup, SHELL, and wait_for_cmd().

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void chdk_pipe_shoot ( char *  filename)

Shoot an image.

Definition at line 92 of file chdk_pipe.c.

References fi, and wait_for_img().

Referenced by handle_msg_shoot().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static pid_t popen2 ( const char *  command,
int *  infp,
int *  outfp 
)
static

Open a process with stdin and stdout.

Definition at line 137 of file chdk_pipe.c.

References READ, and WRITE.

Referenced by chdk_pipe_init().

+ Here is the caller graph for this function:

static void wait_for_cmd ( int  timeout)
static

Wait for the commandline to be available TODO: add timeout.

Definition at line 126 of file chdk_pipe.c.

References fo.

Referenced by chdk_pipe_init(), and wait_for_img().

+ Here is the caller graph for this function:

static void wait_for_img ( char *  filename,
int  timeout 
)
static

Wait for the image to be available TODO: add timeout.

Definition at line 102 of file chdk_pipe.c.

References fo, and wait_for_cmd().

Referenced by chdk_pipe_shoot().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

int fi
static

Definition at line 24 of file chdk_pipe.c.

Referenced by chdk_pipe_deinit(), chdk_pipe_init(), and chdk_pipe_shoot().

int fo
static

Definition at line 24 of file chdk_pipe.c.

Referenced by chdk_pipe_init(), wait_for_cmd(), and wait_for_img().

const char* setup
Initial value:
=
"lua props=require(\"propcase\");print(\"SetupScript\");set_prop(props.ISO_MODE,3200);set_prop(props.FLASH_MODE,2);set_prop(props.RESOLUTION,0);set_prop(props.DATE_STAMP,0);set_prop(props.AF_ASSIST_BEAM,0);set_prop(props.QUALITY,0);print(\"Ready\");\n"

Definition at line 21 of file chdk_pipe.c.

Referenced by chdk_pipe_init().