diff options
| author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-08-03 21:35:26 +0000 | 
|---|---|---|
| committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-08-03 21:35:26 +0000 | 
| commit | 999fcbcce8fe248d20830d278fd3cb82ff262a7b (patch) | |
| tree | e1a403e58f2fb468906d3fcc0de843f07c3d278f | |
| parent | b7e27d3358a177e97b946bae7fbeda782014bfa0 (diff) | |
hcid: ListRecentRemoteDevices - added lastseen and trusted devices, return all when time is not informed
| -rw-r--r-- | hcid/dbus-adapter.c | 18 | 
1 files changed, 14 insertions, 4 deletions
| diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c index 489e4963..51bc43de 100644 --- a/hcid/dbus-adapter.c +++ b/hcid/dbus-adapter.c @@ -2907,7 +2907,6 @@ static DBusHandlerResult adapter_list_recent_remote_devices(DBusConnection *conn  {  	struct adapter *adapter = data;  	const char *string; -	struct tm date;  	DBusMessageIter iter;  	DBusMessageIter array_iter;  	DBusMessage *reply; @@ -2919,14 +2918,25 @@ static DBusHandlerResult adapter_list_recent_remote_devices(DBusConnection *conn  				DBUS_TYPE_INVALID))  		return error_invalid_arguments(conn, msg); -	if (strptime(string, "%Y-%m-%d %H:%M:%S", &date) == NULL) -		return error_invalid_arguments(conn, msg); -	param.time = mktime(&date); +	if (strlen(string)) { +		struct tm date; +		if (strptime(string, "%Y-%m-%d %H:%M:%S", &date) == NULL) +			return error_invalid_arguments(conn, msg); +		param.time = mktime(&date); +	}  	/* Add Bonded devices to the list */  	create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "linkkeys");  	textfile_foreach(filename, list_remote_devices_do_append, ¶m); +	/* Add Trusted devices to the list */ +	create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "trusts"); +	textfile_foreach(filename, list_remote_devices_do_append, ¶m); + +	/* Add Last seen devices to the list */ +	create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "lastseen"); +	textfile_foreach(filename, list_remote_devices_do_append, ¶m); +  	/* Add Last Used devices to the list */  	create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "lastused");  	textfile_foreach(filename, list_remote_devices_do_append, ¶m); | 
