Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BluetoothLowEnergy starPortType for iOS device #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.1"
version: "2.8.1"
boolean_selector:
dependency: transitive
description:
Expand All @@ -28,7 +28,7 @@ packages:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -87,7 +87,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.7.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -141,7 +141,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
version: "0.4.2"
typed_data:
dependency: transitive
description:
Expand Down
6 changes: 6 additions & 0 deletions ios/Classes/SwiftFlutterStarPrntPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public class SwiftFlutterStarPrntPlugin: NSObject, FlutterPlugin {
info.append(portInfoToDictionary(portInfo: printer as! PortInfo))
}
}
if ( type == "BluetoothLowEnergy" || type == "All") {
let btPortInfoArray = try SMPort.searchPrinter(target: "BLE:")
for printer in btPortInfoArray {
info.append(portInfoToDictionary(portInfo: printer as! PortInfo))
}
}
if ( type == "LAN" || type == "All") {
let lanPortInfoArray = try SMPort.searchPrinter(target: "TCP:")
for printer in lanPortInfoArray {
Expand Down
3 changes: 3 additions & 0 deletions lib/src/enums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ enum StarPortType {
/// Checks bluetooth port
Bluetooth,

/// Checks bluetooth low energy port
BluetoothLowEnergy,

/// Checks USB port
USB,
}
Expand Down