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

Will not popup a dialog while the bluetooth is not power on on iOS.Add support for multiple manufacturerData on Android. #709

Open
wants to merge 5 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
2 changes: 1 addition & 1 deletion bin/quality_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo 'export PATH="$PATH":"$FLUTTER_ROOT/.pub-cache/bin"' >>~/.bashrc
echo 'export PATH="$PATH":"$FLUTTER_ROOT/bin"' >>~/.bashrc
source ~/.bashrc

dart pub global activate melos
dart pub global activate melos 2.9.0

melos bootstrap
melos run analyze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ fun extractManufacturerData(manufacturerData: SparseArray<ByteArray>?): ByteArra
val rawData = mutableListOf<Byte>()

if (manufacturerData != null && manufacturerData.size() > 0) {
val companyId = manufacturerData.keyAt(0)
val payload = manufacturerData.get(companyId)

rawData.add((companyId.toByte()))
rawData.add(((companyId.shr(Byte.SIZE_BITS)).toByte()))
rawData.addAll(2, payload.asList())
var pos = 0
for (i in 0 until manufacturerData.size()) {
val companyId = manufacturerData.keyAt(i)
val payload = manufacturerData.get(companyId)
rawData.add((companyId.toByte()))
rawData.add(((companyId.shr(Byte.SIZE_BITS)).toByte()))
pos += 2
val list = payload.asList()
rawData.addAll(pos, list)
pos += list.size
}
}

return rawData.toByteArray()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ final class Central {
)
self.centralManager = CBCentralManager(
delegate: centralManagerDelegate,
queue: nil
queue: nil,
options: [CBCentralManagerOptionShowPowerAlertKey:false]
)
}

Expand Down