UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Development of Bluetooth-enabled Ubuntu Touch App

    Scheduled Pinned Locked Moved App Development
    4 Posts 3 Posters 972 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      nilsl
      last edited by

      Dear all, I hope I'm asking this question in the right place.
      I'm trying to program a Ubuntu Touch app which needs to use the Bluetooth-capabilities of the Nexus 5 phone (currently with UT OTA-8).

      I did not find any information on bluetooth-development or any suitable example for Ubuntu Touch. Did I miss something?

      So, I started out with the clickable template "main-cpp - C++/QML App (built using Cmake with a main.cpp)". I then downloaded the QT5 Example Project BTScanner and integrated it in the clickable-template.

      Good news: My project compiles without error.
      Bad news: When I run the app with "clickable launch", this error ends up in the log

      Loading module: 'libubuntu_application_api_touch_mirclient.so.3.0.0'
      Cannot find a running Bluez. Please check the Bluez installtion
      

      Does anyone have a hint what I am doing wrong? Is Bluetooth supposed to work a all? Is there a permission problem?

      Thank you! Best regards, Nils

      advocatuxA 1 Reply Last reply Reply Quote 0
      • advocatuxA Offline
        advocatux @nilsl
        last edited by

        @nilsl while waiting for someone who really knows about development πŸ˜… have you seen http://docs.ubports.com/en/latest/appdev/platform/apparmor.html#bluetooth?

        N 1 Reply Last reply Reply Quote 1
        • flohackF Offline
          flohack
          last edited by

          Remember that Apps do not have any access to hardware directly. This is all contained and sealed and probably you could try to run the App as unconfined, but that removes all protections.
          BR

          My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

          1 Reply Last reply Reply Quote 1
          • N Offline
            nilsl @advocatux
            last edited by nilsl

            @advocatux Thanks. Yes, I was aware I have to add the "bluetooth" policy group to the .apparmor-file:

            {
                "policy_groups": ["bluetooth"],
                "policy_version": 16.04
            }
            

            However, I probably got confused: It seems that the AppArmor-configuration only gets adopted when the version number in manifest.json is increased (I don't know if this bug report is related).

            Anyway, with this .apparmor-file and after increasing the version in manifest.json, the error ("Cannot find a running Bluez") is gone.

            @Flohack
            I this case, adding

            "template": "unconfined"
            

            to the .apparmor-file did not seem to be necessary to get Bluetooth-access. Thanks for the hint about running apps as unconfined anyway.

            1 Reply Last reply Reply Quote 1

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better πŸ’—

            Register Login
            • First post
              Last post