ran the indent program on the source files to make them consistent.
This commit is contained in:
+48
-58
@@ -42,81 +42,72 @@
|
||||
/* note: TSM functionality is optional - only needed if we are
|
||||
doing client requests */
|
||||
#if TSM_ENABLED
|
||||
typedef enum
|
||||
{
|
||||
TSM_STATE_IDLE,
|
||||
TSM_STATE_AWAIT_CONFIRMATION,
|
||||
TSM_STATE_AWAIT_RESPONSE,
|
||||
TSM_STATE_SEGMENTED_REQUEST,
|
||||
TSM_STATE_SEGMENTED_CONFIRMATION
|
||||
typedef enum {
|
||||
TSM_STATE_IDLE,
|
||||
TSM_STATE_AWAIT_CONFIRMATION,
|
||||
TSM_STATE_AWAIT_RESPONSE,
|
||||
TSM_STATE_SEGMENTED_REQUEST,
|
||||
TSM_STATE_SEGMENTED_CONFIRMATION
|
||||
} BACNET_TSM_STATE;
|
||||
|
||||
// 5.4.1 Variables And Parameters
|
||||
// The following variables are defined for each instance of
|
||||
// Transaction State Machine:
|
||||
typedef struct BACnet_TSM_Data
|
||||
{
|
||||
// used to count APDU retries
|
||||
uint8_t RetryCount;
|
||||
// used to count segment retries
|
||||
//uint8_t SegmentRetryCount;
|
||||
// used to control APDU retries and the acceptance of server replies
|
||||
//bool SentAllSegments;
|
||||
// stores the sequence number of the last segment received in order
|
||||
//uint8_t LastSequenceNumber;
|
||||
// stores the sequence number of the first segment of
|
||||
// a sequence of segments that fill a window
|
||||
//uint8_t InitialSequenceNumber;
|
||||
// stores the current window size
|
||||
//uint8_t ActualWindowSize;
|
||||
// stores the window size proposed by the segment sender
|
||||
//uint8_t ProposedWindowSize;
|
||||
// used to perform timeout on PDU segments
|
||||
//uint8_t SegmentTimer;
|
||||
// used to perform timeout on Confirmed Requests
|
||||
// in milliseconds
|
||||
uint16_t RequestTimer;
|
||||
// unique id
|
||||
uint8_t InvokeID;
|
||||
// state that the TSM is in
|
||||
BACNET_TSM_STATE state;
|
||||
// the address we sent it to
|
||||
BACNET_ADDRESS dest;
|
||||
// copy of the PDU, should we need to send it again
|
||||
uint8_t pdu[MAX_PDU];
|
||||
unsigned pdu_len;
|
||||
typedef struct BACnet_TSM_Data {
|
||||
// used to count APDU retries
|
||||
uint8_t RetryCount;
|
||||
// used to count segment retries
|
||||
//uint8_t SegmentRetryCount;
|
||||
// used to control APDU retries and the acceptance of server replies
|
||||
//bool SentAllSegments;
|
||||
// stores the sequence number of the last segment received in order
|
||||
//uint8_t LastSequenceNumber;
|
||||
// stores the sequence number of the first segment of
|
||||
// a sequence of segments that fill a window
|
||||
//uint8_t InitialSequenceNumber;
|
||||
// stores the current window size
|
||||
//uint8_t ActualWindowSize;
|
||||
// stores the window size proposed by the segment sender
|
||||
//uint8_t ProposedWindowSize;
|
||||
// used to perform timeout on PDU segments
|
||||
//uint8_t SegmentTimer;
|
||||
// used to perform timeout on Confirmed Requests
|
||||
// in milliseconds
|
||||
uint16_t RequestTimer;
|
||||
// unique id
|
||||
uint8_t InvokeID;
|
||||
// state that the TSM is in
|
||||
BACNET_TSM_STATE state;
|
||||
// the address we sent it to
|
||||
BACNET_ADDRESS dest;
|
||||
// copy of the PDU, should we need to send it again
|
||||
uint8_t pdu[MAX_PDU];
|
||||
unsigned pdu_len;
|
||||
} BACNET_TSM_DATA;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
bool tsm_transaction_available(void);
|
||||
uint8_t tsm_transaction_idle_count(void);
|
||||
void tsm_timer_milliseconds(uint16_t milliseconds);
|
||||
bool tsm_transaction_available(void);
|
||||
uint8_t tsm_transaction_idle_count(void);
|
||||
void tsm_timer_milliseconds(uint16_t milliseconds);
|
||||
// free the invoke ID when the reply comes back
|
||||
void tsm_free_invoke_id(uint8_t invokeID);
|
||||
void tsm_free_invoke_id(uint8_t invokeID);
|
||||
// use these in tandem
|
||||
uint8_t tsm_next_free_invokeID(void);
|
||||
uint8_t tsm_next_free_invokeID(void);
|
||||
// returns the same invoke ID that was given
|
||||
void tsm_set_confirmed_unsegmented_transaction(
|
||||
uint8_t invokeID,
|
||||
BACNET_ADDRESS *dest,
|
||||
uint8_t *pdu,
|
||||
uint16_t pdu_len);
|
||||
void tsm_set_confirmed_unsegmented_transaction(uint8_t invokeID,
|
||||
BACNET_ADDRESS * dest, uint8_t * pdu, uint16_t pdu_len);
|
||||
// returns true if transaction is found
|
||||
bool tsm_get_transaction_pdu(
|
||||
uint8_t invokeID,
|
||||
BACNET_ADDRESS *dest,
|
||||
uint8_t *pdu,
|
||||
uint16_t *pdu_len);
|
||||
bool tsm_get_transaction_pdu(uint8_t invokeID,
|
||||
BACNET_ADDRESS * dest, uint8_t * pdu, uint16_t * pdu_len);
|
||||
|
||||
bool tsm_invoke_id_free(uint8_t invokeID);
|
||||
bool tsm_invoke_id_free(uint8_t invokeID);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __cplusplus */
|
||||
/* define out any functions necessary for compile */
|
||||
#else
|
||||
|
||||
@@ -125,4 +116,3 @@ bool tsm_invoke_id_free(uint8_t invokeID);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user