VCARD3 support in sendfile, correct attribute WL
diff --git a/ChangeLog b/ChangeLog
index 934cf3c..852ae37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-09-19 Linus Walleij <[email protected]>
+
+ * src/libmtp.h.in: fixed attribute IDs to be 16bit.
+ * src/libmtp.c: dito.
+ * examples/sendfile.c: support vcard3.
+
2006-09-16 Linus Walleij <[email protected]>
* configure.ac: bump to 0.0.19 and release. There are some
diff --git a/examples/detect.c b/examples/detect.c
index f6e73d5..5132107 100644
--- a/examples/detect.c
+++ b/examples/detect.c
@@ -157,7 +157,7 @@
free(devcert);
}
- // Try to get device info XML file...
+ // Try to get Media player device info XML file...
files = LIBMTP_Get_Filelisting(device);
if (files != NULL) {
LIBMTP_file_t *file, *tmp;
diff --git a/examples/sendfile.c b/examples/sendfile.c
index 811adab..1a5337e 100644
--- a/examples/sendfile.c
+++ b/examples/sendfile.c
@@ -229,6 +229,8 @@
genfile->filetype = LIBMTP_FILETYPE_WINDOWSIMAGEFORMAT;
} else if (!strcasecmp(ptype,"ics")) {
genfile->filetype = LIBMTP_FILETYPE_VCALENDAR2;
+ } else if (!strcasecmp(ptype,"vcf")) {
+ genfile->filetype = LIBMTP_FILETYPE_VCARD3;
} else if (!strcasecmp(ptype,"exe") || !strcasecmp(ptype,"com") ||
!strcasecmp(ptype,"bat") || !strcasecmp(ptype,"dll") ||
!strcasecmp(ptype,"sys")) {
diff --git a/src/libmtp.c b/src/libmtp.c
index 2c3cfd6..ef1b14f 100644
--- a/src/libmtp.c
+++ b/src/libmtp.c
@@ -481,7 +481,7 @@
* use.
*/
char *LIBMTP_Get_String_From_Object(LIBMTP_mtpdevice_t *device, uint32_t const object_id,
- uint32_t const attribute_id)
+ uint16_t const attribute_id)
{
PTPPropertyValue propval;
char *retstring = NULL;
@@ -513,7 +513,7 @@
* @return the value
*/
uint32_t LIBMTP_Get_U32_From_Object(LIBMTP_mtpdevice_t *device,uint32_t const object_id,
- uint32_t const attribute_id, uint32_t const value_default)
+ uint16_t const attribute_id, uint32_t const value_default)
{
PTPPropertyValue propval;
uint32_t retval = value_default;
@@ -545,7 +545,7 @@
* @return a value
*/
uint16_t LIBMTP_Get_U16_From_Object(LIBMTP_mtpdevice_t *device, uint32_t const object_id,
- uint32_t const attribute_id, uint16_t const value_default)
+ uint16_t const attribute_id, uint16_t const value_default)
{
PTPPropertyValue propval;
uint16_t retval = value_default;
@@ -577,7 +577,7 @@
* @return 0 on success, any other value means failure
*/
int LIBMTP_Set_Object_String(LIBMTP_mtpdevice_t *device, uint32_t const object_id,
- uint32_t const attribute_id, char const * const string)
+ uint16_t const attribute_id, char const * const string)
{
PTPPropertyValue propval;
PTPParams *params = (PTPParams *) device->params;
@@ -608,7 +608,7 @@
* @return 0 on success, any other value means failure
*/
int LIBMTP_Set_Object_U32(LIBMTP_mtpdevice_t *device, uint32_t const object_id,
- uint32_t const attribute_id, uint32_t const value)
+ uint16_t const attribute_id, uint32_t const value)
{
PTPPropertyValue propval;
PTPParams *params = (PTPParams *) device->params;
@@ -639,7 +639,7 @@
* @return 0 on success, any other value means failure
*/
int LIBMTP_Set_Object_U16(LIBMTP_mtpdevice_t *device, uint32_t const object_id,
- uint32_t const attribute_id, uint16_t const value)
+ uint16_t const attribute_id, uint16_t const value)
{
PTPPropertyValue propval;
PTPParams *params = (PTPParams *) device->params;
diff --git a/src/libmtp.h.in b/src/libmtp.h.in
index 6094827..640d67f 100644
--- a/src/libmtp.h.in
+++ b/src/libmtp.h.in
@@ -339,13 +339,13 @@
* @defgroup objects The object management API.
* @{
*/
-char *LIBMTP_Get_String_From_Object(LIBMTP_mtpdevice_t *,const uint32_t, const uint32_t);
-uint32_t LIBMTP_Get_U32_From_Object(LIBMTP_mtpdevice_t *,const uint32_t, const uint32_t, const uint32_t);
-uint16_t LIBMTP_Get_U16_From_Object(LIBMTP_mtpdevice_t *,const uint32_t, const uint32_t, const uint16_t);
-int LIBMTP_Set_Object_String(LIBMTP_mtpdevice_t *,const uint32_t,const uint32_t,
+char *LIBMTP_Get_String_From_Object(LIBMTP_mtpdevice_t *,const uint32_t, const uint16_t);
+uint32_t LIBMTP_Get_U32_From_Object(LIBMTP_mtpdevice_t *,const uint32_t, const uint16_t, const uint32_t);
+uint16_t LIBMTP_Get_U16_From_Object(LIBMTP_mtpdevice_t *,const uint32_t, const uint16_t, const uint16_t);
+int LIBMTP_Set_Object_String(LIBMTP_mtpdevice_t *,const uint32_t,const uint16_t,
char const * const);
-int LIBMTP_Set_Object_U32(LIBMTP_mtpdevice_t *,const uint32_t, const uint32_t, const uint32_t);
-int LIBMTP_Set_Object_U16(LIBMTP_mtpdevice_t *,const uint32_t, const uint32_t, const uint16_t);
+int LIBMTP_Set_Object_U32(LIBMTP_mtpdevice_t *,const uint32_t, const uint16_t, const uint32_t);
+int LIBMTP_Set_Object_U16(LIBMTP_mtpdevice_t *,const uint32_t, const uint16_t, const uint16_t);
int LIBMTP_Get_Object_References(LIBMTP_mtpdevice_t *, const uint32_t, uint32_t **, uint32_t *);
int LIBMTP_Set_Object_References(LIBMTP_mtpdevice_t *, const uint32_t, uint32_t const * const, const uint32_t);
LIBMTP_object_t *LIBMTP_Make_List(LIBMTP_mtpdevice_t *, uint32_t *, uint32_t, uint32_t *, uint32_t);