Skip to content

Commit

Permalink
Remove old fuji stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
petabyt committed Mar 25, 2024
1 parent ebd40de commit 330fdfa
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 83 deletions.
50 changes: 0 additions & 50 deletions src/cl_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,52 +160,6 @@ enum PtpCHDKCommands {
PTP_CHDK_UploadFile = 5,
};

// Response to struct FujiInitPacket
struct PtpFujiInitResp {
uint32_t x1;
uint32_t x2;
uint32_t x3;
uint32_t x4;
char cam_name[54];
};

// Appears to be an array for events
struct PtpFujiEvents {
uint16_t length;
struct PtpFujiEventsEntry {
uint16_t code;
uint32_t value;
}events[];
};

// Looks very similar to standard ISO ObjectInfo, but random bits moved around.
// variable data starts at same location.
struct PtpFujiObjectInfo {
uint32_t storage_id;
uint16_t obj_format;
uint16_t protection;
uint32_t fuji_max_partial_size;
uint8_t fuji_unknown2;
uint32_t compressed_size;
uint16_t fuji_unknown3;
uint16_t fuji_unknown4;
uint8_t fuji_unknown5;
uint32_t img_width;
uint32_t img_height;
uint32_t img_bit_depth;
uint32_t parent_obj;
uint16_t assoc_type;
uint32_t assoc_desc;
uint32_t sequence_num;

#define PTP_FUJI_OBJ_INFO_VAR_START 52

char filename[64];
char date_created[32];
char settings[32];
char meta[32];
};

#pragma pack(pop)

#ifdef CAMLIB_INCLUDE_IMPL
Expand Down Expand Up @@ -234,10 +188,6 @@ int ptp_eos_get_imgformat_value(uint32_t data[5]);

void *ptp_pack_chdk_upload_file(struct PtpRuntime *r, char *in, char *out, int *length);

// Fuji (PTP/IP)
int ptp_fuji_get_init_info(struct PtpRuntime *r, struct PtpFujiInitResp *resp);
int ptp_fuji_parse_object_info(struct PtpRuntime *r, struct PtpFujiObjectInfo *oi);

#endif

#endif
32 changes: 0 additions & 32 deletions src/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,35 +606,3 @@ int ptp_eos_events_json(struct PtpRuntime *r, char *buffer, int max) {

return curr;
}

// TODO: move to fudge
int ptp_fuji_get_init_info(struct PtpRuntime *r, struct PtpFujiInitResp *resp) {
uint8_t *d = ptp_get_payload(r);

d += ptp_read_u32(d, &resp->x1);
d += ptp_read_u32(d, &resp->x2);
d += ptp_read_u32(d, &resp->x3);
d += ptp_read_u32(d, &resp->x4);

ptp_read_unicode_string(resp->cam_name, (char *)d, sizeof(resp->cam_name));

return 0;
}

int ptp_fuji_parse_object_info(struct PtpRuntime *r, struct PtpFujiObjectInfo *oi) {
uint8_t *d = ptp_get_payload(r);
memcpy(oi, d, PTP_FUJI_OBJ_INFO_VAR_START);
d += PTP_FUJI_OBJ_INFO_VAR_START;
d += ptp_read_string(d, oi->filename, sizeof(oi->filename));

/* TODO: Figure out payload later:
0D 44 00 53 00 43 00 46 00 35 00 30 00 38 00 37 00 2E 00 4A 00 50 00 47 00
00 00 10 32 00 30 00 31 00 35 00 30 00 35 00 32 00 34 00 54 00 30 00 31 00
31 00 37 00 31 00 30 00 00 00 00 0E 4F 00 72 00 69 00 65 00 6E 00 74 00 61
00 74 00 69 00 6F 00 6E 00 3A 00 31 00 00 00 0C 00 00 00 03 00 01 20 0E 00
00 00 00
*/

return 0;
}

1 change: 1 addition & 0 deletions src/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ int ptp_validate_property_value(struct PtpRuntime *r, int prop_code, uint32_t va
break;
default:
ptp_panic("Unsupported PTP prop length %X\n", prop_code);
return 0;
}

if (value == cur_val) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int ptp_send(struct PtpRuntime *r, struct PtpCommand *cmd) {
int rc = ptp_receive_bulk_packets(r);
if (rc < 0) {
ptp_mutex_unlock_thread(r);
ptp_verbose_log("Failed to recieve packets: %d\n", rc);
ptp_verbose_log("Failed to receive packets: %d\n", rc);
return PTP_IO_ERR;
}

Expand Down

0 comments on commit 330fdfa

Please sign in to comment.