Reedyuk / blue-falcon

A Bluetooth kotlin multiplatform "Cross-Platform" library for iOS and Android
https://bluefalcon.dev
Apache License 2.0
321 stars 43 forks source link

:bug: Fix that manufacture data was from type NSData instead of byte #92

Closed nilskasseckert closed 2 years ago

nilskasseckert commented 2 years ago

Fixed a bug where the Manufacture Data in the shared code could not be used when running the project on iOS/Mac OS.

This was because the data was of type NSData and not ByteArray. A conversion is necessary. @Reedyuk

Reedyuk commented 2 years ago

Looks good, nothing like this needed on the android side of things?

Reedyuk commented 2 years ago

My thoughts are to push most things to the common target where possible. So of this is potentially shared amongst targets then it should live in common. Maybe your current approach is fine for this example but just be mindful, we don't want divergent targets.

nilskasseckert commented 2 years ago

@Reedyuk Android directly uses byte array as this is the default in Kotlin.

This change makes it possible to share the code again.

Previously, the app always crashed in my shared code because on Android it is ByteArray and on iOS it is NSData. With this change you now have ByteArray everywhere and can work with it in shared code.