Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

hp215.c File Reference

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <sys/types.h>
#include <linux/limits.h>
#include <usb.h>
#include <ctype.h>
#include <time.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include "../config.h"
#include <locale.h>
#include <libintl.h>
#include "hp215.h"

Include dependency graph for hp215.c:

Include dependency graph

Go to the source code of this file.

Defines

#define _(String)   gettext (String)

Functions

void dprint (char *msg)
 This function prints debug information.

void hex_dump (unsigned char *msg, int size, char *text)
 This function prints a hexdump from data.

int hp_gen_cmd (int cmd, int num, unsigned char *buffer)
 Generate a camera commando.

int hp_new_file (CamFile **file)
 Space for a new file.

int hp_append_file (CamFile *file, const unsigned char *data, unsigned long int size)
 Append filedata.

int hp_send_ack (t_camera *cam, int ep)
 Sending ACK.

int hp_rcv_ack (t_camera *cam, int ep)
 Reading a ACK.

usb_device * find_device (int vendorID, int productID)
 Searches for the usb device.

int hp_open (t_camera *cam, int tryInitCamTwice)
 Open the camera.

int hp_init_sequence (t_camera *cam)
 Generate a init sequence.

int hp_get_timeDate_cam (t_camera *cam)
 Get date and time.

int hp_get_photo_album (t_camera *cam)
 Get the number of pictures.

int hp_get_previews (t_camera *cam, int picNumbers, int picNumber[MAX_PICS], char *subDir)
 Get previews.

int hp_write_previews (t_camera *cam, int picNumbers, int picNumber[MAX_PICS])
 Write previews.

int hp_get_write_pics (t_camera *cam, int picNumbers, int picNumber[MAX_PICS], char *subDir)
 Write picture.

int hp_delete_pics (t_camera *cam, int picAll, int picNumbers, int picNumber[MAX_PICS])
 Delete pictures.

int hp_delete_some_pics (t_camera *cam, int picNumbers, int picNumber[MAX_PICS])
 Delete pictures.

int hp_delete_all_pics (t_camera *cam)
 Delete pictures.

void hp_create_html_page (t_camera *cam, int picNumbers, int picNumber[MAX_PICS], char *subDir, int prev, int pics, int subDirFull)
 Write picture.

void read_ini (t_mode *mode)
 Read the commandline.

void ini_delComment (char *buf)
 Delete comments.

void ini_getNoElements (int *no, char *buf)
 Get the number of elements on the string.

void init_modeValues (t_mode *mode)
 Init mode values.

void read_cmd (int *argc, char ***argv, t_mode *mode)
 Read the commandline.

void acceptOptions (t_mode *mode, int *argc, char **argv[], int callmode)
 Read the commandline.

void gen_subDirName (char subdir[100])
 Generate sub dir name.

void gen_subDir (char subdir[100])
 Generate sub directory.

int hp_get_timeDate_pics (t_camera *cam, int picNumbers, int picNumber[MAX_PICS], char *subDir, char *dateStr, int subDirPrev, int subDirFull)
 Get picture time/date.

void read_number (int *picNumbers, int picNumber[MAX_PICS], char *noStr)
 Get picture time/date.

void getDateStr (char *inStr, unsigned int picSum, unsigned int picNo, t_date date, char *picStr, int mode)
 Generate datetime string.

void test_dateString (char *dateStr)
 Test datetime string.

void check_dateStr (char *dateStr)
 Check the date string.

void test_cmd (t_mode mode)
 Prints programm usage.

void checkPid (void)
 Checks if the program is already running.

void removeLockFile (void)
 Deletes the lock file.

void myExit (int value, int doRemoveLockFile)
void usage (void)
 Prints programm usage.

void add_dateInsidePicture (char *dateInPicStr, int picNumbers, int picNumber[MAX_PICS], t_camera *myCam)
 Adds date/time string in the picture.

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

Variables

char monNameLong [12][30]
char monNameShort [12][30]
int DEBUG = 0
int TIMEOUT
int DEBUG_HEXDUMP = 0


