Commit Graph

67 Commits

Author SHA1 Message Date
Richard Hughes
bd046c8a19 libdfu: Fix up some NULL/FALSE confusion 2016-03-18 12:33:47 +00:00
Richard Hughes
b3849683b6 trivial: Remove all 'suspicious commas' 2016-03-18 12:33:47 +00:00
Richard Hughes
da9804d8be Show ignored DFU devices in dfu-util, but not in fwupd
This allows desktop software to ignore the device, but leaves the device
controllable by the dfu-tool command line client.
2016-03-07 08:47:11 +00:00
Richard Hughes
d8b6d8a1f5 Export the attribute and quirk values in libdfu 2016-03-07 08:44:14 +00:00
Richard Hughes
c9620ac61e Ignore the DFU runtime on the DW1820A 2016-03-07 08:42:12 +00:00
Richard Hughes
2fd64ecef8 trivial: Fix a method prefix to reflect reality 2016-03-07 08:21:39 +00:00
Richard Hughes
41b1f6c7c4 trivial: Fix tiny build warning with GCC6 2016-03-03 08:13:03 +00:00
Richard Hughes
46d6180f29 Correct the BCD version number for DFU 1.1
This prevents a warning about invalid version numbers for newer hardware.
I have no idea why 1.1 would be encoded as 0x0110 rather than 0x0101 but
dfu-util seems to do the same thing.
2016-03-02 09:57:38 +00:00
Richard Hughes
280745f5f0 Release fwupd 0.6.0 2015-12-07 16:20:59 +00:00
Richard Hughes
f4e8fe0763 trivial: Fix several trivial warnings on ARM 2015-12-06 17:51:10 +00:00
Richard Hughes
7774f815a7 trivial: Fix clang-spotted hard-to-hit crash in dfu-tool 2015-12-06 16:36:58 +00:00
Richard Hughes
032596e800 libdfu: Fix several reported crashes in the inhex32 import code
This also adds the ability to write simple Intel HEX files too.
2015-12-06 16:27:16 +00:00
Richard Hughes
ccc54ae972 trivial: Add some fuzzing examples for libdfu 2015-12-06 16:27:16 +00:00
Richard Hughes
564303d877 libdfu: Only enumerate the DfuContext when required
This speeds up afl fuzzing significantly.
2015-12-06 16:27:03 +00:00
Richard Hughes
7c37e55459 libdfu: Add support for the draft 'DFU Metadata Table Specification' 2015-12-04 16:01:40 +00:00
Richard Hughes
4545dd70af libdfu: Add DfuCipher which is a property on a target and a firmware file
At the moment we're not doing anything smart other than looking at the
firmware filename, but in the future we might do something better.
2015-12-04 12:58:05 +00:00
Richard Hughes
021f65e370 libdfu: Show better device errors 2015-12-04 12:26:45 +00:00
Richard Hughes
045198d643 libdfu: Add commands to encrypt and decrypt firmware images
This uses XTEA to encrypt and decrypt images in the firmware file, although
I'm open for adding other methods as required.
2015-12-02 15:48:03 +00:00
Richard Hughes
71e55aafeb libdfu: Fix another bug discovered by the fuzzer 2015-12-02 08:29:59 +00:00
Richard Hughes
f7c61fcb18 libdfu: Fix a few crashers found using afl 2015-12-01 15:56:59 +00:00
Richard Hughes
1936e4afb5 libdfu: Display all the files shown with 'dfu-tool dump'
Also, show the file CRC in the debug output.
2015-12-01 14:53:04 +00:00
Richard Hughes
832c334548 Fix compile with --disable-shared 2015-12-01 11:41:16 +00:00
Richard Hughes
14d2b80503 libdfu: Make reading and writing to targets easier to understand
Rename the 'upload' command to read, and 'download' to write to make things
easier for end users. Also, break the last bits of compatibility with dfu-util.
2015-11-30 09:49:25 +00:00
Richard Hughes
84b8d1f2f1 libdfu: Add dfu_firmware_get_image_by_name() 2015-11-30 09:16:58 +00:00
Richard Hughes
9b1349b885 libdfu: Add an explicit 'attach' method
This can also deal with the m-stack quirk in a central place.
2015-11-27 10:54:26 +00:00
Richard Hughes
385bba0ada libdfu: Add a quirk to support DFU runtime-less devices 2015-11-26 18:59:59 +00:00
Richard Hughes
60b7eeeca9 libdfu: Handle cancellation with ctrl+c in dfu-tool 2015-11-26 12:36:53 +00:00
Richard Hughes
4bb94e4bcd libdfu: Fix dfu_device_wait_for_replug() so it can work with a DfuContext
Using g_usleep() works for the command line tool, but this starves the event
loop which means we get a flurry of removed:added:removed:added signals once
complete.

