100 static void PTP_GetString(uint8_t *str, uint8_t* data, uint16_t *len);
101 static uint32_t PTP_GetArray16 (uint16_t *array, uint8_t *data, uint32_t offset);
102 static uint32_t PTP_GetArray32 (uint32_t *array, uint8_t *data, uint32_t offset);
183 #if (USBH_USE_OS == 1) 191 #if (USBH_USE_OS == 1) 198 #if (USBH_USE_OS == 1) 230 PTP_BufferFullCallback (phost);
255 #if (USBH_USE_OS == 1) 264 #if (USBH_USE_OS == 1) 272 #if (USBH_USE_OS == 1) 310 PTP_BufferFullCallback (phost);
325 #if (USBH_USE_OS == 1) 333 #if (USBH_USE_OS == 1) 369 #if (USBH_USE_OS == 1) 449 PTP_DecodeDeviceInfo (phost, &(MTP_Handle->
info.
devinfo));
497 USBH_DbgLog (
" MTP device info size exceeds internal buffer size.\ 498 only available data are decoded.");
534 totallen=totallen+dev_info->
ImageFormats_len*
sizeof(uint16_t)+
sizeof(uint32_t);
560 stor_ids->
n = PTP_GetArray32 (stor_ids->
Storage, data, 0);
600 uint16_t filenamelen;
638 uint32_t offset = 0, i;
648 offset+=
sizeof(uint32_t);
650 opd->
FormFlag=*(uint8_t *)(&data[offset]);
651 offset+=
sizeof(uint8_t);
664 offset+=
sizeof(uint16_t);
695 value->
i8 = *(uint8_t *)&(data[*offset]);
699 value->
u8 = *(uint8_t *)&(data[*offset]);
704 value->
i16 =
LE16(&(data[*offset]));
708 value->
u16 =
LE16(&(data[*offset]));
712 value->
i32 =
LE32(&(data[*offset]));
716 value->
u32 =
LE32(&(data[*offset]));
720 value->
i64 =
LE64(&(data[*offset]));
724 value->
u64 =
LE64(&(data[*offset]));
737 PTP_GetString((uint8_t *)value->
str, (uint8_t *)&(data[*offset]), &len);
760 uint32_t offset = 0, i;
762 prop_count =
LE32(data);
770 data +=
sizeof(uint32_t);
771 len -=
sizeof(uint32_t);
773 for (i = 0; i < prop_count; i++)
781 data +=
sizeof(uint32_t);
782 len -=
sizeof(uint32_t);
785 data +=
sizeof(uint16_t);
786 len -=
sizeof(uint16_t);
789 data +=
sizeof(uint16_t);
790 len -=
sizeof(uint16_t);
794 PTP_GetDevicePropValue(phost, &offset, len, &props[i].propval, props[i].datatype);
810 static void PTP_GetString (uint8_t *str, uint8_t* data, uint16_t *len)
816 strlength = 2 * data[0];
819 for (idx = 0; idx < strlength; idx+=2 )
836 static uint32_t PTP_GetArray16 (uint16_t *array, uint8_t *data, uint32_t offset)
838 uint32_t size, idx = 0;
840 size=
LE32(&data[offset]);
843 array[
idx] =
LE16(&data[offset+(
sizeof(uint16_t)*(idx+2))]);
857 static uint32_t PTP_GetArray32 (uint32_t *array, uint8_t *data, uint32_t offset)
859 uint32_t size, idx = 0;
861 size=
LE32(&data[offset]);
864 array[
idx] =
LE32(&data[offset+(
sizeof(uint32_t)*(idx+1))]);
899 ptp_container.SessionID = session;
901 ptp_container.Param1 = session;
902 ptp_container.Nparam = 1;
911 #if (USBH_USE_OS == 1) 956 ptp_container.Param1 = propcode;
957 ptp_container.Nparam = 1;
966 #if (USBH_USE_OS == 1) 1016 ptp_container.Nparam = 0;
1025 #if (USBH_USE_OS == 1) 1035 PTP_DecodeDeviceInfo (phost, dev_info);
1073 ptp_container.Nparam = 0;
1082 #if (USBH_USE_OS == 1) 1092 PTP_GetStorageIDs (phost, storage_ids);
1130 ptp_container.Param1 = storage_id;
1131 ptp_container.Nparam = 1;
1140 #if (USBH_USE_OS == 1) 1150 PTP_GetStorageInfo (phost, storage_id, storage_info);
1168 uint32_t storage_id,
1169 uint32_t objectformatcode,
1170 uint32_t associationOH,
1188 ptp_container.Param1 = storage_id;
1189 ptp_container.Param2 = objectformatcode;
1190 ptp_container.Param3 = associationOH;
1191 ptp_container.Nparam = 3;
1200 #if (USBH_USE_OS == 1) 1228 uint32_t storage_id,
1229 uint32_t objectformatcode,
1230 uint32_t associationOH,
1252 ptp_container.Param1 = storage_id;
1253 ptp_container.Param2 = objectformatcode;
1254 ptp_container.Param3 = associationOH;
1255 ptp_container.Nparam = 3;
1264 #if (USBH_USE_OS == 1) 1274 objecthandles->
n = PTP_GetArray32 (objecthandles->
Handler,
1316 ptp_container.Param1 = handle;
1317 ptp_container.Nparam = 1;
1326 #if (USBH_USE_OS == 1) 1336 PTP_GetObjectInfo (phost, object_info);
1355 uint32_t objectformatcode)
1372 ptp_container.Param1 = handle;
1373 ptp_container.Param2 = objectformatcode;
1374 ptp_container.Nparam = 2;
1383 #if (USBH_USE_OS == 1) 1431 ptp_container.Param1 = handle;
1432 ptp_container.Nparam = 1;
1442 #if (USBH_USE_OS == 1) 1503 ptp_container.Param1 = handle;
1504 ptp_container.Param2 = offset;
1505 ptp_container.Param3 = maxbytes;
1506 ptp_container.Nparam = 3;
1515 #if (USBH_USE_OS == 1) 1572 ptp_container.Param1 = ofc;
1573 ptp_container.Nparam = 1;
1582 #if (USBH_USE_OS == 1) 1633 ptp_container.Param1 = opc;
1634 ptp_container.Param2 = ofc;
1635 ptp_container.Nparam = 2;
1644 #if (USBH_USE_OS == 1) 1674 uint32_t *nrofprops)
1698 ptp_container.Param1 = handle;
1699 ptp_container.Param2 = 0x00000000U;
1700 ptp_container.Param3 = 0xFFFFFFFFU;
1701 ptp_container.Param4 = 0x00000000U;
1702 ptp_container.Param5 = 0xFFFFFFFFU;
1703 ptp_container.Nparam = 5;
1712 #if (USBH_USE_OS == 1) 1722 PTP_GetObjectPropList (phost, pprops, MTP_Handle->
ptp.
data_length);
1767 ptp_container.Nparam = 0;
1777 #if (USBH_USE_OS == 1) USBH_StatusTypeDef USBH_PTP_GetStorageIds(USBH_HandleTypeDef *phost, PTP_StorageIDsTypedef *storage_ids)
USBH_PTP_GetStorageIds Gets device info dataset and fills deviceinfo structure.
#define PTP_si_FilesystemType
PTP_ProcessStateTypeDef state
uint32_t data_packet_counter
uint8_t Model[PTP_MAX_STR_SIZE]
#define PTP_di_VendorExtensionDesc
PTP_RespContainerTypedef resp_container
#define PTP_oi_ImageBitDepth
uint16_t AccessCapability
Header file for usbh_mtp_ptp.c.
USBH_StatusTypeDef USBH_PTP_GetNumObjects(USBH_HandleTypeDef *phost, uint32_t storage_id, uint32_t objectformatcode, uint32_t associationOH, uint32_t *numobs)
USBH_PTP_GetNumObjects Gets device info dataset and fills deviceinfo structure.
uint8_t VolumeLabel[PTP_MAX_STR_SIZE]
uint64_t ObjectCompressedSize
uint32_t DevicePropertiesSupported_len
#define PTP_OC_GetNumObjects
#define PTP_OC_OpenSession
uint8_t Filename[PTP_MAX_STR_SIZE]
#define PTP_oi_SequenceNumber
uint32_t EventsSupported_len
#define PTP_OPFF_Enumeration
#define PTP_USB_BULK_REQ_RESP_MAX_LEN
#define PTP_OC_GetObjectPropDesc
#define PTP_OC_GetDevicePropDesc
#define PTP_OC_GetObjPropList
#define PTP_oi_ParentObject
#define PTP_OC_GetObjectPropsSupported
#define PTP_di_VendorExtensionID
PTP_RequestStateTypeDef req_state
USBH_StatusTypeDef USBH_PTP_GetStorageInfo(USBH_HandleTypeDef *phost, uint32_t storage_id, PTP_StorageInfoTypedef *storage_info)
USBH_PTP_GetDeviceInfo Gets device info dataset and fills deviceinfo structure.
#define PTP_oi_ThumbFormat
USBH_StatusTypeDef USBH_BulkReceiveData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t hc_num)
USBH_BulkReceiveData Receives IN bulk packet from device.
uint16_t OperationsSupported[PTP_SUPPORTED_OPERATIONS_NBR]
#define PTP_si_AccessCapability
uint8_t DeviceVersion[PTP_MAX_STR_SIZE]
USBH_StatusTypeDef USBH_PTP_GetPartialObject(USBH_HandleTypeDef *phost, uint32_t handle, uint32_t offset, uint32_t maxbytes, uint8_t *object, uint32_t *len)
USBH_PTP_GetPartialObject Gets object partially.
#define PTP_opd_ObjectPropertyCode
#define PTP_OC_GetPartialObject
uint32_t ThumbCompressedSize
uint32_t OperationsSupported_len
PTP_OpContainerTypedef op_container
#define PTP_OC_GetStorageIDs
USBH_StatusTypeDef USBH_BulkSendData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t hc_num, uint8_t do_ping)
USBH_BulkSendData Sends the Bulk Packet to the device.
uint32_t USBH_LL_GetLastXferSize(USBH_HandleTypeDef *phost, uint8_t)
USBH_LL_GetLastXferSize Return the last transferred packet size.
uint8_t Manufacturer[PTP_MAX_STR_SIZE]
uint16_t EventsSupported[PTP_SUPPORTED_EVENTS_NBR]
char str[PTP_MAX_STR_SIZE]
This file contains all the prototypes for the usbh_mtp.c.
uint16_t DevicePropertiesSupported[PTP_SUPPORTED_PROPRIETIES_NBR]
uint8_t VendorExtensionDesc[PTP_MAX_STR_SIZE]
uint32_t VendorExtensionID
uint32_t FreeSpaceInImages
#define PTP_USB_CONTAINER_COMMAND
#define PTP_OC_DeleteObject
#define PTP_USB_BULK_REQ_LEN
#define PTP_opd_FactoryDefaultValue
union PTP_ObjectPropDescTypeDef::@39 FORM
#define PTP_si_StorageType
#define PTP_oi_ImagePixWidth
uint32_t Handler[PTP_MAX_HANDLER_NBR]
#define PTP_si_StorageDescription
#define PTP_USB_BULK_PAYLOAD_LEN_READ
uint16_t ImageFormats[PTP_IMAGE_FORMATS_NBR]
#define PTP_OC_GetObjectInfo
#define PTP_oi_AssociationType
USBH_StatusTypeDef USBH_PTP_GetResponse(USBH_HandleTypeDef *phost, PTP_ContainerTypedef *resp)
USBH_PTP_OpenSession Open a new session.
union PTP_DataContainerTypedef::@37 payload
#define PTP_dpd_DevicePropertyCode
#define PTP_oi_ObjectFormat
USBH_StatusTypeDef USBH_PTP_GetObjectPropList(USBH_HandleTypeDef *phost, uint32_t handle, MTP_PropertiesTypedef *pprops, uint32_t *nrofprops)
USBH_PTP_GetObjectPropList Gets object partially.
#define PTP_di_VendorExtensionVersion
uint16_t CaptureFormats[PTP_CAPTURE_FORMATS_NBR]
#define PTP_OC_SendObject
#define PTP_OC_GetStorageInfo
USBH_StatusTypeDef USBH_PTP_GetObjectHandles(USBH_HandleTypeDef *phost, uint32_t storage_id, uint32_t objectformatcode, uint32_t associationOH, PTP_ObjectHandlesTypedef *objecthandles)
USBH_PTP_GetObjectHandles Gets device info dataset and fills deviceinfo structure.
uint16_t VendorExtensionVersion
uint32_t Storage[PTP_MAX_STORAGE_UNITS_NBR]
USBH_StatusTypeDef USBH_PTP_Process(USBH_HandleTypeDef *phost)
USBH_PTP_Process The function handle the BOT protocol.
USBH_StatusTypeDef USBH_PTP_GetDevicePropDesc(USBH_HandleTypeDef *phost, uint16_t propcode, PTP_DevicePropDescTypdef *devicepropertydesc)
USBH_PTP_GetDevicePropDesc Gets object partially.
#define PTP_OC_GetDeviceInfo
USBH_URBStateTypeDef USBH_LL_GetURBState(USBH_HandleTypeDef *phost, uint8_t)
USBH_LL_GetURBState Get a URB state from the low level driver.
#define PTP_oi_ImagePixHeight
#define PTP_oi_ThumbPixWidth
uint32_t ImageFormats_len
uint64_t FreeSpaceInBytes
uint8_t SerialNumber[PTP_MAX_STR_SIZE]
PTP_DeviceInfoTypedef devinfo
#define PTP_oi_ProtectionStatus
PTP_PropDescEnumFormTypedef Enum
uint32_t CaptureFormats_len
USBH_StatusTypeDef USBH_PTP_DeleteObject(USBH_HandleTypeDef *phost, uint32_t handle, uint32_t objectformatcode)
USBH_PTP_DeleteObject Delete an object.
uint16_t ProtectionStatus
#define PTP_si_FreeSpaceInBytes
#define PTP_oi_AssociationDesc
#define PTP_oi_filenamelen
USBH_StatusTypeDef USBH_PTP_GetObjectPropDesc(USBH_HandleTypeDef *phost, uint16_t opc, uint16_t ofc, PTP_ObjectPropDescTypeDef *opd)
USBH_PTP_GetObjectPropDesc Gets object partially.
#define PTP_oi_ThumbPixHeight
#define PTP_di_StandardVersion
USBH_StatusTypeDef USBH_PTP_GetObjectPropsSupported(USBH_HandleTypeDef *phost, uint16_t ofc, uint32_t *propnum, uint16_t *props)
USBH_PTP_GetObjectPropsSupported Gets object partially.
uint16_t ObjectPropertyCode
#define PTP_si_MaxCapability
osStatus osMessagePut(osMessageQId queue_id, uint32_t info, uint32_t millisec)
Put a Message to a Queue.
uint8_t data[PTP_USB_BULK_PAYLOAD_LEN_READ]
PTP_PropDescRangeFormTypedef Range
USBH_StatusTypeDef USBH_PTP_SendObject(USBH_HandleTypeDef *phost, uint32_t handle, uint8_t *object, uint32_t size)
USBH_PTP_SendObject Send an object.
#define PTP_di_FunctionalMode
PTP_PropertyValueTypedef FactoryDefaultValue
USBH_StatusTypeDef USBH_PTP_OpenSession(USBH_HandleTypeDef *phost, uint32_t session)
USBH_PTP_OpenSession Open a new session.
#define PTP_OC_GetObjectHandles
USBH_ClassTypeDef * pActiveClass
PTP_DataContainerTypedef data_container
#define PTP_oi_ThumbCompressedSize
USBH_StatusTypeDef USBH_PTP_Init(USBH_HandleTypeDef *phost)
USBH_PTP_Init The function Initializes the BOT protocol.
USBH_StatusTypeDef USBH_PTP_SendRequest(USBH_HandleTypeDef *phost, PTP_ContainerTypedef *req)
USBH_PTP_OpenSession Open a new session.
uint8_t StorageDescription[PTP_MAX_STR_SIZE]
#define PTP_oi_ObjectCompressedSize
USBH_StatusTypeDef USBH_PTP_GetObjectInfo(USBH_HandleTypeDef *phost, uint32_t handle, PTP_ObjectInfoTypedef *object_info)
USBH_PTP_GetObjectInfo Gets objert info.
USBH_StatusTypeDef USBH_PTP_GetDeviceInfo(USBH_HandleTypeDef *phost, PTP_DeviceInfoTypedef *dev_info)
USBH_PTP_GetDeviceInfo Gets device info dataset and fills deviceinfo structure.
#define PTP_di_OperationsSupported
uint16_t DevicePropertyCode
USBH_StatusTypeDef USBH_PTP_GetObject(USBH_HandleTypeDef *phost, uint32_t handle, uint8_t *object)
USBH_PTP_GetObject Gets object.
#define PTP_si_FreeSpaceInImages