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

MIN_CONN_INTERVAL

I need to set the connection interval to 7.5 ms. The main.c has the corresponding macro: MIN_CONN_INTERVAL but it seems to me that it supports only integer values...

Please let me know how to handle that.

Thanks.

Parents
  • Hi Baruch,

    Fortunately MIN_CONN_INTERVAL is specified in 1.25ms units, at least for SDK15, and the integer 6 will yield the desired 7.5ms.  See ble_gap.h

    Best Regards, Howard

  • main.c

    #define MIN_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS) /**< Minimum acceptable connection interval (20 ms), Connection interval uses 1.25 ms units. */

    app_util.h

    /**@brief Macro for converting milliseconds to ticks.
    *
    * @param[in] TIME Number of milliseconds to convert.
    * @param[in] RESOLUTION Unit to be converted to in [us/ticks].
    */
    #define MSEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000) / (RESOLUTION))

    enum
    {
    UNIT_0_625_MS = 625, /**< Number of microseconds in 0.625 milliseconds. */
    UNIT_1_25_MS = 1250, /**< Number of microseconds in 1.25 milliseconds. */
    UNIT_10_MS = 10000 /**< Number of microseconds in 10 milliseconds. */
    };

    So, even though that value 6 does work substituting breaks the integrity of the code. That is the major reason for my question.

Reply
  • main.c

    #define MIN_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS) /**< Minimum acceptable connection interval (20 ms), Connection interval uses 1.25 ms units. */

    app_util.h

    /**@brief Macro for converting milliseconds to ticks.
    *
    * @param[in] TIME Number of milliseconds to convert.
    * @param[in] RESOLUTION Unit to be converted to in [us/ticks].
    */
    #define MSEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000) / (RESOLUTION))

    enum
    {
    UNIT_0_625_MS = 625, /**< Number of microseconds in 0.625 milliseconds. */
    UNIT_1_25_MS = 1250, /**< Number of microseconds in 1.25 milliseconds. */
    UNIT_10_MS = 10000 /**< Number of microseconds in 10 milliseconds. */
    };

    So, even though that value 6 does work substituting breaks the integrity of the code. That is the major reason for my question.

Children
Related