Define Documentation

#define _ String   )     gettext (String)
 

Definition at line 124 of file hp215.c.

Referenced by acceptOptions(), add_dateInsidePicture(), checkPid(), gen_subDir(), getDateStr(), hex_dump(), hp_append_file(), hp_create_html_page(), hp_delete_all_pics(), hp_delete_some_pics(), hp_gen_cmd(), hp_get_photo_album(), hp_get_previews(), hp_get_timeDate_cam(), hp_get_timeDate_pics(), hp_get_write_pics(), hp_init_sequence(), hp_new_file(), hp_open(), hp_rcv_ack(), hp_send_ack(), hp_write_previews(), init_modeValues(), main(), read_cmd(), read_ini(), read_number(), removeLockFile(), test_cmd(), test_dateString(), and usage().


Function Documentation

void acceptOptions t_mode mode,
int *  argc,
char **  argv[],
int  callmode
 

Parameters:
mode (i|o) Options
argc (i|o) Number of arguments
argv (i|o) Arguments
callmode (i|o) Callmode (1 = commandline, 0 = init file)

This function reads the commandline options.


Definition at line 2217 of file hp215.c.

References _, t_mode::albm, t_mode::dateCam, t_mode::dateInPic, t_mode::dateInPicStr, t_mode::datePics, t_mode::dateStr, DEBUG, DEBUG_HEXDUMP, t_mode::delt, t_mode::forceDeletion, t_mode::html, t_mode::main, MAX_DS_STRLEN, myExit(), NORMAL_MODE, t_mode::picNumber, t_mode::picNumberRH, t_mode::picNumberRL, t_mode::picNumberRR, t_mode::picNumbers, t_mode::picNumbersRH, t_mode::picNumbersRL, t_mode::picNumbersRR, t_mode::pics, t_mode::prev, t_mode::printCmd_cmd, t_mode::printCmd_picNo, PRTCMD_MODE, read_number(), t_mode::subDirFull, t_mode::subDirPrev, TIMEOUT, t_mode::tmp_html, t_mode::tryInitCamTwice, TSTDAT_MODE, and usage().

Referenced by read_cmd(), and read_ini().

void add_dateInsidePicture char *  dateInPicStr,
int  picNumbers,
int  picNumber[MAX_PICS],
t_camera myCam
 

Parameters:
dateInPicStr (i|-) String with the date/time format.
picNumbers (i|-) Numbers of pictures.
picNumber (i|-) All picture numbers.
myCam (i|-) Pointer to the usb device

This function deletes the lock file and exits.


Definition at line 4088 of file hp215.c.

References _, DEBUG, getDateStr(), MAX_DS_STRLEN, MUST_NOT_USE_A_PICTURE_NUMBER, CamFile::name, and t_camera::pic.

Referenced by main().

void check_dateStr char *  dateStr  ) 
 

Parameters:
dateStr (i|-)


This function checks the values of the given date string by using the function "getDateStr".

Definition at line 3676 of file hp215.c.

References t_date::day, getDateStr(), t_date::hour, MAX_DS_STRLEN, t_date::min, t_date::month, MUST_NOT_USE_A_PICTURE_NUMBER, t_date::sec, and t_date::year.

Referenced by main().

void checkPid void   ) 
 

This function checks if the programm is already running. If yes it will abboard. If not it will continue.


Definition at line 3739 of file hp215.c.

References _, DEBUG, dprint(), and removeLockFile().

Referenced by main().

void dprint char *  msg  ) 
 

Parameters:
msg (i|-) String

This function prints debug information if the debug commandline option was set.


Definition at line 152 of file hp215.c.

References DEBUG.

Referenced by checkPid(), hp_delete_all_pics(), hp_delete_some_pics(), hp_get_photo_album(), hp_get_previews(), hp_get_timeDate_cam(), hp_get_timeDate_pics(), hp_get_write_pics(), hp_init_sequence(), hp_open(), hp_rcv_ack(), hp_send_ack(), and removeLockFile().

