Skip to content

Commit

Permalink
- Fixed bad file descriptor error when MSC connection is unsuccesful
Browse files Browse the repository at this point in the history
- Experimental support for K3III
- DNG files now save as .dng files instead of .raw
  • Loading branch information
karlrees committed May 25, 2024
1 parent 68b8f50 commit 47189d0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion indi-pentax/pktriggercord_ccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ const char * PkTriggerCordCCD::getFormatFileExtension(user_file_format format)
}
else if (format == USER_FILE_FORMAT_DNG)
{
return "raw";
return "dng";
}
else
{
Expand Down
14 changes: 6 additions & 8 deletions libpktriggercord/src/pktriggercord-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ bool astrotracer_before=false;
bool need_bulb_new_cleanup=false;
bool need_one_push_bracketing_cleanup=false;

#if 0 // UNUSED - INDI modification, reapply for next update
#ifdef RAD10
static option const longopts[] = {
#else
Expand Down Expand Up @@ -118,7 +117,6 @@ static struct option const longopts[] = {
{"settings", no_argument, NULL, 'S'},
{ NULL, 0, NULL, 0}
};
#endif // INDI modification, reapply for next update

int save_buffer(pslr_handle_t camhandle, int bufno, int fd, pslr_status *status, user_file_format filefmt, int jpeg_stars) {
pslr_buffer_type imagetype;
Expand Down Expand Up @@ -153,9 +151,9 @@ int save_buffer(pslr_handle_t camhandle, int bufno, int fd, pslr_status *status,
ssize_t r = write(fd, buf, bytes);
if (r == 0) {
DPRINT("write(buf): Nothing has been written to buf.\n");
} else if (r < 0) { // r<0 - INDI modification, reapply for next update
} else if (r == -1) {
perror("write(buf)");
} else if ((uint32_t)r < bytes) {
} else if ((uint32_t)r < bytes) {
DPRINT("write(buf): only write %zu bytes, should be %d bytes.\n", r, bytes);
}
current += bytes;
Expand All @@ -182,9 +180,9 @@ void save_memory(pslr_handle_t camhandle, int fd, uint32_t length) {
ssize_t r = write(fd, buf, bytes);
if (r == 0) {
DPRINT("write(buf): Nothing has been written to buf.\n");
} else if (r < 0) { // r<0 - INDI modification, reapply for next update
} else if (r == -1) {
perror("write(buf)");
} else if ((uint32_t)r < bytes) {
} else if ((uint32_t)r < bytes) {
DPRINT("write(buf): only write %zu bytes, should be %d bytes.\n", r, bytes);
}
current += bytes;
Expand Down Expand Up @@ -417,7 +415,7 @@ int main(int argc, char **argv) {
int servermode_timeout = 30;
int modify_debug_mode=0;
char debug_mode=0;
bool dangerous=0;
//bool dangerous=0;
bool read_datetime=false;
bool read_firmware_version=false;
bool settings_info = false;
Expand Down Expand Up @@ -712,7 +710,7 @@ int main(int argc, char **argv) {
break;

case 25:
dangerous = true;
//dangerous = true;
break;

case 26:
Expand Down
1 change: 1 addition & 0 deletions libpktriggercord/src/pslr.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ pslr_handle_t pslr_init( char *model, char *device ) {
}
} else {
close_drive( &fd );
free(drives);
continue;
}
}
Expand Down
3 changes: 2 additions & 1 deletion libpktriggercord/src/pslr_model.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,8 @@ ipslr_model_info_t camera_models[] = {
{ 0x13240, "K-1 II", false, false, true, true, false, true, 456, 3, {36, 22, 12, 2}, 9, 8000, 100, 819200, 100, 819200, PSLR_JPEG_IMAGE_TONE_FLAT, true, 33, ipslr_status_parse_k1 },
{ 0x13222, "K-70", false, false, true, true, true, true, 456, 3, {24, 14, 6, 2}, 9, 6000, 100, 102400, 100, 102400, PSLR_JPEG_IMAGE_TONE_AUTO, true, 11, ipslr_status_parse_k70},
{ 0x1322c, "KP", false, false, true, true, false, true, 456, 3, {24, 14, 6, 2}, 9, 6000, 100, 819200, 100, 819200, PSLR_JPEG_IMAGE_TONE_AUTO, true, 27, ipslr_status_parse_k70},
{ 0x13010, "645Z", false, false, true, true, false, false, 0, 3, {51, 32, 21, 3}, 9, 4000, 100, 204800, 100, 204800, PSLR_JPEG_IMAGE_TONE_CROSS_PROCESSING, true, 35, NULL}
{ 0x13010, "645Z", false, false, true, true, false, false, 0, 3, {51, 32, 21, 3}, 9, 4000, 100, 204800, 100, 204800, PSLR_JPEG_IMAGE_TONE_CROSS_PROCESSING, true, 35, NULL},
{ 0x13254, "K-3III", false, false, true, true, false, true, 452, 4, {24, 14, 6, 2}, 9, 8000, 100, 51200, 100, 51200, PSLR_JPEG_IMAGE_TONE_BLEACH_BYPASS, true, 27, ipslr_status_parse_k3}
};

ipslr_model_info_t *pslr_find_model_by_id( uint32_t id ) {
Expand Down

0 comments on commit 47189d0

Please sign in to comment.