/* Returns a pointer to a GATT error object with the specified fields. The returned object is statically allocated, so this function is not reentrant. This function should only ever be called by the ble_hs task.  */
static struct ble_gatt_error* ble_gattc_error(int status, uint16_t att_handle)
/* Returns a pointer to a GATT error object with the specified fields. The returned object is statically allocated, so this function is not reentrant. This function should only ever be called by the ble_hs task.  */
static struct ble_gatt_error* ble_gattc_error(int status, uint16_t att_handle)
{
    static struct ble_gatt_error error;
    if (status == 0 || status == BLE_HS_EDONE) {
        att_handle = 0;
    }
    error.status = status;
    error.att_handle = att_handle;
    return &error;
}