|
31 | 31 | #include <arvfakestreamprivate.h> |
32 | 32 | #include <arvfakecamera.h> |
33 | 33 | #include <arvgc.h> |
34 | | -#include <arvdebug.h> |
| 34 | +#include <arvdebugprivate.h> |
35 | 35 |
|
36 | 36 | enum |
37 | 37 | { |
@@ -85,16 +85,34 @@ static gboolean |
85 | 85 | arv_fake_device_read_memory (ArvDevice *device, guint64 address, guint32 size, void *buffer, GError **error) |
86 | 86 | { |
87 | 87 | ArvFakeDevicePrivate *priv = arv_fake_device_get_instance_private (ARV_FAKE_DEVICE (device)); |
| 88 | + gboolean success; |
88 | 89 |
|
89 | | - return arv_fake_camera_read_memory (priv->camera, address, size, buffer); |
| 90 | + success = arv_fake_camera_read_memory (priv->camera, address, size, buffer); |
| 91 | + |
| 92 | + arv_trace_device ("[FakeDevice::read_memory] address 0x%" G_GINT64_MODIFIER "x, size = %d", address, size); |
| 93 | + |
| 94 | + if (!success) |
| 95 | + g_set_error (error, ARV_DEVICE_ERROR, ARV_DEVICE_ERROR_INVALID_PARAMETER, |
| 96 | + "Invalid read at 0x%" G_GINT64_MODIFIER "x, size %d", address, size); |
| 97 | + |
| 98 | + return success; |
90 | 99 | } |
91 | 100 |
|
92 | 101 | static gboolean |
93 | 102 | arv_fake_device_write_memory (ArvDevice *device, guint64 address, guint32 size, const void *buffer, GError **error) |
94 | 103 | { |
95 | 104 | ArvFakeDevicePrivate *priv = arv_fake_device_get_instance_private (ARV_FAKE_DEVICE (device)); |
| 105 | + gboolean success; |
| 106 | + |
| 107 | + arv_trace_device ("[FakeDevice::write_memory] address 0x%" G_GINT64_MODIFIER "x, size = %d", address, size); |
| 108 | + |
| 109 | + success = arv_fake_camera_write_memory (priv->camera, address, size, buffer); |
| 110 | + |
| 111 | + if (!success) |
| 112 | + g_set_error (error, ARV_DEVICE_ERROR, ARV_DEVICE_ERROR_INVALID_PARAMETER, |
| 113 | + "Invalid write at 0x%" G_GINT64_MODIFIER "x, size %d", address, size); |
96 | 114 |
|
97 | | - return arv_fake_camera_write_memory (priv->camera, address, size, buffer); |
| 115 | + return success; |
98 | 116 | } |
99 | 117 |
|
100 | 118 | static gboolean |
|
0 commit comments