apps/garminusb2nmea-0.12a/garminusb2exif.c File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include "garmin.h"
#include "nmeagen.h"
#include "exifgen.h"

Include dependency graph for garminusb2exif.c:

Go to the source code of this file.

Data Structures

struct  Packet_t

Defines

#define GARMIN_HEADER_SIZE   12
#define GARMIN_MAX_PKTSIZE   512
#define PKTBUF_SIZE   4097
#define D(x)   x
#define EXIF_DEV   "/dev/exif_meta"

Functions

int pktbuf_size ()
int pktbuf_peek (char *buf, int n)
int pktbuf_deq (char *buf, int n)
int pktbuf_enq (char *buf, int n)
int sendpacket (Packet_t *pack)
Packet_trecvpacket (void)
void garmin_pvton (void)
void garmin_privcmd (int fd)
int main (int argc, char *argv[])

Variables

int gps_fd
char pktbuf [PKTBUF_SIZE]
int pktbuf_head = 0
int pktbuf_tail = 0
D800_Pvt_Data_Type lastpvt
cpo_sat_data lastsatdata [12]
int satdata_valid = 0


Define Documentation

#define D ( x   )     x

Definition at line 46 of file garminusb2exif.c.

#define EXIF_DEV   "/dev/exif_meta"

Definition at line 193 of file garminusb2exif.c.

#define GARMIN_HEADER_SIZE   12

Definition at line 42 of file garminusb2exif.c.

Referenced by recvpacket(), and sendpacket().

#define GARMIN_MAX_PKTSIZE   512

Definition at line 43 of file garminusb2exif.c.

Referenced by recvpacket().

#define PKTBUF_SIZE   4097

Definition at line 44 of file garminusb2exif.c.

Referenced by pktbuf_deq(), pktbuf_enq(), pktbuf_peek(), and pktbuf_size().


Function Documentation

void garmin_privcmd ( int  fd  ) 

Definition at line 184 of file garminusb2exif.c.

References write.

Referenced by main().

void garmin_pvton ( void   ) 

Definition at line 170 of file garminusb2exif.c.

References malloc(), Packet_t::mData, Packet_t::mDataSize, Packet_t::mPacketId, Packet_t::mPacketType, Packet_t::mReserved1, Packet_t::mReserved2, Packet_t::mReserved3, and sendpacket().

Referenced by main().

int main ( int  argc,
char *  argv[] 
)

*************************************************************************** ! FILE NAME : autoexposure.c ! DESCRIPTION: Daemon to adjust camera exposure and white balance ! Copyright (C) 2008 Elphel, Inc. ! -----------------------------------------------------------------------------** ! This program 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 ! (at your option) 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/>. ! -----------------------------------------------------------------------------** ! !

