예제 #1
0
uint32_t ble_db_discovery_evt_register(const ble_uuid_t * const p_uuid)
{
    VERIFY_PARAM_NOT_NULL(p_uuid);
    VERIFY_MODULE_INITIALIZED();

    return registered_handler_set(p_uuid, m_evt_handler);
}
예제 #2
0
uint32_t ble_db_discovery_evt_register(const ble_uuid_t * const             p_uuid,
                                       const ble_db_discovery_evt_handler_t evt_handler)
{
    VERIFY_PARAM_NOT_NULL(p_uuid);
    VERIFY_PARAM_NOT_NULL(evt_handler);
    VERIFY_MODULE_INITIALIZED();

    if (m_num_of_handlers_reg == DB_DISCOVERY_MAX_USERS)
    {
        // The limit on the maximum number of supported users has been reached. Return error.
        return NRF_ERROR_NOT_SUPPORTED;
    }

    return registered_handler_set(p_uuid, evt_handler);
}
uint32_t ble_db_discovery_evt_register(const ble_uuid_t * const             p_uuid,
                                       const ble_db_discovery_evt_handler_t evt_handler)
{
    if ((p_uuid == NULL) || (evt_handler == NULL))
    {
        return NRF_ERROR_NULL;
    }

    if (!m_initialized)
    {
        return NRF_ERROR_INVALID_STATE;
    }

    if (m_num_of_handlers_reg == DB_DISCOVERY_MAX_USERS)
    {
        // The limit on the maximum number of supported users has been reached. Return error.
        return NRF_ERROR_NOT_SUPPORTED;
    }

    return registered_handler_set(p_uuid, evt_handler);
}
예제 #4
0
uint32_t ble_db_discovery_register(const ble_uuid_t * const              p_uuid,
                                   const ble_db_discovery_evt_handler_t  evt_handler)
{
    if ((p_uuid == NULL) || (evt_handler == NULL))
    {
        return NRF_ERROR_NULL;
    }

    if (!m_initialized)
    {
        return NRF_ERROR_INVALID_STATE;
    }

    if (m_num_of_modules_reg == BLE_DB_DISCOVERY_MAX_USERS)
    {
        // The limit on the maximum number of users supported has reached. Return error.
        return NRF_ERROR_NOT_SUPPORTED;
    }

    BLE_UUID_COPY_INST(m_srv_uuid, *p_uuid);

    return registered_handler_set(p_uuid->uuid, evt_handler);
}