Skip to content

Commit a37b8d2

Browse files
Merge pull request #4 from ShimmerEngineering/DEV-221
DEV-221 Add BLE gRPC Server
2 parents bb1893e + 54fc534 commit a37b8d2

20 files changed

+3161
-11
lines changed

Shimmer.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ShimmerBLEGrpc/Package.resolved

Lines changed: 159 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ShimmerBLEGrpc/Package.swift

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// swift-tools-version:6.0
2+
/*
3+
* Copyright 2024, gRPC Authors All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import PackageDescription
19+
20+
let package = Package(
21+
name: "hello-world",
22+
platforms: [.macOS("15.0")],
23+
dependencies: [
24+
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"),
25+
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"),
26+
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"),
27+
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"),
28+
],
29+
targets: [
30+
.executableTarget(
31+
name: "hello-world",
32+
dependencies: [
33+
.product(name: "GRPCCore", package: "grpc-swift"),
34+
.product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"),
35+
.product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"),
36+
.product(name: "ArgumentParser", package: "swift-argument-parser"),
37+
],
38+
plugins: [
39+
.plugin(name: "GRPCProtobufGenerator", package: "grpc-swift-protobuf")
40+
]
41+
)
42+
]
43+
)

ShimmerBLEGrpc/Readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
To run the BLE gRPC server, set the active scheme at the top-middle of Xcode to ShimmerBLEGrpc, target My Mac
2+
Then, select the Start button at the top-left of Xcode to start the app
3+
Then, open the Shimmer-Java-Android-API ShimmerGRPC.java class from: https://github.com/ShimmerEngineering/Shimmer-Java-Android-API/blob/master/ShimmerDriverPC/src/main/java/com/shimmerresearch/pcDriver/ShimmerGRPC.java
4+
Set the name of the device you want to connect to, in Line 101 of the class. This is e.g. "Shimmer3-XXXX".
5+
Note that this is not the Bluetooth Mac address, as MacOS BLE is limited to using Bluetooth device names.
6+
Then, run ShimmerGRPC.java
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.cs.disable-library-validation</key>
6+
<true/>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)