struct usb_device * find_device int  vendorID,
int  productID
 

Parameters:
vendorID (i|-) Vendor ID of the device.
productID (i|-) Product ID of the device.

This function searches through all busses and all bus devices to the given vendor and product ID.


Definition at line 548 of file hp215.c.

References find_device().

Referenced by find_device(), and hp_open().

void gen_subDir char  subdir[100]  ) 
 

Parameters:
subdir [i|o] Subdirectory name

This makes the directory.


Definition at line 2740 of file hp215.c.

References _, and myExit().

Referenced by main().

void gen_subDirName char  subdir[100]  ) 
 

Parameters:
subdir [i|o] Subdirectory name

This function creates new directory name with actual date.


Definition at line 2709 of file hp215.c.

References monNameShort.

Referenced by main().

void getDateStr char *  inStr,
unsigned int  picSum,
unsigned int  picNo,
t_date  date,
char *  picStr,
int  mode
 

Parameters:
inStr (i|-) The datetime string
picSum (i|-) Number of pictures
picNo (i|-) Actual picture number
date (i|-) Date/time informations
picStr (i|o) Generated date time string
mode (i|-) Mode of this function

This function used the inStr, picSum, picNo and date to generate a picStr String.

Hier is an overview of all codes:

== implemented N == New added and was bevore == -

1 N Pic number: 00-xx 2 N Pic number: 000-xxx 3 N Pic number: 01-xx 4 N Pic number: 001-xxx a Sun..Sat A Sunday..Saturday b * Jan..Dec B * Januar..December c Sat Nov 04 12:02:33 EST 1989 C - d * day of month 01..31 D mm/dd/yy e day of month _1..31 E - f N - d.of month 1..31 F - g - G - h ==b H * hour 00..23 i - I * hour 01..12 j day of year 001..366 J N hour 0..23 k hour _0..23 K N hour 0..12 l hour _0..12 L - m * mont 01..12 M * minu 00..59 n NEWLINE N - o - O - p * AM/PM P - q N Sum of pics: 01-xx Q N Sum of pics: 001-xxx r hh:mm:ss [AP]M (12h) R - s sec subce 1.1.1970 00:00:00 S Seconds 00..60 t TAB T hh:mm:ss (25h) u - U week number 00..53 Sunday f. day v - V week number 01..52 Monday f. day w day of week 0..6 0=Sunday W week number 00..53 Monday f. day x mm/dd/yy (locale date) X H:M:S (locate time) y * year 00..99 Y * year 1970.. z RFC-822 ?? Z Time zone (EDT, MET)

Definition at line 3243 of file hp215.c.

References _, ASCII, D_02, DATE, t_date::day, H_02_12, H_02_24, H____12, H____24, H_AMPM, t_date::hour, K_02, M_, M_02, M_LONG, M_SHORT, MAX_DS_STRLEN, MAX_ITEMS, t_date::min, monNameLong, monNameShort, t_date::month, MUST_USE_A_PICTURE_NUMBER, myExit(), N_02, N_02_PLUS1, N_03, N_03_PLUS1, SUM_PICS_02, SUM_PICS_03, Y_02, Y_04, and t_date::year.

Referenced by add_dateInsidePicture(), check_dateStr(), hp_get_timeDate_pics(), and test_dateString().

void hex_dump unsigned char *  msg,
int  size,
char *  text
 

Parameters:
msg (i|-) String
size (i|-) Number of chars for the hex dump
text (i|-) Info for the hexdump

This function print data as hex dump. It is used as fallback if a problem appears. It can be activated with commandline options.


Definition at line 178 of file hp215.c.

References _, and DEBUG_HEXDUMP.

Referenced by hp_delete_some_pics(), hp_get_photo_album(), hp_get_previews(), hp_get_timeDate_cam(), hp_get_timeDate_pics(), and test_cmd().

int hp_append_file CamFile file,
const unsigned char *  data,
unsigned long int  size
 

Parameters:
file (i|o) Pointer to the camfile
data (i|-) Input data.
size (i|-) ?

