Return-Path: To: linux-bluetooth@vger.kernel.org From: Jon Maber Subject: org.bluez.ProfileManager1 RegisterProfile Message-ID: Date: Sat, 6 Jan 2018 16:15:08 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Sender: linux-bluetooth-owner@vger.kernel.org List-ID: I hope this isn't off topic.  Please ignore if so. In brief my problem relates to the fact that only one PSM can be passed to RegisterProfile in the interface org.bluez.ProfileManager1.  I want to use a Raspberry Pi to emulate a bluetooth HID keyboard and need therefore to use the two standard PSMs 17 and 19. My cludgy solution is to create two objects which implement org.bluez.Profile1 and register one with the HID UUID and PSM=19 and the other with a random UUID and PSM=17. Could I achieve this in a cleaner way? If not, would it be possible for a future version of the daemon to look for PSMs in the service record passed to RegisterProfile. These are found in the ProtocolDescriptorList and AdditionalProtocolDescriptorLists attributes.  [if anyone is interested I've pasted my annotated service record below.] Regards, Jon Maber P.S. My intention is to produce a new version of Gavin Thomas' tutorial from five years back [ see below ] which will work with the version of bluez that currently comes with Raspbian, i.e. 5.43. https://www.gadgetdaily.xyz/emulate-a-bluetooth-keyboard-with-the-raspberry-pi/ keybrec = (""     ""     " "        # ServiceClassIDList     "  "     "   "      # HID Service     "  "     " "     " "        # ProtocolDescriptorList     "  "     "   "     "    "     # L2CAP     "    "   # PSM 17    Reserved for HID_Control     "   "     "   "     "    "     # HIDP     "   "     "  "     " "     " "        # BrowseGroupList     "  "     "   "      # PublicBrowseRoot     "  "     " "     " "        # language info for human readable attributes     "  "     "   "    # 'en', i.e. English     "   "    # utf-8  see http://www.isi.edu/in-notes/iana/assignments/character-sets     "   "    # Offset for language dependant name attributes     "  "     " "     " "        # BluetoothProfileDescriptorList     "  "     "   "     "    "     # HID Service     "    "   # v1.0.0     "   "     "  "     " "     " "        # AdditionalProtocolDescriptorLists     "  "     "   "     "    "     "     "    # L2CAP     "     "  # PSM 19    Reserved for HID_Interrupt     "    "     "    "     "     "    # HIDP     "    "     "   "     "  "     " "     " "     #ServiceName     "  "     " "     " "     #ServiceDescription     "  BT Keyboard\" />"     " "     " "     #ProviderName     "  "     " "                  # See bluetooth_hid_spec_v1-1.pdf                  # http://manualzz.com/doc/25055101/bluetooth-hid-profile     " "     # HIDDeviceReleaseNumber     "  "  # ver. 1.0.0  but this seems to be a redundant attribute     " "     " "     # HIDParserVersion     "  "  # ver 1.1.1 of HID specification used     " "     " "     # HIDDeviceSubclass     "  "     " "     " "     # HIDCountryCode     "  "     # Not localised     " "     " "     # HIDVirtualCable     "  "   # expects to automatically reconnect     " "     " "     # HIDReconnectInitiate     "  "   # Who reconnects? This keyboard.  [But may delay until it has data to send.]     " "     " "     # HIDDescriptorList     "  "     "   "                  # One and only descriptor     "    "   # A report as per USB spec.     "    "     "   "     "  "     " "     " "     # HIDLANGIDBaseList this is a required attribute even though irrelevant     "  "                   # localisation of human readable attributes     "   "     "    "  # lang and encoding as per USB     "    "  # attribute id offset     "   "     "  "     " "     " "     # HIDProfileVersion     "  "     " "     " "     # HIDSupervisionTimeout Not required, must not clash with other SDP records     "  "  # unit = slots     " "     " "     # HIDNormallyConnectable   will device remain connectable when not connected?     "  "  # Should be true for use with computers     " "     " "     # HIDBootDevice     "  "   # 'true' also implies that we support Set_Protocol and Get_Protocol commands     " "     " "     # ​HIDSSRHostMaxLatency     "  "     " "     " "     #​ HIDSSRHostMinTimeout     "  "     " "     "")