Indented.
This commit is contained in:
@@ -50,8 +50,10 @@ bool Who_Is_Request = true;
|
||||
/* buffers used for receiving */
|
||||
static uint8_t Rx_Buf[MAX_MPDU] = { 0 };
|
||||
|
||||
static void LocalIAmHandler(uint8_t * service_request,
|
||||
uint16_t service_len, BACNET_ADDRESS * src)
|
||||
static void LocalIAmHandler(
|
||||
uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS * src)
|
||||
{
|
||||
int len = 0;
|
||||
uint32_t device_id = 0;
|
||||
@@ -73,7 +75,8 @@ static void LocalIAmHandler(uint8_t * service_request,
|
||||
return;
|
||||
}
|
||||
|
||||
static void Read_Properties(void)
|
||||
static void Read_Properties(
|
||||
void)
|
||||
{
|
||||
uint32_t device_id = 0;
|
||||
bool status = false;
|
||||
@@ -154,13 +157,12 @@ static void Read_Properties(void)
|
||||
return;
|
||||
}
|
||||
|
||||
static void Init_Service_Handlers(void)
|
||||
static void Init_Service_Handlers(
|
||||
void)
|
||||
{
|
||||
/* we need to handle who-is to support dynamic device binding */
|
||||
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_IS,
|
||||
handler_who_is);
|
||||
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_I_AM,
|
||||
LocalIAmHandler);
|
||||
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_IS, handler_who_is);
|
||||
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_I_AM, LocalIAmHandler);
|
||||
|
||||
/* set the handler for all the services we don't implement */
|
||||
/* It is required to send the proper reject message... */
|
||||
@@ -181,7 +183,8 @@ static void Init_Service_Handlers(void)
|
||||
handler_atomic_read_file_ack);
|
||||
}
|
||||
|
||||
static void print_address_cache(void)
|
||||
static void print_address_cache(
|
||||
void)
|
||||
{
|
||||
unsigned i, j;
|
||||
BACNET_ADDRESS address;
|
||||
@@ -202,7 +205,8 @@ static void print_address_cache(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void print_tsm_stats(void)
|
||||
static void print_tsm_stats(
|
||||
void)
|
||||
{
|
||||
int idle = 0;
|
||||
int total = 0;
|
||||
@@ -212,7 +216,8 @@ static void print_tsm_stats(void)
|
||||
fprintf(stderr, "TSM: %d idle of %d transactions\n", idle, total);
|
||||
}
|
||||
|
||||
static void sig_handler(int signo)
|
||||
static void sig_handler(
|
||||
int signo)
|
||||
{
|
||||
datalink_cleanup();
|
||||
print_address_cache();
|
||||
@@ -221,12 +226,14 @@ static void sig_handler(int signo)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int main(
|
||||
int argc,
|
||||
char *argv[])
|
||||
{
|
||||
BACNET_ADDRESS src = { 0 }; /* address where message came from */
|
||||
uint16_t pdu_len = 0;
|
||||
unsigned timeout = 100; /* milliseconds */
|
||||
unsigned count = 0; /* milliseconds */
|
||||
unsigned count = 0; /* milliseconds */
|
||||
time_t start_time;
|
||||
time_t new_time = 0;
|
||||
|
||||
@@ -280,15 +287,15 @@ int main(int argc, char *argv[])
|
||||
/* some round robin task switching */
|
||||
count++;
|
||||
switch (count) {
|
||||
case 1:
|
||||
/* used for testing, but kind of noisy on the network */
|
||||
/*Read_Properties(); */
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
default:
|
||||
count = 0;
|
||||
break;
|
||||
case 1:
|
||||
/* used for testing, but kind of noisy on the network */
|
||||
/*Read_Properties(); */
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
default:
|
||||
count = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* blink LEDs, Turn on or off outputs, etc */
|
||||
|
||||
Reference in New Issue
Block a user