This function appends filedata (data) to the new file space (file->data).


Definition at line 421 of file hp215.c.

References _, CamFile::data, myExit(), CamFile::size, and SUCCESS.

Referenced by hp_get_previews().

void hp_create_html_page t_camera cam,
int  picNumbers,
int  picNumber[MAX_PICS],
char *  subDir,
int  prev,
int  pics,
int  subDirFull
 

Parameters:
cam (i|o) Pointer to the usb device ?!
picNumbers (i|-) Number of pictures
picNumber (i|-) Each picture number
subDir (i|-) Subdirectory name
prev (i|-) Previews ?
pics (i|-) Great pictures ?
subDirFull (i|-) Sub dir fullsize used ?

This function creates a main html page index.html and for each picture a own html page. If there are no fullsize pictures getten, only the main html page will be created.

Definition at line 1563 of file hp215.c.

References _, monNameLong, myExit(), CamFile::name_nsd, t_camera::pic, and CamFile::preview_name_nsd.

Referenced by main().

int hp_delete_all_pics t_camera cam  ) 
 

Parameters:
cam (-|-) Pointer to the usb device ?!

This function deletes the pictures.


Definition at line 1483 of file hp215.c.

References _, t_camera::dh, dprint(), FAIL, HP_CMD_DELETE_PICS, hp_get_photo_album(), hp_rcv_ack(), hp_send_ack(), t_camera::num_pics, SUCCESS, and TIMEOUT.

Referenced by hp_delete_pics().

int hp_delete_pics t_camera cam,
int  picAll,
int  picNumbers,
int  picNumber[MAX_PICS]
 

Parameters:
cam (-|-) Pointer to the usb device ?!
picAll (i|-) All pictures ? (ja/no)
picNumbers (i|-) Number of pictures
picNumber (i|-) Each picture number

This function deletes the pictures.


Definition at line 1364 of file hp215.c.

References hp_delete_all_pics(), hp_delete_some_pics(), and SUCCESS.

Referenced by main().

int hp_delete_some_pics t_camera cam,
int  picNumbers,
int  picNumber[MAX_PICS]
 

Parameters:
cam (i|-) Pointer to the usb device ?!
picNumbers (i|-) Number of pictures
picNumber (i|-) Each picture number

This function deletes the pictures.


Definition at line 1396 of file hp215.c.

References _, t_camera::dh, dprint(), FAIL, hex_dump(), hp_gen_cmd(), hp_get_photo_album(), hp_rcv_ack(), hp_send_ack(), t_camera::num_pics, SUCCESS, and TIMEOUT.

Referenced by hp_delete_pics().

int hp_gen_cmd int  cmd,
int  num,
unsigned char *  buffer
 

Parameters:
cmd (i|-) Command
num (i|-) Number of the picture (1..n)
buffer (i|-)

For picture/thumbnail and pic date/time request, the following algorithm is used to generate the cmd to send to the camera for each picture.

Thanks to Roberto Ragusa for figuring out the algorithm for this. I would have never figured it out..

| b u f f e r | 0 1cmd 2 3 4 5 6 7 8 9 10 11 -------------------------------+--------------------------------------------------------------- Request for a preview | 0x02 0xb3 0x84 0x80 ... 0x03 Request for a picture | 0x02 0xb4 0x84 0x80 ... 0x03 Request date/time for preview | 0x02 0xc5 0x84 0x80 ... 0x03 Request for deleting one pic | 0x02 0xb1 0x84 0x80 ... 0x03

Picture number: ---------------- buffer[4] = ((num&0xf00)>>8) | 0x80; buffer[5] = ((num&0xf0 )>>4) | 0x80; buffer[6] = ((num&0xf ) ) | 0x80;

Rest: ----- x4 = buffer[4] & 0xf; x5 = buffer[5] & 0xf; x6 = buffer[6] & 0xf;

