/* Adds an unread alert to the given category then notifies the client if the given category is valid and enabled. */
int ble_svc_ans_unr_alert_add(uint8_t cat_id)
/* Adds an unread alert to the given category then notifies the client if the given category is valid and enabled. */
int ble_svc_ans_unr_alert_add(uint8_t cat_id)
{
    uint8_t cat_bit_mask;
    if (cat_id < BLE_SVC_ANS_CAT_NUM) {
        cat_bit_mask = 1 << cat_id;
    } else {
        return BLE_HS_EINVAL;
    }
    if ((cat_bit_mask & ble_svc_ans_unr_alert_cat) == 0) {
        return BLE_HS_EINVAL;
    }
    ble_svc_ans_unr_alert_cnt[cat_id] += 1;
    return ble_svc_ans_unr_alert_notify(cat_id);
}