This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Adding midi services

I am using a usual uart to bluetooth application and it works great, but I would like to set this application to be a known apple midi device, it seems I only have to add a specific service.

According to Apple, you need to set up a service like this :

MIDI Service  	 03B80E5A-EDE8-4B33-A751-6CE34EC4C700
MIDI I/O Characteristic  7772E5DB-3868-4112-A1A9-F2669D106BF3

They also say that :

 The accessory shall request a connection interval of 15 ms or less

Now, using the regular uart example application I set the services like this:

static ble_nus_t                        m_nus;                                      /**< Structure to identify the Nordic UART Service. */
static uint16_t                         m_conn_handle = BLE_CONN_HANDLE_INVALID;    /**< Handle of the current connection. */

static nrf_ble_gatt_t                   m_gatt;                                     /**< GATT module instance. */
static ble_uuid_t                       m_adv_uuids[] = {{BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE}};  /**< Universally unique service identifier. */
static uint16_t                         m_ble_nus_max_data_len = BLE_GATT_ATT_MTU_DEFAULT - 3;  /**< Maximum length of data (in bytes) that can be transmitted to the peer by the Nordic UART service module. */

in which I can't really understand correctly how you setup the service and the characteristic in this code - how can I set the Apple service/char ?

Also, how would i request the "connection interval of 15ms or less" in the nrf52 code ?

Parents
  • Hi,

    According to the specification, the BLE MIDI device must request a connection interval of 15 ms or less. A lower connection interval is preferred in most applications of MIDI. The lowest allowed connection interval for BLE is 7.5 ms, so you should therefore set the connection interval like this:

    #define MIN_CONN_INTERVAL               MSEC_TO_UNITS(7.5, UNIT_1_25_MS)           
    #define MAX_CONN_INTERVAL               MSEC_TO_UNITS(15, UNIT_1_25_MS)
    

    Unfortunately we don't have any full BLE MIDI examples or documentation for this. There are a few discussions on devzone that might be of interest though. Maybe especially this one.

Reply
  • Hi,

    According to the specification, the BLE MIDI device must request a connection interval of 15 ms or less. A lower connection interval is preferred in most applications of MIDI. The lowest allowed connection interval for BLE is 7.5 ms, so you should therefore set the connection interval like this:

    #define MIN_CONN_INTERVAL               MSEC_TO_UNITS(7.5, UNIT_1_25_MS)           
    #define MAX_CONN_INTERVAL               MSEC_TO_UNITS(15, UNIT_1_25_MS)
    

    Unfortunately we don't have any full BLE MIDI examples or documentation for this. There are a few discussions on devzone that might be of interest though. Maybe especially this one.

Children
No Data
Related