def generate_ad_flag_value(le_limited_discoverable=False, le_general_discoverable=False, bredr_not_supported=False,
                           simultaneous_le_bredr_controller=False,
                           simultaneous_le_bredr_host=False):
    """
    Generate advertising data flag value based on user supplied options. This is a helper function to
    simplify creation of a single octet containing all the AD flags.
    See Supplement to Bluetooth Core Specification | CSSv7, Part A page 12

    :param le_limited_discoverable: Enable LE limited discoverable flag
    :type le_limited_discoverable: bool
    :param le_general_discoverable: Enable LE general discoverable flag
    :type le_general_discoverable: bool
    :param bredr_not_supported: Enable BR/EDR not supported flag
    :type bredr_not_supported: bool
    :param simultaneous_le_bredr_controller: Enable simultaneous LE and BR/EDR controller flag
    :type simultaneous_le_bredr_controller: bool
    :param simultaneous_le_bredr_host: Enable simultaneous LE and BR/EDR host flag
    :type simultaneous_le_bredr_host: bool
    :return: AD flag value (single octet) based on supplied options
    :rtype: int
    """
    value = 0
    if le_limited_discoverable:
        value += (1 << 0)
    if le_general_discoverable:
        value += (1 << 1)
    if bredr_not_supported:
        value += (1 << 2)
    if simultaneous_le_bredr_controller:
        value += (1 << 3)
    if simultaneous_le_bredr_host:
        value += (1 << 4)

    return value