Indented according to standard indent rules for this project.

This commit is contained in:
skarg
2009-04-18 20:50:04 +00:00
parent b3fab21603
commit b85c4355d0
43 changed files with 501 additions and 502 deletions
+5 -9
View File
@@ -267,18 +267,14 @@ int main(
printf("mstsnap [serial] [baud] [network]\r\n"
"Captures MS/TP packets from a serial interface\r\n"
"and sends them to a network interface using SNAP \r\n"
"protocol packets (mimics Cimetrics U+4 packet).\r\n"
"\r\n"
"Command line options:\r\n"
"[serial] - serial interface.\r\n"
"protocol packets (mimics Cimetrics U+4 packet).\r\n" "\r\n"
"Command line options:\r\n" "[serial] - serial interface.\r\n"
" defaults to /dev/ttyUSB0.\r\n"
"[baud] - baud rate. 9600, 19200, 38400, 57600, 115200\r\n"
" defaults to 38400.\r\n"
"[network] - network interface.\r\n"
" defaults to eth0.\r\n"
"");
" defaults to 38400.\r\n" "[network] - network interface.\r\n"
" defaults to eth0.\r\n" "");
return 0;
}
}
/* initialize our interface */
if (argc > 1) {
RS485_Set_Interface(argv[1]);
+1 -1
View File
@@ -246,7 +246,7 @@ void RS485_Initialize(
Open device for reading and writing.
Blocking mode - more CPU effecient
*/
RS485_Handle = open(RS485_Port_Name, O_RDWR | O_NOCTTY /*| O_NDELAY*/);
RS485_Handle = open(RS485_Port_Name, O_RDWR | O_NOCTTY /*| O_NDELAY */ );
if (RS485_Handle < 0) {
perror(RS485_Port_Name);
exit(-1);
+5 -4
View File
@@ -123,14 +123,15 @@ void apdu_handler(
if (service_choice == SERVICE_CONFIRMED_READ_PROPERTY) {
handler_read_property(service_request, service_request_len,
src, &service_data);
}
else if (service_choice == SERVICE_CONFIRMED_WRITE_PROPERTY) {
} else if (service_choice == SERVICE_CONFIRMED_WRITE_PROPERTY) {
handler_write_property(service_request,
service_request_len, src, &service_data);
} else if (service_choice == SERVICE_CONFIRMED_REINITIALIZE_DEVICE) {
} else if (service_choice ==
SERVICE_CONFIRMED_REINITIALIZE_DEVICE) {
handler_reinitialize_device(service_request,
service_request_len, src, &service_data);
} else if (service_choice == SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL) {
} else if (service_choice ==
SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL) {
handler_device_communication_control(service_request,
service_request_len, src, &service_data);
} else {
+4 -4
View File
@@ -260,10 +260,10 @@ void main(
Hardware_Initialize();
Initialize_Variables();
/* initialize BACnet Data Link Layer */
dlmstp_set_my_address(42);
dlmstp_set_max_info_frames(1);
dlmstp_set_max_master(127);
RS485_Set_Baud_Rate(38400);
dlmstp_set_my_address(42);
dlmstp_set_max_info_frames(1);
dlmstp_set_max_master(127);
RS485_Set_Baud_Rate(38400);
dlmstp_init();
/* Handle anything that needs to be done on powerup */
/* Greet the BACnet world! */
+1 -1
View File
@@ -89,7 +89,7 @@ int dlmstp_send_pdu(
return -2;
}
/* header len */
mtu_len = MAX_HEADER - 2 /* data crc */;
mtu_len = MAX_HEADER - 2 /* data crc */ ;
if ((MAX_HEADER + pdu_len) > MAX_MPDU) {
#if PRINT_ENABLED
fprintf(stderr, "mstp: PDU is too big to send!\n");