Request for a preview : myx7=0xf myx8=0x2 myx9=0xe myx10=0x8 Request for a picture : myx7=0x3 myx8=0xa myx9=0xa myx10=0x9 Request date/time for preview: myx7=0x3 myx8=0xa myx9=0x9 myx10=0x5 Request for delete one pict. : myx7=0x7 myx8=0x9 myx9=0xa myx10=0x8

myx7 ^= x6 ^ ((x5<<1)&0xf) ^ x5 ^ ((x4<<1)&0xf) ^ x4 ^ x4>>2; myx8 ^= (x6>>3) ^ ((x5<<1)&0xf) ^ (x5>>3) ^ x5 ^ ((x4<<2)&0xf) ^ ((x4<<1)&0xf) ^ x4; myx9 ^= ((x6<<1)&0xf) ^ ((x5>>3<<1)&0xf) ^ ((x5<<1)&0xf) ^ x5 ^ ((x4<<1)&0xf) ^ x4; myx10 ^= x6 ^ x5 ^ (x5>>3);

buffer[7] = myx7 | 0x80; buffer[8] = myx8 | 0x80; buffer[9] = myx9 | 0x80; buffer[10] = myx10 | 0x80;

buffer[11] = 0x03;

Definition at line 312 of file hp215.c.

References _, FAIL, and SUCCESS.

Referenced by hp_delete_some_pics(), hp_get_previews(), hp_get_timeDate_pics(), hp_get_write_pics(), and test_cmd().

int hp_get_photo_album t_camera cam  ) 
 

Parameters:
cam (i|o) Pointer to the usb device ?!

The following trace shows the cmd and response transaction to retreive the number of pictures in the camera's photo album

000013 B> 00000000: 02c6 8880 8083 8438 2f30 3288 848e 8b03 .......8/02.....

000014 B< 00000000: 06 .

000015 B< 00000000: 02c6 aae0 e050 686f 746f 416c 6275 6d00 .....PhotoAlbum. 00000010: 3a32 3600 8080 0180 8182 8c81 8080 8080 :26............. 00000020: 8080 8080 e480 8080 8080 8080 8087 8084 ................ 00000030: 8a03 ..

000016 B> 00000000: 06 .
The first cmd in the trace is sent to the camera. It appears to change depending on some factors. For example, it seems to use the last 4 digits of the date returned from the camera as part of the cmd that is sent (the 8/02 above is from 7/18/02 that was returned from the camera in hp_get_timeDate_cam. However, I have found that I can use the above command as is regardless of the date/time and still receive the PhotoAlbum correctly, so I've implemented it as a static call./n/n

From observation, the 43+44+45th lower words of the returned msg contains the number of pictures in the camera.


Definition at line 931 of file hp215.c.

References _, t_camera::dh, dprint(), FAIL, hex_dump(), HP_CMD_GET_PHOTO_ALBUM, hp_rcv_ack(), hp_send_ack(), t_camera::num_pics, SUCCESS, and TIMEOUT.

Referenced by hp_delete_all_pics(), hp_delete_some_pics(), and main().

int hp_get_previews t_camera cam,
int  picNumbers,
int  picNumber[MAX_PICS],
char *  subDir
 

Parameters:
cam (i|o) Pointer to the usb device ?!
picNumbers (i|-) Number of pictures
picNumber (i|-) Each picture number
subDir (i|-) Subdirectory name

This function read the previews from the digicam.


Definition at line 1024 of file hp215.c.

References _, DEBUG, t_camera::dh, dprint(), FAIL, hex_dump(), hp_append_file(), hp_gen_cmd(), hp_rcv_ack(), hp_send_ack(), t_camera::pic, SUCCESS, and TIMEOUT.

Referenced by main().

int hp_get_timeDate_cam t_camera cam  ) 
 

Parameters:
cam (i|-) Pointer to the usb device ?!

This function will read the date and time of the camera.


Definition at line 811 of file hp215.c.

References _, t_date::day, t_camera::dh, dprint(), FAIL, hex_dump(), t_date::hour, HP_CMD_DATETIME, hp_rcv_ack(), hp_send_ack(), t_date::min, monNameShort, t_date::month, SUCCESS, TIMEOUT, and t_date::year.

