AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/demo/object/lo.c
unsigned Lighting_Output_Present_Value_Priority(
    uint32_t object_instance)
{
    unsigned index = 0; /* instance to index conversion */
    unsigned p = 0;     /* loop counter */
    unsigned priority = 0;      /* return value */

    index = Lighting_Output_Instance_To_Index(object_instance);
    if (index < MAX_LIGHTING_OUTPUTS) {
        for (p = 0; p < BACNET_MAX_PRIORITY; p++) {
            if (BIT_CHECK(Lighting_Output[index].Priority_Active_Bits, p)) {
                priority = p + 1;
                break;
            }
        }
    }

    return priority;
}
/**
 * For a given object instance-number, determines the active priority
 *
 * @param  object_instance - object-instance number of the object
 *
 * @return  active priority 1..16, or 0 if no priority is active
 */
For a given object instance-number, determines the active priority
@param  object_instance - object-instance number of the object

@return  active priority 1..16, or 0 if no priority is active
For a given object instance - number determines the active priority @param object_instance - object - instance number of the object @return active priority 1 .. 16 or 0 if no priority is active
unsigned Lighting_Output_Present_Value_Priority(
    uint32_t object_instance)
{
    unsigned index = 0; 
    unsigned p = 0;     
    unsigned priority = 0;      
    index = Lighting_Output_Instance_To_Index(object_instance);
    if (index < MAX_LIGHTING_OUTPUTS) {
        for (p = 0; p < BACNET_MAX_PRIORITY; p++) {
            if (BIT_CHECK(Lighting_Output[index].Priority_Active_Bits, p)) {
                priority = p + 1;
                break;
            }
        }
    }
    return priority;
}
unsigned Lighting_Output_Present_Value_Priority ( uint32_t object_instance ) { unsigned index = 0 ; unsigned p = 0 ; unsigned priority = 0 ; index = Lighting_Output_Instance_To_Index ( object_instance ) ; if ( index < MAX_LIGHTING_OUTPUTS ) { for ( p = 0 ; p < BACNET_MAX_PRIORITY ; p ++ ) { if ( BIT_CHECK ( Lighting_Output [ index ] . Priority_Active_Bits , p ) ) { priority = p + 1 ; break ; } } } return priority ; }
For a given object instance-number, determines the active priority
 @param  object_instance - object-instance number of the object
For a given object instance - number determines the active priority @param object_instance - object - instance number of the object
/* instance to index conversion */ /* loop counter */ /* return value */