AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/src/bacapp.c
int bacapp_decode_data_len(
    uint8_t * apdu,
    uint8_t tag_data_type,
    uint32_t len_value_type)
{
    int len = 0;

    if (apdu) {
        switch (tag_data_type) {
            case BACNET_APPLICATION_TAG_NULL:
                break;
            case BACNET_APPLICATION_TAG_BOOLEAN:
                break;
            case BACNET_APPLICATION_TAG_UNSIGNED_INT:
            case BACNET_APPLICATION_TAG_SIGNED_INT:
            case BACNET_APPLICATION_TAG_REAL:
            case BACNET_APPLICATION_TAG_DOUBLE:
            case BACNET_APPLICATION_TAG_OCTET_STRING:
            case BACNET_APPLICATION_TAG_CHARACTER_STRING:
            case BACNET_APPLICATION_TAG_BIT_STRING:
            case BACNET_APPLICATION_TAG_ENUMERATED:
            case BACNET_APPLICATION_TAG_DATE:
            case BACNET_APPLICATION_TAG_TIME:
            case BACNET_APPLICATION_TAG_OBJECT_ID:
                len = (int) len_value_type;
                break;
            default:
                break;
        }
    }

    return len;
}
/* Decode the data and
   return the number of octets consumed. */
Decode the data and
return the number of octets consumed.
Decode the data and return the number of octets consumed .
int bacapp_decode_data_len(
    uint8_t * apdu,
    uint8_t tag_data_type,
    uint32_t len_value_type)
{
    int len = 0;
    if (apdu) {
        switch (tag_data_type) {
            case BACNET_APPLICATION_TAG_NULL:
                break;
            case BACNET_APPLICATION_TAG_BOOLEAN:
                break;
            case BACNET_APPLICATION_TAG_UNSIGNED_INT:
            case BACNET_APPLICATION_TAG_SIGNED_INT:
            case BACNET_APPLICATION_TAG_REAL:
            case BACNET_APPLICATION_TAG_DOUBLE:
            case BACNET_APPLICATION_TAG_OCTET_STRING:
            case BACNET_APPLICATION_TAG_CHARACTER_STRING:
            case BACNET_APPLICATION_TAG_BIT_STRING:
            case BACNET_APPLICATION_TAG_ENUMERATED:
            case BACNET_APPLICATION_TAG_DATE:
            case BACNET_APPLICATION_TAG_TIME:
            case BACNET_APPLICATION_TAG_OBJECT_ID:
                len = (int) len_value_type;
                break;
            default:
                break;
        }
    }
    return len;
}
int bacapp_decode_data_len ( uint8_t * apdu , uint8_t tag_data_type , uint32_t len_value_type ) { int len = 0 ; if ( apdu ) { switch ( tag_data_type ) { case BACNET_APPLICATION_TAG_NULL : break ; case BACNET_APPLICATION_TAG_BOOLEAN : break ; case BACNET_APPLICATION_TAG_UNSIGNED_INT : case BACNET_APPLICATION_TAG_SIGNED_INT : case BACNET_APPLICATION_TAG_REAL : case BACNET_APPLICATION_TAG_DOUBLE : case BACNET_APPLICATION_TAG_OCTET_STRING : case BACNET_APPLICATION_TAG_CHARACTER_STRING : case BACNET_APPLICATION_TAG_BIT_STRING : case BACNET_APPLICATION_TAG_ENUMERATED : case BACNET_APPLICATION_TAG_DATE : case BACNET_APPLICATION_TAG_TIME : case BACNET_APPLICATION_TAG_OBJECT_ID : len = ( int ) len_value_type ; break ; default : break ; } } return len ; }
Decode the data and
return the number of octets consumed.
Decode the data and return the number of octets consumed .