summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-05-13 20:02:29 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-05-13 20:02:29 +0000
commitc61a00f81462788231a78afdfe4616cee61c93c9 (patch)
treef64debf2b70255477a3d3ae5aa3ecf3aacb980cb
parent3339baf7557607ab7714654bc64a439d84e75ccb (diff)
xpp: better error reporting when failing to talk to a pre-MPP Astribank.
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@6616 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--xpp/mpp_funcs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xpp/mpp_funcs.c b/xpp/mpp_funcs.c
index da4eb46..61868db 100644
--- a/xpp/mpp_funcs.c
+++ b/xpp/mpp_funcs.c
@@ -254,14 +254,16 @@ struct mpp_command *recv_command(struct astribank_device *astribank, int timeout
ERR("Out of memory\n");
goto err;
}
+ reply->header.len = 0;
ret = recv_usb(astribank, (char *)reply, PACKET_SIZE, timeout);
if(ret < 0) {
ERR("Receive from usb failed.\n");
goto err;
}
if(ret != reply->header.len) {
- ERR("Wrong length received: got %d bytes, but length field says %d bytes\n",
- ret, reply->header.len);
+ ERR("Wrong length received: got %d bytes, but length field says %d bytes%s\n",
+ ret, reply->header.len,
+ (ret == 1)? ". Old USB firmware?": "");
goto err;
}
//dump_packet(LOG_DEBUG, __FUNCTION__, (char *)reply, ret);