-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyvonne-remote-lib.h
71 lines (54 loc) · 2.45 KB
/
yvonne-remote-lib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*****************************************************
* This file is part of yvonne-remote.
* (Arduino connection lib + pipe to command line)
*
* 2014, Jérôme Blanchi aka d.j.a.y
* http://github.com/d-j-a-y/yvonne-remote
*
* yvonne-remote is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*****************************************************/
#ifndef __YVONNEREMOTELIB__
#define __YVONNEREMOTELIB__
#include <termios.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <wand/MagickWand.h>
#include <gphoto2/gphoto2-camera.h>
#define ERROR_EXEC_COMMAND_FAIL 100
#define ERROR_EXEC_FAIL 101
#define ARDUINO_TEXTMAX 255
typedef struct _YvonneCamera {
GPContext *ctx;
Camera *cam;
}YvonneCamera;
int YvonneArduinoInit (int iFileDescriptor, int baudrate, struct termios* oldtio);
void YvonneArduinoClose (int fd, struct termios* oldtio);
int YvonneArduinoOpen (char* arduinoPort);
void yrc_stateMachineArduino (volatile sig_atomic_t *yrc_stateField, int fdArduinoModem);
int YvonneTerminalInit (struct termios * ttysave);
int YvonneTerminalRestore (struct termios ttysave);
void yrc_stateMachineLocalFailback (volatile sig_atomic_t *yrc_stateField);
char* YvonneGetSceneName(void);
int yrc_Execute (char* srtCommandName, char* strCommandLine);
int yrc_ExecuteForked (char* strCommandName, char* strCommandLine, int *pipe);
char* strstr_last (const char* str1, const char* str2);
int YvonnePhotoCaptureInit (YvonneCamera* cam);
int YvonnePhotoCaptureUnref (YvonneCamera* cam);
int YvonnePhotoCapture (YvonneCamera* cam, const char *filename);
void YvonnePhotoCaptureError (GPContext *context, const char *format, void *data);
void YvonnePhotoCaptureMessage (GPContext *context, const char *format, void *data);
int YvonnePhotoResize (char* filesource, char* filetarget, long width, long height);
#endif //__YVONNEREMOTELIB__