AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/src/bacapp.c
BACNET_APPLICATION_TAG bacapp_context_tag_type(
    BACNET_PROPERTY_ID property,
    uint8_t tag_number)
{
    BACNET_APPLICATION_TAG tag = MAX_BACNET_APPLICATION_TAG;

    switch (property) {
        case PROP_ACTUAL_SHED_LEVEL:
        case PROP_REQUESTED_SHED_LEVEL:
        case PROP_EXPECTED_SHED_LEVEL:
            switch (tag_number) {
                case 0:
                case 1:
                    tag = BACNET_APPLICATION_TAG_UNSIGNED_INT;
                    break;
                case 2:
                    tag = BACNET_APPLICATION_TAG_REAL;
                    break;
                default:
                    break;
            }
            break;
        case PROP_ACTION:
            switch (tag_number) {
                case 0:
                case 1:
                    tag = BACNET_APPLICATION_TAG_OBJECT_ID;
                    break;
                case 2:
                    tag = BACNET_APPLICATION_TAG_ENUMERATED;
                    break;
                case 3:
                case 5:
                case 6:
                    tag = BACNET_APPLICATION_TAG_UNSIGNED_INT;
                    break;
                case 7:
                case 8:
                    tag = BACNET_APPLICATION_TAG_BOOLEAN;
                    break;
                case 4:        /* propertyValue: abstract syntax */
                default:
                    break;
            }
            break;
        case PROP_LIST_OF_GROUP_MEMBERS:
            /* Sequence of ReadAccessSpecification */
            switch (tag_number) {
                case 0:
                    tag = BACNET_APPLICATION_TAG_OBJECT_ID;
                    break;
                default:
                    break;
            }
            break;
        case PROP_EXCEPTION_SCHEDULE:
            switch (tag_number) {
                case 1:
                    tag = BACNET_APPLICATION_TAG_OBJECT_ID;
                    break;
                case 3:
                    tag = BACNET_APPLICATION_TAG_UNSIGNED_INT;
                    break;
                case 0:        /* calendarEntry: abstract syntax + context */
                case 2:        /* list of BACnetTimeValue: abstract syntax */
                default:
                    break;
            }
            break;
        case PROP_LOG_DEVICE_OBJECT_PROPERTY:
            switch (tag_number) {
                case 0:        /* Object ID */
                case 3:        /* Device ID */
                    tag = BACNET_APPLICATION_TAG_OBJECT_ID;
                    break;
                case 1:        /* Property ID */
                    tag = BACNET_APPLICATION_TAG_ENUMERATED;
                    break;
                case 2:        /* Array index */
                    tag = BACNET_APPLICATION_TAG_UNSIGNED_INT;
                    break;
                default:
                    break;
            }
            break;
        case PROP_SUBORDINATE_LIST:
            /* BACnetARRAY[N] of BACnetDeviceObjectReference */
            switch (tag_number) {
                case 0:        /* Optional Device ID */
                case 1:        /* Object ID */
                    tag = BACNET_APPLICATION_TAG_OBJECT_ID;
                    break;
                default:
                    break;
            }
            break;

        case PROP_RECIPIENT_LIST:
            /* List of BACnetDestination */
            switch (tag_number) {
                case 0:        /* Device Object ID */
                    tag = BACNET_APPLICATION_TAG_OBJECT_ID;
                    break;
                case 1:
                    /* 2015.08.22 EKH 135-2012 pg 708
                    todo - Context 1 in Recipient list would be a BACnetAddress, not coded yet...
                    BACnetRecipient::= CHOICE {
                         device  [0] BACnetObjectIdentifier,
                         address  [1] BACnetAddress
                          }
                          */
                    break;
                default:
                    break;
            }
            break;
        case PROP_ACTIVE_COV_SUBSCRIPTIONS:
            /* BACnetCOVSubscription */
            switch (tag_number) {
                case 0:        /* BACnetRecipientProcess */
                case 1:        /* BACnetObjectPropertyReference */
                    break;
                case 2:        /* issueConfirmedNotifications */
                    tag = BACNET_APPLICATION_TAG_BOOLEAN;
                    break;
                case 3:        /* timeRemaining */
                    tag = BACNET_APPLICATION_TAG_UNSIGNED_INT;
                    break;
                case 4:        /* covIncrement */
                    tag = BACNET_APPLICATION_TAG_REAL;
                    break;
                default:
                    break;
            }
            break;
        default:
            break;
    }

    return tag;
}
/* returns the fixed tag type for certain context tagged properties */
returns the fixed tag type for certain context tagged properties
returns the fixed tag type for certain context tagged properties
BACNET_APPLICATION_TAG bacapp_context_tag_type(
    BACNET_PROPERTY_ID property,
    uint8_t tag_number)
{
    BACNET_APPLICATION_TAG tag = MAX_BACNET_APPLICATION_TAG;
    switch (property) {
        case PROP_ACTUAL_SHED_LEVEL:
        case PROP_REQUESTED_SHED_LEVEL:
        case PROP_EXPECTED_SHED_LEVEL:
            switch (tag_number) {
                case 0:
                case 1:
                    tag = BACNET_APPLICATION_TAG_UNSIGNED_INT;
                    break;
                case 2:
                    tag = BACNET_APPLICATION_TAG_REAL;
                    break;
                default:
                    break;
            }
            break;
        case PROP_ACTION:
            switch (tag_number) {
                case 0:
                case 1:
                    tag = BACNET_APPLICATION_TAG_OBJECT_ID;
                    break;
                case 2:
                    tag = BACNET_APPLICATION_TAG_ENUMERATED;
                    break;
                case 3:
                case 5:
                case 6:
                    tag = BACNET_APPLICATION_TAG_UNSIGNED_INT;
                    break;
                case 7:
                case 8:
                    tag = BACNET_APPLICATION_TAG_BOOLEAN;
                    break;
                case 4:        
                default:
                    break;
            }
            break;
        case PROP_LIST_OF_GROUP_MEMBERS:
            switch (tag_number) {
                case 0:
                    tag = BACNET_APPLICATION_TAG_OBJECT_ID;
                    break;
                default:
                    break;
            }
            break;
        case PROP_EXCEPTION_SCHEDULE:
            switch (tag_number) {
                case 1:
                    tag = BACNET_APPLICATION_TAG_OBJECT_ID;
                    break;
                case 3:
                    tag = BACNET_APPLICATION_TAG_UNSIGNED_INT;
                    break;
                case 0:        
                case 2:        
                default:
                    break;
            }
            break;
        case PROP_LOG_DEVICE_OBJECT_PROPERTY:
            switch (tag_number) {
                case 0:        
                case 3:        
                    tag = BACNET_APPLICATION_TAG_OBJECT_ID;
                    break;
                case 1:        
                    tag = BACNET_APPLICATION_TAG_ENUMERATED;
                    break;
                case 2:        
                    tag = BACNET_APPLICATION_TAG_UNSIGNED_INT;
                    break;
                default:
                    break;
            }
            break;
        case PROP_SUBORDINATE_LIST:
            switch (tag_number) {
                case 0:        
                case 1:        
                    tag = BACNET_APPLICATION_TAG_OBJECT_ID;
                    break;
                default:
                    break;
            }
            break;
        case PROP_RECIPIENT_LIST:
            switch (tag_number) {
                case 0:        
                    tag = BACNET_APPLICATION_TAG_OBJECT_ID;
                    break;
                case 1:
                    break;
                default:
                    break;
            }
            break;
        case PROP_ACTIVE_COV_SUBSCRIPTIONS:
            switch (tag_number) {
                case 0:        
                case 1:        
                    break;
                case 2:        
                    tag = BACNET_APPLICATION_TAG_BOOLEAN;
                    break;
                case 3:        
                    tag = BACNET_APPLICATION_TAG_UNSIGNED_INT;
                    break;
                case 4:        
                    tag = BACNET_APPLICATION_TAG_REAL;
                    break;
                default:
                    break;
            }
            break;
        default:
            break;
    }
    return tag;
}
BACNET_APPLICATION_TAG bacapp_context_tag_type ( BACNET_PROPERTY_ID property , uint8_t tag_number ) { BACNET_APPLICATION_TAG tag = MAX_BACNET_APPLICATION_TAG ; switch ( property ) { case PROP_ACTUAL_SHED_LEVEL : case PROP_REQUESTED_SHED_LEVEL : case PROP_EXPECTED_SHED_LEVEL : switch ( tag_number ) { case 0 : case 1 : tag = BACNET_APPLICATION_TAG_UNSIGNED_INT ; break ; case 2 : tag = BACNET_APPLICATION_TAG_REAL ; break ; default : break ; } break ; case PROP_ACTION : switch ( tag_number ) { case 0 : case 1 : tag = BACNET_APPLICATION_TAG_OBJECT_ID ; break ; case 2 : tag = BACNET_APPLICATION_TAG_ENUMERATED ; break ; case 3 : case 5 : case 6 : tag = BACNET_APPLICATION_TAG_UNSIGNED_INT ; break ; case 7 : case 8 : tag = BACNET_APPLICATION_TAG_BOOLEAN ; break ; case 4 : default : break ; } break ; case PROP_LIST_OF_GROUP_MEMBERS : switch ( tag_number ) { case 0 : tag = BACNET_APPLICATION_TAG_OBJECT_ID ; break ; default : break ; } break ; case PROP_EXCEPTION_SCHEDULE : switch ( tag_number ) { case 1 : tag = BACNET_APPLICATION_TAG_OBJECT_ID ; break ; case 3 : tag = BACNET_APPLICATION_TAG_UNSIGNED_INT ; break ; case 0 : case 2 : default : break ; } break ; case PROP_LOG_DEVICE_OBJECT_PROPERTY : switch ( tag_number ) { case 0 : case 3 : tag = BACNET_APPLICATION_TAG_OBJECT_ID ; break ; case 1 : tag = BACNET_APPLICATION_TAG_ENUMERATED ; break ; case 2 : tag = BACNET_APPLICATION_TAG_UNSIGNED_INT ; break ; default : break ; } break ; case PROP_SUBORDINATE_LIST : switch ( tag_number ) { case 0 : case 1 : tag = BACNET_APPLICATION_TAG_OBJECT_ID ; break ; default : break ; } break ; case PROP_RECIPIENT_LIST : switch ( tag_number ) { case 0 : tag = BACNET_APPLICATION_TAG_OBJECT_ID ; break ; case 1 : break ; default : break ; } break ; case PROP_ACTIVE_COV_SUBSCRIPTIONS : switch ( tag_number ) { case 0 : case 1 : break ; case 2 : tag = BACNET_APPLICATION_TAG_BOOLEAN ; break ; case 3 : tag = BACNET_APPLICATION_TAG_UNSIGNED_INT ; break ; case 4 : tag = BACNET_APPLICATION_TAG_REAL ; break ; default : break ; } break ; default : break ; } return tag ; }
returns the fixed tag type for certain context tagged properties
returns the fixed tag type for certain context tagged properties
/* propertyValue: abstract syntax */ /* Sequence of ReadAccessSpecification */ /* calendarEntry: abstract syntax + context */ /* list of BACnetTimeValue: abstract syntax */ /* Object ID */ /* Device ID */ /* Property ID */ /* Array index */ /* BACnetARRAY[N] of BACnetDeviceObjectReference */ /* Optional Device ID */ /* Object ID */ /* List of BACnetDestination */ /* Device Object ID */ /* 2015.08.22 EKH 135-2012 pg 708
                    todo - Context 1 in Recipient list would be a BACnetAddress, not coded yet...
                    BACnetRecipient::= CHOICE {
                         device  [0] BACnetObjectIdentifier,
                         address  [1] BACnetAddress
                          }
                          */ /* BACnetCOVSubscription */ /* BACnetRecipientProcess */ /* BACnetObjectPropertyReference */ /* issueConfirmedNotifications */ /* timeRemaining */ /* covIncrement */