V23GoRunner: Add funcs for ble-client and ble-server.
Connection establishment time: 49s
Single RPC Time: 720ms
Change-Id: I8cd2aa6a0b28a4ac001a7104f46b9dc46684797f
diff --git a/impl/google/services/v23_go_runner/funcs.go b/impl/google/services/v23_go_runner/funcs.go
index 93d6a13..5628175 100644
--- a/impl/google/services/v23_go_runner/funcs.go
+++ b/impl/google/services/v23_go_runner/funcs.go
@@ -12,6 +12,7 @@
"v.io/v23"
"v.io/v23/context"
+ "v.io/v23/naming"
"v.io/v23/rpc"
"v.io/v23/security"
)
@@ -21,6 +22,10 @@
btServerName = "tmp/btServerName"
)
+var bleServerName = naming.Endpoint{
+ Protocol: "ble",
+}.Name()
+
// v23GoRunnerFuncs is a map containing go functions keys by unique strings
// intended to be run by java/android applications using V23GoRunner.run(key).
// Users must add function entries to this map and rebuild lib/android-lib in
@@ -30,6 +35,8 @@
"tcp-client": tcpClientFunc,
"bt-client": btClientFunc,
"bt-server": btServerFunc,
+ "ble-client": bleClientFunc,
+ "ble-server": bleServerFunc,
}
func tcpServerFunc(ctx *context.T) error {
@@ -88,3 +95,12 @@
}
return elapsed, nil
}
+
+func bleServerFunc(ctx *context.T) error {
+ ctx = v23.WithListenSpec(ctx, rpc.ListenSpec{Addrs: rpc.ListenAddrs{{Protocol: "ble"}}})
+ return runServer(ctx, "")
+}
+
+func bleClientFunc(ctx *context.T) error {
+ return runClient(ctx, bleServerName)
+}