Changed all the C++ comments to C comments using comment.sh script.

This commit is contained in:
skarg
2006-02-19 01:32:09 +00:00
parent c80d26a894
commit dee63d45bc
76 changed files with 1856 additions and 1856 deletions
+23 -23
View File
@@ -38,20 +38,20 @@
#include "device.h"
#include "awf.h"
// Atomic Write File
/* Atomic Write File */
// encode service
/* encode service */
int awf_encode_apdu(uint8_t * apdu,
uint8_t invoke_id, BACNET_ATOMIC_WRITE_FILE_DATA * data)
{
int apdu_len = 0; // total length of the apdu, return value
int apdu_len = 0; /* total length of the apdu, return value */
if (apdu) {
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
apdu[1] =
encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted());
apdu[2] = invoke_id;
apdu[3] = SERVICE_CONFIRMED_ATOMIC_WRITE_FILE; // service choice
apdu[3] = SERVICE_CONFIRMED_ATOMIC_WRITE_FILE; /* service choice */
apdu_len = 4;
apdu_len += encode_tagged_object_id(&apdu[apdu_len],
data->object_type, data->object_instance);
@@ -82,7 +82,7 @@ int awf_encode_apdu(uint8_t * apdu,
return apdu_len;
}
// decode the service request only
/* decode the service request only */
int awf_decode_service_request(uint8_t * apdu,
unsigned apdu_len, BACNET_ATOMIC_WRITE_FILE_DATA * data)
{
@@ -90,9 +90,9 @@ int awf_decode_service_request(uint8_t * apdu,
int tag_len = 0;
uint8_t tag_number = 0;
uint32_t len_value_type = 0;
int type = 0; // for decoding
int type = 0; /* for decoding */
// check for value pointers
/* check for value pointers */
if (apdu_len && data) {
len =
decode_tag_number_and_value(&apdu[0], &tag_number,
@@ -103,9 +103,9 @@ int awf_decode_service_request(uint8_t * apdu,
data->object_type = type;
if (decode_is_opening_tag_number(&apdu[len], 0)) {
data->access = FILE_STREAM_ACCESS;
// a tag number of 2 is not extended so only one octet
/* a tag number of 2 is not extended so only one octet */
len++;
// fileStartPosition
/* fileStartPosition */
tag_len = decode_tag_number_and_value(&apdu[len],
&tag_number, &len_value_type);
len += tag_len;
@@ -113,7 +113,7 @@ int awf_decode_service_request(uint8_t * apdu,
return -1;
len += decode_signed(&apdu[len],
len_value_type, &data->type.stream.fileStartPosition);
// fileData
/* fileData */
tag_len = decode_tag_number_and_value(&apdu[len],
&tag_number, &len_value_type);
len += tag_len;
@@ -123,13 +123,13 @@ int awf_decode_service_request(uint8_t * apdu,
len_value_type, &data->fileData);
if (!decode_is_closing_tag_number(&apdu[len], 0))
return -1;
// a tag number is not extended so only one octet
/* a tag number is not extended so only one octet */
len++;
} else if (decode_is_opening_tag_number(&apdu[len], 1)) {
data->access = FILE_RECORD_ACCESS;
// a tag number is not extended so only one octet
/* a tag number is not extended so only one octet */
len++;
// fileStartRecord
/* fileStartRecord */
tag_len = decode_tag_number_and_value(&apdu[len],
&tag_number, &len_value_type);
len += tag_len;
@@ -137,7 +137,7 @@ int awf_decode_service_request(uint8_t * apdu,
return -1;
len += decode_signed(&apdu[len],
len_value_type, &data->type.record.fileStartRecord);
// returnedRecordCount
/* returnedRecordCount */
tag_len = decode_tag_number_and_value(&apdu[len],
&tag_number, &len_value_type);
len += tag_len;
@@ -145,7 +145,7 @@ int awf_decode_service_request(uint8_t * apdu,
return -1;
len += decode_unsigned(&apdu[len],
len_value_type, &data->type.record.returnedRecordCount);
// fileData
/* fileData */
tag_len = decode_tag_number_and_value(&apdu[len],
&tag_number, &len_value_type);
len += tag_len;
@@ -155,7 +155,7 @@ int awf_decode_service_request(uint8_t * apdu,
len_value_type, &data->fileData);
if (!decode_is_closing_tag_number(&apdu[len], 1))
return -1;
// a tag number is not extended so only one octet
/* a tag number is not extended so only one octet */
len++;
} else
return -1;
@@ -173,10 +173,10 @@ int awf_decode_apdu(uint8_t * apdu,
if (!apdu)
return -1;
// optional checking - most likely was already done prior to this call
/* optional checking - most likely was already done prior to this call */
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
return -1;
// apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted());
/* apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted()); */
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
if (apdu[3] != SERVICE_CONFIRMED_ATOMIC_WRITE_FILE)
return -1;
@@ -193,12 +193,12 @@ int awf_decode_apdu(uint8_t * apdu,
int awf_ack_encode_apdu(uint8_t * apdu,
uint8_t invoke_id, BACNET_ATOMIC_WRITE_FILE_DATA * data)
{
int apdu_len = 0; // total length of the apdu, return value
int apdu_len = 0; /* total length of the apdu, return value */
if (apdu) {
apdu[0] = PDU_TYPE_COMPLEX_ACK;
apdu[1] = invoke_id;
apdu[2] = SERVICE_CONFIRMED_ATOMIC_WRITE_FILE; // service choice
apdu[2] = SERVICE_CONFIRMED_ATOMIC_WRITE_FILE; /* service choice */
apdu_len = 3;
switch (data->access) {
case FILE_STREAM_ACCESS:
@@ -217,7 +217,7 @@ int awf_ack_encode_apdu(uint8_t * apdu,
return apdu_len;
}
// decode the service request only
/* decode the service request only */
int awf_ack_decode_service_request(uint8_t * apdu,
unsigned apdu_len, BACNET_ATOMIC_WRITE_FILE_DATA * data)
{
@@ -225,7 +225,7 @@ int awf_ack_decode_service_request(uint8_t * apdu,
uint8_t tag_number = 0;
uint32_t len_value_type = 0;
// check for value pointers
/* check for value pointers */
if (apdu_len && data) {
len =
decode_tag_number_and_value(&apdu[0], &tag_number,
@@ -254,7 +254,7 @@ int awf_ack_decode_apdu(uint8_t * apdu,
if (!apdu)
return -1;
// optional checking - most likely was already done prior to this call
/* optional checking - most likely was already done prior to this call */
if (apdu[0] != PDU_TYPE_COMPLEX_ACK)
return -1;
*invoke_id = apdu[1]; /* invoke id - filled in by net layer */