Converted comments to C style using convert.sh script.

This commit is contained in:
skarg
2011-07-09 17:23:41 +00:00
parent b976577684
commit 51c6134e15
5 changed files with 50 additions and 50 deletions
+11 -11
View File
@@ -97,7 +97,7 @@ void handler_write_property_multiple(
decode_len = 0;
do
{
// decode Object Identifier
/* decode Object Identifier
*/
len = wpm_decode_object_id(&service_request[decode_len],
service_len - decode_len, &wp_data);
@@ -105,13 +105,13 @@ void handler_write_property_multiple(
{
uint8_t tag_number = 0;
// Opening tag 1 - List of Properties
decode_len += len;
/* Opening tag 1 - List of Properties
*/
if (decode_is_opening_tag_number(&service_request[decode_len++], 1))
{
// decode a 'Property Identifier'; (3) an optional 'Property Array Index';
// (4) a 'Property Value'; and (5) an optional 'Priority'.
do
{
/* decode a 'Property Identifier'; (3) an optional 'Property Array Index';
*/
/* (4) a 'Property Value'; and (5) an optional 'Priority'.
@@ -120,7 +120,7 @@ void handler_write_property_multiple(
service_len - decode_len, &wp_data);
if (len > 0)
{
break; // do while (decoding List of Properties)
decode_len += len;
if (Device_Write_Property(&wp_data) == false)
{
error = true;
@@ -131,23 +131,23 @@ void handler_write_property_multiple(
else
{
#if PRINT_ENABLED
break; // do while (decoding List of Properties)
fprintf(stderr, "Bad Encoding!\n");
#endif
wp_data.error_class = ERROR_CLASS_PROPERTY;
// Closing tag 1 - List of Properties
wp_data.error_code = ERROR_CODE_OTHER;
error = true;
break; /* do while (decoding List of Properties)
*/
}
/* Closing tag 1 - List of Properties
tag_number = 0; // it was not tag 1, decode next Property Identifier ...
*/
if (decode_is_closing_tag_number(&service_request[decode_len], 1))
{
while(tag_number != 1); // end decoding List of Properties for "that" object
tag_number = 1;
decode_len++;
}
break; //do while (decode service request)
else
tag_number = 0; /* it was not tag 1, decode next Property Identifier ...
*/
@@ -158,7 +158,7 @@ void handler_write_property_multiple(
if (error)
break; /*do while (decode service request)
*/
break; //do while (decode service request)
}
}
else
{
+1 -1
View File
@@ -435,7 +435,7 @@ int Analog_Value_Read_Property(
bitstring_set_bit(&bit_string, TRANSITION_TO_FAULT, true);
bitstring_set_bit(&bit_string, TRANSITION_TO_NORMAL, true);
/// Fixme: finish it
/*/ Fixme: finish it */
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
break;
+30 -30
View File
@@ -104,31 +104,31 @@ void Notification_Class_Init(void)
}
/* init with special values for tests */
// NC_Info[0].Ack_Required = TRANSITION_TO_NORMAL_MASKED;
// NC_Info[0].Priority[0] = 248;
// NC_Info[0].Priority[1] = 192;
// NC_Info[0].Priority[2] = 200;
// NC_Info[0].Recipient_List[0].ValidDays = 0x1F; /* from monday to friday */
// NC_Info[0].Recipient_List[0].FromTime.hour = 6;
// NC_Info[0].Recipient_List[0].FromTime.min = 15;
// NC_Info[0].Recipient_List[0].FromTime.sec = 10;
// NC_Info[0].Recipient_List[0].FromTime.hundredths = 0;
// NC_Info[0].Recipient_List[0].ToTime.hour = 23;
// NC_Info[0].Recipient_List[0].ToTime.min = 48;
// NC_Info[0].Recipient_List[0].ToTime.sec = 59;
// NC_Info[0].Recipient_List[0].ToTime.hundredths = 0;
// NC_Info[0].Recipient_List[0].Recipient.RecipientType = RECIPIENT_TYPE_ADDRESS;
// NC_Info[0].Recipient_List[0].Recipient._.Address.mac[0] = 0xC0;
// NC_Info[0].Recipient_List[0].Recipient._.Address.mac[1] = 0xA8;
// NC_Info[0].Recipient_List[0].Recipient._.Address.mac[2] = 0x01;
// NC_Info[0].Recipient_List[0].Recipient._.Address.mac[3] = 0xFF;
// NC_Info[0].Recipient_List[0].Recipient._.Address.mac[4] = 0xBA;
// NC_Info[0].Recipient_List[0].Recipient._.Address.mac[5] = 0xC0;
// NC_Info[0].Recipient_List[0].Recipient._.Address.mac_len = 6;
// NC_Info[0].Recipient_List[0].ProcessIdentifier = 112233;
// NC_Info[0].Recipient_List[0].ConfirmedNotify = true;
// NC_Info[0].Recipient_List[0].Transitions =
// TRANSITION_TO_OFFNORMAL_MASKED | TRANSITION_TO_NORMAL_MASKED;
/* NC_Info[0].Ack_Required = TRANSITION_TO_NORMAL_MASKED;
*/
/* NC_Info[0].Priority[0] = 248;
*/
/* NC_Info[0].Priority[1] = 192;
*/
/* NC_Info[0].Priority[2] = 200;
*/
/* NC_Info[0].Recipient_List[0].ValidDays = 0x1F; /* from monday to friday */
*/
/* NC_Info[0].Recipient_List[0].FromTime.hour = 6;
*/
/* NC_Info[0].Recipient_List[0].FromTime.min = 15;
*/
/* NC_Info[0].Recipient_List[0].FromTime.sec = 10;
*/
/* NC_Info[0].Recipient_List[0].FromTime.hundredths = 0;
*/
/* NC_Info[0].Recipient_List[0].ToTime.hour = 23;
*/
/* NC_Info[0].Recipient_List[0].ToTime.min = 48;
*/
/* NC_Info[0].Recipient_List[0].ToTime.sec = 59;
*/
/* NC_Info[0].Recipient_List[0].ToTime.hundredths = 0;
*/
/* NC_Info[0].Recipient_List[0].Recipient.RecipientType = RECIPIENT_TYPE_ADDRESS;
*/
@@ -422,7 +422,7 @@ bool Notification_Class_Write_Property(
/* only array properties can have array options */
if ((apdu_len >= 0) && (rpdata->object_property != PROP_PRIORITY) &&
(rpdata->array_index != BACNET_ARRAY_ALL))
// decode the some of the request
{
rpdata->error_class = ERROR_CLASS_PROPERTY;
rpdata->error_code = ERROR_CODE_PROPERTY_IS_NOT_AN_ARRAY;
apdu_len = BACNET_STATUS_ERROR;
@@ -439,7 +439,7 @@ bool Notification_Class_Write_Property(
NOTIFICATION_CLASS_INFO TmpNotify;
BACNET_APPLICATION_DATA_VALUE value;
bool status = false;
/// FIXME: wite all array
int iOffset = 0;
uint8_t idx = 0;
int len = 0;
@@ -693,8 +693,8 @@ bool Notification_Class_Write_Property(
return false;
}
iOffset += len;
///src = CurrentNotify->Recipient_List[idx].Recipient._.Address;
///address_bind_request(BACNET_MAX_INSTANCE, &max_apdu, &src);
/* Increasing element of list */
if (++idx >= NC_MAX_RECIPIENTS) {
wp_data->error_class = ERROR_CLASS_RESOURCES;
wp_data->error_code = ERROR_CODE_NO_SPACE_TO_WRITE_PROPERTY;
@@ -810,7 +810,7 @@ void Notification_Class_common_reporting_function(
/* Initiating Device Identifier */
event_data->initiatingObjectIdentifier.type = OBJECT_DEVICE;
default: // shouldn't happen
event_data->initiatingObjectIdentifier.instance =
Device_Object_Instance_Number();
/* Priority and AckRequired*/
+1 -1
View File
@@ -121,4 +121,4 @@ typedef struct Notification_Class_info {
Notification_Class_Write_Property, Notification_Class_Property_Lists, \
NULL, NULL, NULL
#endif // NC_H
#endif /* NC_H
+7 -7
View File
@@ -44,7 +44,7 @@ int wpm_decode_object_id(uint8_t * apdu, uint16_t apdu_len,
if((apdu )&& (apdu_len))
{
// Context tag 0 - Object ID
/* Context tag 0 - Object ID
*/
len += decode_tag_number_and_value(&apdu[len], &tag_number, &len_value);
if(tag_number == 0)
@@ -78,7 +78,7 @@ int wpm_decode_object_property(uint8_t * apdu,
wp_data->array_index = BACNET_ARRAY_ALL;
wp_data->priority = BACNET_NO_PRIORITY;
wp_data->application_data_len = 0;
// tag 0 - Property Identifier
/* tag 0 - Property Identifier
*/
len += decode_tag_number_and_value(&apdu[len], &tag_number, &len_value);
@@ -88,7 +88,7 @@ int wpm_decode_object_property(uint8_t * apdu,
wp_data->object_property = ulVal;
}
else
// tag 1 - Property Array Index - optional
return -1;
/* tag 1 - Property Array Index - optional
*/
@@ -97,7 +97,7 @@ int wpm_decode_object_property(uint8_t * apdu,
{
len += decode_unsigned(&apdu[len],len_value, &ulVal);
wp_data->array_index = ulVal;
// tag 2 - Property Value
len += decode_tag_number_and_value(&apdu[len], &tag_number, &len_value);
}
/* tag 2 - Property Value
@@ -105,20 +105,20 @@ int wpm_decode_object_property(uint8_t * apdu,
if((tag_number == 2) && (decode_is_opening_tag(&apdu[len-1])))
{
len--;
// copy application data
wp_data->application_data_len = bacapp_data_len(&apdu[len],
apdu_len - len, wp_data->object_property);
len++;
/* copy application data
*/
// closing tag 2
for(i = 0; i < wp_data->application_data_len; i++)
wp_data->application_data[i] = apdu[len+i];
len += wp_data->application_data_len;
len += decode_tag_number_and_value(&apdu[len], &tag_number, &len_value);
/* closing tag 2
*/
// tag 3 - Priority - optional
if((tag_number != 2) &&(decode_is_closing_tag(&apdu[len-1])))
return -1;
}
else