@@ -183,6 +183,7 @@ mares_iconhd_packet (mares_iconhd_device_t *device,
183
183
{
184
184
dc_status_t status = DC_STATUS_SUCCESS ;
185
185
dc_device_t * abstract = (dc_device_t * ) device ;
186
+ dc_transport_t transport = dc_iostream_get_transport (device -> iostream );
186
187
187
188
if (device_is_cancelled (abstract ))
188
189
return DC_STATUS_CANCELLED ;
@@ -198,7 +199,7 @@ mares_iconhd_packet (mares_iconhd_device_t *device,
198
199
}
199
200
200
201
// Send the command payload to the dive computer.
201
- if (size ) {
202
+ if (size && transport == DC_TRANSPORT_BLE ) {
202
203
status = dc_iostream_write (device -> iostream , data , size , NULL );
203
204
if (status != DC_STATUS_SUCCESS ) {
204
205
ERROR (abstract -> context , "Failed to send the command." );
@@ -220,6 +221,15 @@ mares_iconhd_packet (mares_iconhd_device_t *device,
220
221
return DC_STATUS_PROTOCOL ;
221
222
}
222
223
224
+ // Send the command payload to the dive computer.
225
+ if (size && transport != DC_TRANSPORT_BLE ) {
226
+ status = dc_iostream_write (device -> iostream , data , size , NULL );
227
+ if (status != DC_STATUS_SUCCESS ) {
228
+ ERROR (abstract -> context , "Failed to send the command data." );
229
+ return status ;
230
+ }
231
+ }
232
+
223
233
// Read the packet.
224
234
status = dc_iostream_read (device -> iostream , answer , asize , NULL );
225
235
if (status != DC_STATUS_SUCCESS ) {
0 commit comments