lukevanin / swift-mindstorms

Library for communicating with Lego® Mindstorms Robot Inventor 51515 and Spike Prime 45678 Hubs from Swift (iOS, iPadOS, MacOS, and Playgrounds).
MIT License
5 stars 2 forks source link

support cocoapods? #1

Open crazypoo opened 3 years ago

crazypoo commented 3 years ago

support cocoapods,por favor

crazypoo commented 3 years ago

and framework doesent work

crazypoo commented 3 years ago

2021-05-30 01:04:26.901039+0800 LegoMind[2381:565522] IAPDHasLaunched: kIAPAvailableNotification iapdAvailableState 0 -> 0 2021-05-30 01:04:26.901220+0800 LegoMind[2381:565522] IAP2DHasLaunched: kIAP2AvailableNotification iap2dAvailableState 0 -> 0 2021-05-30 01:04:26.901420+0800 LegoMind[2381:565522] -[EAAccessoryManager _initFromSingletonCreationMethod] isRunningOnMac Reconnecting... No accessory found matching protocol.

lukevanin commented 3 years ago

"No accessory found matching protocol."

Sorry this is a documentation bug.

You need add UISupportedExternalAccessoryProtocols and NSBluetoothAlwaysUsageDescription to your Info.plist for this to work:

    <key>NSBluetoothAlwaysUsageDescription</key>
    <string>Allow this application to use Bluetooth to connect to your Lego® Mindstorms® programmable brick</string>
    <key>UISupportedExternalAccessoryProtocols</key>
    <array>
        <string>com.lego.les</string>
    </array>

Something else to look out for - the iOS Bluetooth connect dialog does seem to work reliably using a Scene Delegate or SwiftUI Scene based application. Make sure to use a UIWindow based application.

lukevanin commented 3 years ago

@crazypoo GitHub won't allow me to comment or push on this repo for some reason.

Check out my other project that uses this framework or an example: https://github.com/lukevanin/autonomous-robot

crazypoo commented 3 years ago

Si,https://github.com/crazypoo/myrobot this is my lego ev3 project😺😺😺😺😺😺

lukevanin commented 3 years ago

Si,https://github.com/crazypoo/myrobot this is my lego ev3 project😺😺😺😺😺😺

That looks great!

I noticed you seem to be interfacing with EV3. Note that the swift-mindstorms framework will only work with Mindstorms Robot Inventor and Spike Prime. I don't think it will work with EV3 (but I have not tested it).