Referenced by main().

int hp_get_timeDate_pics t_camera cam,
int  picNumbers,
int  picNumber[MAX_PICS],
char *  subDir,
char *  dateStr,
int  subDirPrev,
int  subDirFull
 

Parameters:
cam (i|o) Pointer to the usb device ?!
picNumbers (i|-) Number of pictures
picNumber (i|-) Each picture number
subDir (i|-) Subdirectory name
dateStr (i|-) Given date/time string
subDirPrev (i|-) Subdirectory name for previews
subDirFull (i|-) Subdirectory name for fullsize pictures

This function reads the time/date of each selected picture und creates the preview and picture names.

Definition at line 2783 of file hp215.c.

References _, DEBUG, t_camera::dh, dprint(), FAIL, FULLSIZE_DIR, getDateStr(), hex_dump(), hp_gen_cmd(), hp_new_file(), hp_rcv_ack(), hp_send_ack(), MAX_DS_STRLEN, monNameShort, MUST_USE_A_PICTURE_NUMBER, t_camera::pic, PREVIEW_DIR, SUCCESS, and TIMEOUT.

Referenced by main().

int hp_get_write_pics t_camera cam,
int  picNumbers,
int  picNumber[MAX_PICS],
char *  subDir
 

Parameters:
cam (i|o) Pointer to the usb device ?!
picNumbers (i|-) Number of pictures
picNumber (i|-) Each picture number
subDir (i|-) Subdirectory name

This function writes all pictures in the camera to jpg files. This is done directly instead of filling an internal data struct with the pictures first. I figured there's no reason to waste internel memory by holding several megabytes of picture data.!

Definition at line 1225 of file hp215.c.

References _, CamFile::date_time, t_camera::dh, dprint(), FAIL, hp_gen_cmd(), hp_rcv_ack(), hp_send_ack(), myExit(), CamFile::name, t_camera::pic, SUCCESS, and TIMEOUT.

Referenced by main().

int hp_init_sequence t_camera cam  ) 
 

Parameters:
cam (i|-) Pointer to the usb device ?!

This function does the initialisation sequence. The following init sequence is visible in all traces I've done, so it is most likely needed before any other command is sent

000005 B> 00000000: 02ce 808a 848d 8303 ........ 000006 B< 00000000: 06 . 000007 B< 00000000: 02ce 82e0 e08a 8985 8803 .......... 000008 B> 00000000: 06 .



Definition at line 702 of file hp215.c.

References _, t_camera::dh, dprint(), FAIL, HP_CMD_INIT, hp_rcv_ack(), hp_send_ack(), myExit(), SUCCESS, and TIMEOUT.

Referenced by main().

int hp_new_file CamFile **  file  ) 
 

Parameters:
file (i|o) Pointer to the camfile

This function allocates a new pointer to a memory space for a new camera file.


Definition at line 386 of file hp215.c.

References _, FAIL, and SUCCESS.

Referenced by hp_get_timeDate_pics().

int hp_open t_camera cam,
int  tryInitCamTwice
 

Parameters:
cam (i|-) Pointer to the usb device ?!
tryInitCamTwice (i|-) Try opening camera twice

This function finds the camera and opens its.


Definition at line 589 of file hp215.c.

References _, DEBUG, t_camera::device, t_camera::dh, dprint(), FAIL, find_device(), HP215_ID, HP_VENDOR_ID, and SUCCESS.

Referenced by main().

int hp_rcv_ack t_camera cam,
int  ep
 

Parameters:
cam (i|-) Pointer to the usb device ?!
ep (i|-) ????

This function reads a ACK command from the digicam.


Definition at line 511 of file hp215.c.

References _, ACK, t_camera::dh, dprint(), FAIL, SUCCESS, and TIMEOUT.

Referenced by hp_delete_all_pics(), hp_delete_some_pics(), hp_get_photo_album(), hp_get_previews(), hp_get_timeDate_cam(), hp_get_timeDate_pics(), hp_get_write_pics(), and hp_init_sequence().

