Skip to content

Commit

Permalink
From the specifications the GetDeviceInfo operation can be use withou…
Browse files Browse the repository at this point in the history
…t first opening an MTP session by sending an OpenSession command !
  • Loading branch information
jfdelnero committed Dec 28, 2023
1 parent 37db873 commit 299f25e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inc/mtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,6 @@ int build_response(mtp_ctx * ctx, uint32_t tx_id, uint16_t type, uint16_t status
int check_and_send_USB_ZLP(mtp_ctx * ctx , int size);
int parse_incomming_dataset(mtp_ctx * ctx,void * datain,int size,uint32_t * newhandle, uint32_t parent_handle, uint32_t storage_id);

#define APP_VERSION "v1.6.4"
#define APP_VERSION "v1.6.5"

#endif
4 changes: 2 additions & 2 deletions src/mtp_operations/mtp_op_getdeviceinfos.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ uint32_t mtp_op_GetDeviceInfos(mtp_ctx * ctx,MTP_PACKET_HEADER * mtp_packet_hdr,
{
int sz,tmp_sz;

if(!ctx->fs_db)
return MTP_RESPONSE_SESSION_NOT_OPEN;
// Note : From the MTP specification this operation can be used without first
// opening an MTP session by sending an OpenSession command !

sz = build_response(ctx, mtp_packet_hdr->tx_id, MTP_CONTAINER_TYPE_DATA, mtp_packet_hdr->code, ctx->wrbuffer, ctx->usb_wr_buffer_max_size,0,0);
if(sz < 0)
Expand Down

0 comments on commit 299f25e

Please sign in to comment.