Exemplo n.º 1
0
void ble_stack_stop(void)
{
    uint32_t err_code;
    
    err_code = softdevice_handler_sd_disable();
    APP_ERROR_CHECK(err_code);
}
Exemplo n.º 2
0
ble_error_t nRF5xn::shutdown(void)
{
    if (!initialized) {
        return BLE_ERROR_INITIALIZATION_INCOMPLETE;
    }

    /*
     * Shutdown the SoftDevice first. This is because we need to disable all
     * interrupts. Otherwise if we clear the BLE API and glue code first there
     * will be many NULL references and no config information which could lead
     * to errors if the shutdown process is interrupted.
     */
    #if NRF_SD_BLE_API_VERSION >= 5
    if (nrf_sdh_disable_request() != NRF_SUCCESS) {
        return BLE_STACK_BUSY;
    }
    #else
    if (softdevice_handler_sd_disable() != NRF_SUCCESS) {
        return BLE_STACK_BUSY;
    }
    #endif

    /* Shutdown the BLE API and nRF51 glue code */
    ble_error_t error;

    if (gattServerInstance != NULL) {
        error = gattServerInstance->reset();
        if (error != BLE_ERROR_NONE) {
            return error;
        }
    }

    if (securityManagerInstance != NULL) {
        error = securityManagerInstance->reset();
        if (error != BLE_ERROR_NONE) {
            return error;
        }
    }

    /* S110 does not support BLE client features, nothing to reset. */
#if !defined(TARGET_MCU_NRF51_16K_S110) && !defined(TARGET_MCU_NRF51_32K_S110)
    error = getGattClient().reset();
    if (error != BLE_ERROR_NONE) {
        return error;
    }
#endif

    /* Gap instance is always present */
    error = gapInstance.reset();
    if (error != BLE_ERROR_NONE) {
        return error;
    }

    custom_reset_128bits_uuid_table();

    initialized = false;
    return BLE_ERROR_NONE;
}
Exemplo n.º 3
0
ble_error_t nRF51822n::shutdown(void)
{
    return (softdevice_handler_sd_disable() == NRF_SUCCESS) ? BLE_ERROR_NONE : BLE_STACK_BUSY;
}
Exemplo n.º 4
0
void BLEdisable()
{
    uint32_t err_code = softdevice_handler_sd_disable();
    BLE_ERROR_CHECK(err_code);
}