The context 'helpfully' sets up the new GUsbDevice which means we're doing
things with DfuTargets without DfuDevices and DfuTargets without GUsbDevices.
Basically, madness ensues.
2015-11-25 13:57:04 +00:00
Richard Hughes
45f7956b97 libdfu: Remove the weak pointer when destroying the DfuTarget
This fixes commit 4d4e91da.
2015-11-25 13:45:06 +00:00
Richard Hughes
93a6edf2c6 trivial: Define the default replug timeout in a central place
Some users were using 2000ms and some the more sane 5000ms.
2015-11-25 13:41:55 +00:00
Richard Hughes
0116028755 libdfu: Verify the GUsbDevice is set before using it
Handling this is important in a library that's going to be (ab)used by people.
2015-11-25 13:39:18 +00:00
Richard Hughes
b4c888e309 libdfu: Accept multiple spaces after the DfuSe sector name 2015-11-25 10:27:36 +00:00
Richard Hughes
0bb530be97 libdfu: Copy the platform ID and invalidate the GUsbDevice when removed 2015-11-25 10:27:36 +00:00
Richard Hughes
012bcc0239 libdfu: Fix self tests after recent API change 2015-11-24 18:33:40 +00:00
Richard Hughes
71581832da libdfu: Add dfu_device_get_display_name()
This allows us to get the product name for the device.
2015-11-24 18:33:40 +00:00
Richard Hughes
aa90e5c88d libdfu: Add dfu_device_get_runtime_release()
This allows us to get the device release when in runtime mode.
2015-11-24 18:33:40 +00:00
Richard Hughes
42ffdf7645 libdfu: Add dfu_context_get_device_by_platform_id()
This lets us get the connection platform ID without exposing the GUsbDevice.
2015-11-24 18:33:40 +00:00
Richard Hughes
4d4e91da23 libdfu: Do not ref DfuDevice in DfuTarget so the auto-close logic works
We want to auto-close the device when the recount of DfuDevice drops to zero,
but when a composite device has more than one ref this is not going to happen.
2015-11-24 12:35:22 +00:00
Richard Hughes
8d21237c33 libdfu: Add an example showing GObject Introspection 2015-11-23 14:16:03 +00:00
Richard Hughes
1b0b51e2a6 trivial: Install libdfu properly as a shared library 2015-11-23 14:02:56 +00:00
Richard Hughes
d3afaaab9f libdfu: Add a context object to handle device hotplug
Also, add a 'watch' command to dfu-tool to test this.
2015-11-23 13:53:06 +00:00
Richard Hughes
5d6066c002 libdfu: Use signals to propagate device state
Also, add padding to the various class structs so we can add more signals in
the future without breaking ABI.
2015-11-23 10:19:24 +00:00
Richard Hughes
8e02ee2a60 libdfu: Add a pkgconfig file 2015-11-23 09:17:43 +00:00
Richard Hughes
e7aaf39de2 libdfu: Fix multi-interface devices like the Neo Freerunner
The DFU specification specifies that only one of the DFU interfaces has to
export a functional descriptor; I assumed they all had to. Adding support
for this kind of device rapidly turned into a massive restructure and it was
all too complicated anyway.

Reorganise the code so that we can support these kinds of devices and clean up
the API so it's sane and easy to use. This also allows us to generate the
GObject introspection GIR and to also install libdfu as a shared library.

If you've got any comments about the API, please shout now as when 6.0 is
released it will become API and ABI stable.
2015-11-22 21:17:48 +00:00
Richard Hughes
e7ba943cf5 libdfu: Support download and upload to ST DfuSe devices
Also, simplify the general download and upload API now we can deal with
element data in chunks.
2015-11-20 14:14:05 +00:00
Richard Hughes
0256f04338 libdfu: Improve the output of 'dfu-util list'
Being semi-compatible with dfu-util isn't important anymore.
2015-11-20 12:30:53 +00:00
Richard Hughes
3391e6b154 libdfu: Use the progress bar for all uploads and downloads 2015-11-19 17:44:29 +00:00
Richard Hughes
2d64b19c81 libdfu: Only do a Detach notification if we're actually doing to do it 2015-11-19 17:42:21 +00:00
Richard Hughes
38e7e31e2c libdfu: Support the ST-specific bitCanAccelerate 2015-11-19 12:33:11 +00:00
Richard Hughes
6aa47bab89 libdfu: Make the element address 32 bits in size
ST devices are large, and support a large address space...
2015-11-19 12:15:53 +00:00