int hp_send_ack t_camera cam,
int  ep
 

Parameters:
cam (i|-) Pointer to the usb device ?!
ep (i|-) ???

This function sends a ACK command to the digicam.


Definition at line 475 of file hp215.c.

References _, ACK, t_camera::dh, dprint(), FAIL, SUCCESS, and TIMEOUT.

Referenced by hp_delete_all_pics(), hp_delete_some_pics(), hp_get_photo_album(), hp_get_previews(), hp_get_timeDate_cam(), hp_get_timeDate_pics(), hp_get_write_pics(), and hp_init_sequence().

int hp_write_previews t_camera cam,
int  picNumbers,
int  picNumber[MAX_PICS]
 

Parameters:
cam (i|-) Pointer to the usb device ?!
picNumbers (i|-) Number of pictures
picNumber (i|-) Each picture number

This function saves the previews.


Definition at line 1167 of file hp215.c.

References _, FAIL, t_camera::pic, and SUCCESS.

Referenced by main().

void ini_delComment char *  buf  ) 
 

Parameters:
buf (i|o) String (one line) of the ini file

This function is looking for comments. Comments are ignored.


Definition at line 1939 of file hp215.c.

Referenced by read_ini().

void ini_getNoElements int *  no,
char *  buf
 

Parameters:
no (i|o) Number of elements on the string
buf (i|o) String (one line) of the ini file

This function looks for the number of elements of the given string.


Definition at line 2001 of file hp215.c.

Referenced by read_ini().

void init_modeValues t_mode mode  ) 
 

Parameters:
mode (i|o) Options

This function inits all mode values before using them.


Definition at line 2062 of file hp215.c.

References _, t_mode::albm, t_mode::dateCam, t_mode::dateInPic, t_mode::dateInPicStr, t_mode::datePics, t_mode::dateStr, t_mode::delt, t_mode::forceDeletion, t_mode::html, t_mode::main, monNameLong, monNameShort, t_mode::picNumberRH, t_mode::picNumberRL, t_mode::picNumberRR, t_mode::picNumbers, t_mode::picNumbersAll, t_mode::picNumbersRH, t_mode::picNumbersRL, t_mode::picNumbersRR, t_mode::pics, t_mode::prev, t_mode::subDirFull, t_mode::subDirPrev, TIMEOUT, t_mode::tmp_html, and t_mode::tryInitCamTwice.

Referenced by main().

int main int  argc,
char *  argv[]
 

Definition at line 4139 of file hp215.c.

References _, add_dateInsidePicture(), t_mode::albm, check_dateStr(), checkPid(), t_mode::dateCam, t_mode::dateInPic, t_mode::dateInPicStr, t_mode::datePics, t_mode::dateStr, DEBUG, t_mode::delt, t_camera::dh, t_mode::forceDeletion, FULLSIZE_DIR, gen_subDir(), gen_subDirName(), hp_create_html_page(), hp_delete_pics(), hp_get_photo_album(), hp_get_previews(), hp_get_timeDate_cam(), hp_get_timeDate_pics(), hp_get_write_pics(), hp_init_sequence(), hp_open(), hp_write_previews(), t_mode::html, init_modeValues(), t_mode::main, myExit(), CamFile::name, t_camera::num_pics, t_camera::pic, t_mode::picNumber, t_mode::picNumberRH, t_mode::picNumberRL, t_mode::picNumberRR, t_mode::picNumbers, t_mode::picNumbersAll, t_mode::picNumbersRH, t_mode::picNumbersRL, t_mode::picNumbersRR, t_mode::pics, t_mode::prev, PREVIEW_DIR, CamFile::preview_name, PRTCMD_MODE, read_cmd(), read_ini(), removeLockFile(), t_mode::subDir, t_mode::subDirFull, t_mode::subDirPrev, test_cmd(), test_dateString(), t_mode::tryInitCamTwice, and TSTDAT_MODE.

