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

hp215.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  CamFile
struct  t_camera
struct  t_date
struct  t_mode

Defines

#define NORMAL_MODE   1
#define PRTCMD_MODE   2
#define TSTDAT_MODE   3
#define DATE   1
#define ASCII   2
#define MAX_ITEMS   200
#define PREVIEW_DIR   "preview"
#define FULLSIZE_DIR   "fullsize"
#define SUCCESS   0
#define FAIL   1
#define MUST_USE_A_PICTURE_NUMBER   1
#define MUST_NOT_USE_A_PICTURE_NUMBER   2
#define MAX_DS_STRLEN   1000
#define MAX_PICS   1000
#define ACK   0x06
#define HP_VENDOR_ID   0x3f0
#define HP215_ID   0x6202
#define HP_CMD_INIT   {0x02, 0xce, 0x80, 0x8a, 0x84, 0x8d, 0x83, 0x03}
#define HP_CMD_DATETIME   {0x02, 0xc1, 0x80, 0x8b, 0x84, 0x8e, 0x8d, 0x03}
#define HP_CMD_GET_PHOTO_ALBUM   {0x02, 0xc6, 0x88, 0x80, 0x80, 0x83, 0x84, 0x38, 0x2f, 0x30, 0x32, 0x88, 0x84, 0x8e, 0x8b, 0x03}
#define HP_CMD_DELETE_PICS   {0x02, 0xb1, 0x84, 0x8f, 0x8f, 0x8f, 0x8f, 0x86, 0x80, 0x8a, 0x86, 0x03}

Enumerations

enum  myCodes {
  N_02, N_03, N_02_PLUS1, N_03_PLUS1,
  SUM_PICS_02, SUM_PICS_03, D_02, M_LONG,
  M_SHORT, M_02, M_, Y_02,
  Y_04, H_02_12, H_02_24, H____12,
  H____24, H_AMPM, K_02
}

Functions

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

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

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

int hp_init_sequence (t_camera *)
 Generate a init sequence.

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

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

int hp_sent_ack (t_camera *, int)
int hp_rcv_ack (t_camera *, int)
 Reading a ACK.

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

int hp_get_timeDate_cam (t_camera *)
 Get date and time.

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

int hp_get_timeDate_pics (t_camera *, int, int[MAX_PICS], char *, char *, int, int)
 Get picture time/date.

int hp_get_previews (t_camera *, int, int[MAX_PICS], char *)
 Get previews.

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

int hp_get_write_pics (t_camera *, int, int[MAX_PICS], char *)
 Write picture.

int hp_delete_pics (t_camera *, int, int, int[MAX_PICS])
 Delete pictures.

int hp_delete_all_pics (t_camera *)
 Delete pictures.

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

void hp_create_html_page (t_camera *, int, int[MAX_PICS], char *, int, int, int)
 Write picture.

int hp_close (t_camera *)
void read_ini (t_mode *mode)
 Read the commandline.

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

void usage (void)
 Prints programm usage.

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

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

void read_number (int *, int[1000], char *)
void getDateStr (char *, unsigned int, unsigned int, t_date, char *, int)
 Generate datetime string.

void test_dateString (char *)
 Test datetime string.

void check_dateStr (char *)
 Check the date string.

void test_cmd (t_mode)
 Prints programm usage.

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

void ini_delComment (char *)
 Delete comments.

void acceptOptions (t_mode *, int *, char **[], int)
 Read the commandline.

void init_modeValues (t_mode *)
 Init mode values.

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

void myExit (int, int)
void removeLockFile (void)
 Deletes the lock file.

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


Define Documentation

#define ACK   0x06
 

Definition at line 75 of file hp215.h.

Referenced by hp_rcv_ack(), and hp_send_ack().

#define ASCII   2
 

Definition at line 52 of file hp215.h.

Referenced by getDateStr().

#define DATE   1
 

Definition at line 51 of file hp215.h.

Referenced by getDateStr().

#define FAIL   1
 

Definition at line 62 of file hp215.h.

Referenced by 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(), and hp_write_previews().

#define FULLSIZE_DIR   "fullsize"
 

Definition at line 58 of file hp215.h.

Referenced by hp_get_timeDate_pics(), and main().

#define HP215_ID   0x6202
 

Definition at line 78 of file hp215.h.

Referenced by hp_open().

#define HP_CMD_DATETIME   {0x02, 0xc1, 0x80, 0x8b, 0x84, 0x8e, 0x8d, 0x03}
 

Definition at line 82 of file hp215.h.

Referenced by hp_get_timeDate_cam().

#define HP_CMD_DELETE_PICS   {0x02, 0xb1, 0x84, 0x8f, 0x8f, 0x8f, 0x8f, 0x86, 0x80, 0x8a, 0x86, 0x03}
 

Definition at line 84 of file hp215.h.

Referenced by hp_delete_all_pics().

#define HP_CMD_GET_PHOTO_ALBUM   {0x02, 0xc6, 0x88, 0x80, 0x80, 0x83, 0x84, 0x38, 0x2f, 0x30, 0x32, 0x88, 0x84, 0x8e, 0x8b, 0x03}
 

Definition at line 83 of file hp215.h.

Referenced by hp_get_photo_album().

#define HP_CMD_INIT   {0x02, 0xce, 0x80, 0x8a, 0x84, 0x8d, 0x83, 0x03}
 

Definition at line 81 of file hp215.h.

Referenced by hp_init_sequence().

#define HP_VENDOR_ID   0x3f0
 

Definition at line 77 of file hp215.h.

Referenced by hp_open().

#define MAX_DS_STRLEN   1000
 

Definition at line 69 of file hp215.h.

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

#define MAX_ITEMS   200
 

Definition at line 54 of file hp215.h.

Referenced by getDateStr().

#define MAX_PICS   1000
 

Definition at line 72 of file hp215.h.

#define MUST_NOT_USE_A_PICTURE_NUMBER   2
 

Definition at line 66 of file hp215.h.

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

#define MUST_USE_A_PICTURE_NUMBER   1
 

Definition at line 65 of file hp215.h.

Referenced by getDateStr(), and hp_get_timeDate_pics().

#define NORMAL_MODE   1
 

Definition at line 46 of file hp215.h.

Referenced by acceptOptions().

#define PREVIEW_DIR   "preview"
 

Definition at line 57 of file hp215.h.

Referenced by hp_get_timeDate_pics(), and main().

#define PRTCMD_MODE   2
 

Definition at line 47 of file hp215.h.

Referenced by acceptOptions(), and main().

#define SUCCESS   0
 

Definition at line 61 of file hp215.h.

Referenced by hp_append_file(), hp_delete_all_pics(), hp_delete_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(), and test_cmd().

#define TSTDAT_MODE   3
 

Definition at line 48 of file hp215.h.

Referenced by acceptOptions(), and main().


Enumeration Type Documentation

enum myCodes
 

Enumeration values:
N_02 
N_03 
N_02_PLUS1 
N_03_PLUS1 
SUM_PICS_02 
SUM_PICS_03 
D_02 
M_LONG 
M_SHORT 
M_02 
M_ 
Y_02 
Y_04 
H_02_12 
H_02_24 
H____12 
H____24 
H_AMPM 
K_02 

Definition at line 87 of file hp215.h.


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().

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().

int hp_close t_camera  ) 
 

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_sent_ack t_camera ,
int 
 

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().

void myExit int  ,
int 
 

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 *  ,
int  [1000],
char * 
 

Referenced by acceptOptions().

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().


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