Log
autoexposure.c,v
! Revision 1.1.1.1 2008/11/27 20:04:01 elphel ! ! ! Revision 1.16 2008/11/18 19:30:16 elphel ! Added initialization of the "next" frame - otherwise it wait _very_ long if the camera frame number is reset ! ! Revision 1.15 2008/11/15 23:08:24 elphel ! 8.0.alpha17 - split autoexposure source file ! ! Revision 1.14 2008/11/15 07:05:38 elphel ! implemented analog gain control (in addition to gammas) while while balancing ! ! Revision 1.13 2008/11/15 03:10:13 elphel ! Some parameters renamed, reassigned. ! ! Revision 1.12 2008/11/14 07:13:32 elphel ! Added gammaReverse() and gammaDirect() functions, TODO lists, bug fixes ! ! Revision 1.11 2008/11/14 01:01:59 elphel ! cleared debug output ! ! Revision 1.10 2008/11/13 05:40:45 elphel ! 8.0.alpha16 - modified histogram storage, profiling ! ! Revision 1.9 2008/11/08 05:52:21 elphel ! debug feature ! ! Revision 1.8 2008/11/04 17:40:34 elphel ! comment typos ! ! Revision 1.7 2008/11/02 00:32:35 elphel ! added TODO ! ! Revision 1.6 2008/10/31 18:26:32 elphel ! Adding support for constants like SENSOR_REGS32 (defined constant plus 32 to simplify referencing sensor registers from PHP ! ! Revision 1.5 2008/10/29 04:18:28 elphel ! v.8.0.alpha10 made a separate structure for global parameters (not related to particular frames in a frame queue) ! ! Revision 1.4 2008/10/28 07:05:12 elphel ! implemented white balance, HDR mode (1/1 and 2/2) ! ! Revision 1.3 2008/10/26 05:55:38 elphel ! snapshot ! ! Revision 1.2 2008/10/25 19:49:15 elphel ! 8.0.alpha8 - added autoexposure to the installation ! ! Revision 1.1 2008/10/24 00:34:12 elphel ! initial release !

define X313_CHN_DISALL_D 0xaa0 // disable all channels, do not modify refresh or memory as a whole define X313_SDRAM_OFF_D 0xaaa // disable all chennels, refresh and memory itself define X313_SDRAM_ON_D 0xaaf // will disable all channels but refresh

test system memory - now - just for intereference, not a real memory test

allocate memory

deallocate memory

Definition at line 195 of file garminusb2exif.c.

References D, EXIF_DEV, exif_gen(), Exif_GPSInfo_GPSLatitudeRef, exif_init_meta(), exit, fd_exif, free(), garmin_privcmd(), garmin_pvton(), gps_fd, lastpvt, lastsatdata, Packet_t::mData, memcpy(), Packet_t::mPacketId, pktbuf_head, pktbuf_tail, recvpacket(), satdata_valid, SEEK_END, stderr, and write.

int pktbuf_deq ( char *  buf,
int  n 
)

Definition at line 83 of file garminusb2exif.c.

References pktbuf, pktbuf_head, PKTBUF_SIZE, and pktbuf_tail.

Referenced by recvpacket().

int pktbuf_enq ( char *  buf,
int  n 
)

Definition at line 95 of file garminusb2exif.c.

References pktbuf, PKTBUF_SIZE, pktbuf_size(), and pktbuf_tail.

Referenced by recvpacket().

int pktbuf_peek ( char *  buf,
int  n 
)

Definition at line 71 of file garminusb2exif.c.

References pktbuf, pktbuf_head, PKTBUF_SIZE, and pktbuf_tail.

Referenced by recvpacket().

int pktbuf_size (  ) 

Definition at line 67 of file garminusb2exif.c.

References pktbuf_head, PKTBUF_SIZE, and pktbuf_tail.

Referenced by pktbuf_enq(), and recvpacket().

Packet_t* recvpacket ( void   ) 

Definition at line 122 of file garminusb2exif.c.

References free(), GARMIN_HEADER_SIZE, GARMIN_MAX_PKTSIZE, gps_fd, malloc(), pktbuf_deq(), pktbuf_enq(), pktbuf_peek(), pktbuf_size(), read, and stderr.

Referenced by main().

int sendpacket ( Packet_t pack  ) 

Definition at line 112 of file garminusb2exif.c.

References GARMIN_HEADER_SIZE, gps_fd, Packet_t::mDataSize, and write.

Referenced by garmin_pvton().


Variable Documentation

int gps_fd

Definition at line 59 of file garminusb2exif.c.

Referenced by main(), recvpacket(), and sendpacket().

D800_Pvt_Data_Type lastpvt

Definition at line 63 of file garminusb2exif.c.

Referenced by main().

cpo_sat_data lastsatdata[12]

Definition at line 64 of file garminusb2exif.c.

Referenced by main().

char pktbuf[PKTBUF_SIZE]

Definition at line 60 of file garminusb2exif.c.

Referenced by pktbuf_deq(), pktbuf_enq(), and pktbuf_peek().

int pktbuf_head = 0

Definition at line 61 of file garminusb2exif.c.

Referenced by main(), pktbuf_deq(), pktbuf_peek(), and pktbuf_size().

int pktbuf_tail = 0

Definition at line 61 of file garminusb2exif.c.

Referenced by main(), pktbuf_deq(), pktbuf_enq(), pktbuf_peek(), and pktbuf_size().

int satdata_valid = 0

Definition at line 65 of file garminusb2exif.c.

Referenced by main().


Generated on Fri Nov 28 00:07:05 2008 for elphel by  doxygen 1.5.1