void myExit int  value,
int  doRemoveLockFile
 

Definition at line 3870 of file hp215.c.

References removeLockFile().

Referenced by acceptOptions(), gen_subDir(), getDateStr(), hp_append_file(), hp_create_html_page(), hp_get_write_pics(), hp_init_sequence(), main(), read_cmd(), read_ini(), and read_number().

void read_cmd int *  argc,
char ***  argv,
t_mode mode
 

Parameters:
argc (i|o) Number of arguments
argv (i|o) Arguments
mode (i|o) Options

This function reads the commandline options.


Definition at line 2164 of file hp215.c.

References _, acceptOptions(), t_mode::html, t_mode::main, myExit(), t_mode::tmp_html, and usage().

Referenced by main().

void read_ini t_mode mode  ) 
 

Parameters:
mode (i|o) Options

This function reads the ini file ~/.hp215 options .


Definition at line 1755 of file hp215.c.

References _, acceptOptions(), ini_delComment(), ini_getNoElements(), and myExit().

Referenced by main().

void read_number int *  picNumbers,
int  picNumber[MAX_PICS],
char *  noStr
 

Parameters:
picNumbers (i|o) Number of pictures
picNumber (i|o) Each picture number
noStr (i|-) Comandline input

This function reads the time/date of each selected picture und creates the preview and picture names.

Definition at line 2968 of file hp215.c.

References _, DEBUG, and myExit().

void removeLockFile void   ) 
 

This function deletes the lock file.


Definition at line 3822 of file hp215.c.

References _, and dprint().

Referenced by checkPid(), main(), and myExit().

void test_cmd t_mode  mode  ) 
 

Parameters:
mode (i|-) given options

This function prints the camera command.


Definition at line 3709 of file hp215.c.

References _, DEBUG_HEXDUMP, hex_dump(), hp_gen_cmd(), t_mode::printCmd_cmd, t_mode::printCmd_picNo, and SUCCESS.

Referenced by main().

void test_dateString char *  dateStr  ) 
 

Parameters:
dateStr (i|-) The datetime string

This function used the dateStr from the commandline with some synthectic values (number of pictures, picture number, day, month, year, hour, minute) to generate the picture string for test issues.

Definition at line 3621 of file hp215.c.

References _, t_date::day, getDateStr(), t_date::hour, MAX_DS_STRLEN, t_date::min, t_date::month, MUST_NOT_USE_A_PICTURE_NUMBER, t_date::sec, and t_date::year.

Referenced by main().

void usage void   ) 
 

This function prints the usage of this programm.


Definition at line 3896 of file hp215.c.

References _.

Referenced by acceptOptions(), and read_cmd().


Variable Documentation

int DEBUG = 0
 

Definition at line 133 of file hp215.c.

Referenced by acceptOptions(), add_dateInsidePicture(), checkPid(), dprint(), hp_get_previews(), hp_get_timeDate_pics(), hp_open(), main(), and read_number().

int DEBUG_HEXDUMP = 0
 

Definition at line 135 of file hp215.c.

Referenced by acceptOptions(), hex_dump(), and test_cmd().

char monNameLong[12][30]
 

Definition at line 129 of file hp215.c.

Referenced by getDateStr(), hp_create_html_page(), and init_modeValues().

char monNameShort[12][30]
 

Definition at line 130 of file hp215.c.

Referenced by gen_subDirName(), getDateStr(), hp_get_timeDate_cam(), hp_get_timeDate_pics(), and init_modeValues().

int TIMEOUT
 

Definition at line 134 of file hp215.c.

Referenced by acceptOptions(), hp_delete_all_pics(), hp_delete_some_pics(), hp_get_photo_album(), hp_get_previews(), hp_get_timeDate_cam(), hp_get_timeDate_pics(), hp_get_write_pics(), hp_init_sequence(), hp_rcv_ack(), hp_send_ack(), and init_modeValues().


Generated on Tue Oct 21 18:10:51 2003 for hp_photosmart215 by doxygen 1.3.2