You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2017/05/01 22:01:53 UTC

[3/3] incubator-mynewt-newtmgr git commit: nmxact - Log bhd sequence number on timeout.

nmxact - Log bhd sequence number on timeout.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newtmgr/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newtmgr/commit/78d069c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newtmgr/tree/78d069c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newtmgr/diff/78d069c7

Branch: refs/heads/master
Commit: 78d069c70577e28fb6edd8d8ad86aeb2e5fae52d
Parents: 564c088
Author: Christopher Collins <cc...@apache.org>
Authored: Mon May 1 14:20:01 2017 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon May 1 14:55:09 2017 -0700

----------------------------------------------------------------------
 nmxact/nmble/ble_act.go  | 24 ++++++++++++------------
 nmxact/nmble/ble_fsm.go  |  2 +-
 nmxact/nmble/ble_util.go |  7 ++++---
 3 files changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newtmgr/blob/78d069c7/nmxact/nmble/ble_act.go
----------------------------------------------------------------------
diff --git a/nmxact/nmble/ble_act.go b/nmxact/nmble/ble_act.go
index e924d2a..ad3a648 100644
--- a/nmxact/nmble/ble_act.go
+++ b/nmxact/nmble/ble_act.go
@@ -58,7 +58,7 @@ func terminate(x *BleXport, bl *BleListener, r *BleTerminateReq) error {
 			}
 
 		case <-bl.AfterTimeout(x.RspTimeout()):
-			return BhdTimeoutError(rspType)
+			return BhdTimeoutError(rspType, r.Seq)
 		}
 	}
 }
@@ -94,7 +94,7 @@ func connCancel(x *BleXport, bl *BleListener, r *BleConnCancelReq) error {
 			}
 
 		case <-bl.AfterTimeout(x.RspTimeout()):
-			return BhdTimeoutError(rspType)
+			return BhdTimeoutError(rspType, r.Seq)
 		}
 	}
 }
@@ -149,7 +149,7 @@ func discSvcUuid(x *BleXport, bl *BleListener, r *BleDiscSvcUuidReq) (
 			}
 
 		case <-bl.AfterTimeout(x.RspTimeout()):
-			return nil, BhdTimeoutError(rspType)
+			return nil, BhdTimeoutError(rspType, r.Seq)
 		}
 	}
 }
@@ -198,7 +198,7 @@ func discAllChrs(x *BleXport, bl *BleListener, r *BleDiscAllChrsReq) (
 			}
 
 		case <-bl.AfterTimeout(x.RspTimeout()):
-			return nil, BhdTimeoutError(rspType)
+			return nil, BhdTimeoutError(rspType, r.Seq)
 		}
 	}
 }
@@ -235,7 +235,7 @@ func writeCmd(x *BleXport, bl *BleListener, r *BleWriteCmdReq) error {
 			}
 
 		case <-bl.AfterTimeout(x.RspTimeout()):
-			return BhdTimeoutError(rspType)
+			return BhdTimeoutError(rspType, r.Seq)
 		}
 	}
 }
@@ -280,7 +280,7 @@ func exchangeMtu(x *BleXport, bl *BleListener, r *BleExchangeMtuReq) (
 			}
 
 		case <-bl.AfterTimeout(x.RspTimeout()):
-			return 0, BhdTimeoutError(rspType)
+			return 0, BhdTimeoutError(rspType, r.Seq)
 		}
 	}
 }
@@ -329,7 +329,7 @@ func scan(x *BleXport, bl *BleListener, r *BleScanReq,
 			}
 
 		case <-bl.AfterTimeout(x.RspTimeout()):
-			return BhdTimeoutError(rspType)
+			return BhdTimeoutError(rspType, r.Seq)
 
 		case <-abortChan:
 			return nil
@@ -367,7 +367,7 @@ func scanCancel(x *BleXport, bl *BleListener, r *BleScanCancelReq) error {
 			}
 
 		case <-bl.AfterTimeout(x.RspTimeout()):
-			return BhdTimeoutError(rspType)
+			return BhdTimeoutError(rspType, r.Seq)
 		}
 	}
 }
@@ -406,7 +406,7 @@ func connFind(x *BleXport, bl *BleListener, r *BleConnFindReq) (
 			}
 
 		case <-bl.AfterTimeout(x.RspTimeout()):
-			return BleConnDesc{}, BhdTimeoutError(rspType)
+			return BleConnDesc{}, BhdTimeoutError(rspType, r.Seq)
 		}
 	}
 }
@@ -444,7 +444,7 @@ func genRandAddr(x *BleXport, bl *BleListener, r *BleGenRandAddrReq) (
 			}
 
 		case <-bl.AfterTimeout(x.RspTimeout()):
-			return BleAddr{}, BhdTimeoutError(rspType)
+			return BleAddr{}, BhdTimeoutError(rspType, r.Seq)
 		}
 	}
 }
@@ -479,7 +479,7 @@ func setRandAddr(x *BleXport, bl *BleListener, r *BleSetRandAddrReq) error {
 			}
 
 		case <-bl.AfterTimeout(x.RspTimeout()):
-			return BhdTimeoutError(rspType)
+			return BhdTimeoutError(rspType, r.Seq)
 		}
 	}
 }
@@ -516,7 +516,7 @@ func setPreferredMtu(x *BleXport, bl *BleListener,
 			}
 
 		case <-bl.AfterTimeout(x.RspTimeout()):
-			return BhdTimeoutError(rspType)
+			return BhdTimeoutError(rspType, r.Seq)
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newtmgr/blob/78d069c7/nmxact/nmble/ble_fsm.go
----------------------------------------------------------------------
diff --git a/nmxact/nmble/ble_fsm.go b/nmxact/nmble/ble_fsm.go
index 4dd8e66..05c18ba 100644
--- a/nmxact/nmble/ble_fsm.go
+++ b/nmxact/nmble/ble_fsm.go
@@ -360,7 +360,7 @@ func (bf *BleFsm) connectListen(seq BleSeq) error {
 				}
 
 			case <-bl.AfterTimeout(bf.params.Bx.RspTimeout()):
-				err := BhdTimeoutError(MSG_TYPE_CONNECT)
+				err := BhdTimeoutError(MSG_TYPE_CONNECT, seq)
 				bf.connChan <- err
 				bf.errFunnel.Insert(err)
 			}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newtmgr/blob/78d069c7/nmxact/nmble/ble_util.go
----------------------------------------------------------------------
diff --git a/nmxact/nmble/ble_util.go b/nmxact/nmble/ble_util.go
index eb24906..9807da0 100644
--- a/nmxact/nmble/ble_util.go
+++ b/nmxact/nmble/ble_util.go
@@ -35,9 +35,10 @@ func NextSeq() BleSeq {
 	return seq
 }
 
-func BhdTimeoutError(rspType MsgType) error {
-	str := fmt.Sprintf("Timeout waiting for blehostd to send %s response",
-		MsgTypeToString(rspType))
+func BhdTimeoutError(rspType MsgType, seq BleSeq) error {
+	str := fmt.Sprintf(
+		"Timeout waiting for blehostd to send %s response (seq=%d)",
+		MsgTypeToString(rspType), seq)
 
 	log.Debug(str)
 	return nmxutil.NewXportError(str)