📄 fdl_rb.h
字号:
UBYTE length;
};
struct application_block
{
UBYTE opcode; /* class of communication */
UBYTE subsystem; /* number of source-task (only necessary for MTK-user !!!!!) */
UWORD id; /* identification of FDL-USER */
struct service service; /* identification of service */
struct remote_address loc_add; /* only for network-connection !!! */
UBYTE ssap; /* source-service-access-point */
UBYTE dsap; /* destination-service-access-point */
struct remote_address rem_add; /* address of the remote-station */
#ifdef M_DOS
enum service_class serv_class; /* priority of service */
#else
short serv_class; /* priority of service */
#endif
struct link_service_data_unit receive_l_sdu; /* address and length of received netto-data, exception: */
UBYTE reserved1; /* (reserved for FDL !!!!!!!!!!) */
UBYTE reserved2; /* (reserved for FDL !!!!!!!!!!) */
struct link_service_data_unit send_l_sdu; /* address and length of send-netto-data, exception: */
/* 1. csrd : length means number of POLL-elements */
/* 2. await_indication : concatenation of application-blocks and */
/* withdraw_indication : number of application-blocks */
#ifdef M_DOS
enum link_status l_status; /* link-status of service or update_state for srd-indication */
#else
short l_status; /* link-status of service or update_state for srd-indication */
#endif
UBYTE reserved3[4]; /* for concatenated lists (reserved for FDL !!!!!!!!!!) */
};
typedef struct
{
UWORD reserved[2];
UBYTE length;
UWORD user;
UBYTE rb_type;
UBYTE priority;
UBYTE reserved_1;
UWORD reserved_2;
UBYTE subsystem;
UBYTE opcode;
UWORD response;
UWORD fill_length_1;
UBYTE reserved_3;
UWORD seg_length_1;
UWORD offset_1;
UWORD reserved_4;
UWORD fill_length_2;
UBYTE reserved_5;
UWORD seg_length_2;
UWORD offset_2;
UWORD reserved_6;
} rb2_header_type;
typedef struct
{
rb2_header_type rb2_header;
struct application_block application_block;
UBYTE reserved[12];
UBYTE reference[2];
UBYTE user_data_1[260];
UBYTE user_data_2[260];
} fdl_rb;
typedef fdl_rb flc_rb;
/* Moegliche Strukturen der Datenpuffer */
struct user_poll_element
{
UBYTE dsap; /* destination-service-access-point */
struct remote_address rem_add; /* address of the remote-station */
#ifdef M_DOS
enum service_class serv_class; /* priority of send-telegram */
#else
short serv_class; /* priority of send-telegram */
#endif
struct link_service_data_unit receive_l_sdu; /* request: length means buffer-length in byte */
/* confirm: length means length of received netto-data */
struct link_service_data_unit send_l_sdu; /* address and length of send-netto-data */
UBYTE reserved; /* reserved for FDL !!!!! */
#ifdef M_DOS
enum link_status l_status; /* link-status of poll-element-service */
enum poll_element_entry entry; /* locks or unlocks a poll-element */
#else
short l_status; /* link-status of poll-element-service */
short entry; /* locks or unlocks a poll-element */
#endif
UBYTE reserved_2; /* reserved for FDL !!!!! */
};
struct ident
{
UBYTE reserved_header[8]; /* reserved for FDL !!!!! */
#ifdef M_DOS
UBYTE ident[202];
#else
UBYTE ident_info[202];
#endif
UBYTE response_telegram_length; /* reserved for FDL !!!!! */
};
struct bus_parameter_block
{
UBYTE hsa; /* highest station-address */
/* range of values: 2 ... 126 */
UBYTE ts; /* FDL-address of this station */
/* range of values: 0 ... 126 */
#ifdef M_DOS
enum station_type station_type; /* active, passive */
enum baud_rate baud_rate; /* transmission rate */
enum redundancy medium_red; /* availability of redundant media */
#else
short station_type; /* active, passive */
short baud_rate; /* transmission rate */
short medium_red; /* availability of redundant media */
#endif
UWORD retry_ctr; /* retry-number of requestor, if no reaction of responder */
/* range of values: 1 ... 8 */
UBYTE default_sap; /* Default SAP if no address-extension is used */
/* range of values: 2 ... 62 */
UBYTE network_connection_sap;/* number of sap for network-connection (only for network-connections) */
/* range of values: 2 ... 62 */
UWORD tsl; /* SLOT-time: */
/* range of values: 2 exp 0 ... (2 exp 16) - 1 BIT-times */
UWORD tqui; /* Transmitter-Fall-Time / Repeater-Switch-Time: */
/* range of values: 0 ... (2 exp 8) - 1 BIT-times */
UWORD tset; /* setup-time */
/* range of values: 0 ... (2 exp 8) - 1 BIT-times */
UWORD min_tsdr; /* smallest STATION-DELAY-time: */
/* range of values: 2 exp 0 ... (2 exp 16) - 1 BIT-times */
UWORD max_tsdr; /* largest STATION-DELAY-time: */
/* range of values: 2 exp 0 ... (2 exp 16) - 1 BIT-times */
ULONG ttr; /* TARGET-ROTATION-time: */
/* range of values: 2 exp 0 ... (2 exp 24) - 1 BIT-times */
UBYTE g; /* GAP-UPDATE-factor: in multiples of ttr */
/* range_of_values: 1 ... 100 */
#ifdef M_DOS
flc_boolean in_ring_desired; /* request entrance into the token-ring */
enum physical_layer physical_layer; /* RS485, modem */
#else
short in_ring_desired; /* request entrance into the token-ring */
short physical_layer; /* RS485, modem */
#endif
struct ident ident; /* vendor-name, controller_type, version of hardware and software */
};
struct fdl_sap
{
UWORD user_id; /* identification for user */
UBYTE max_l_sdu_length; /* maximal length of netto_data for this sap */
UBYTE access_sap; /* reserved destination_sap */
UBYTE access_station; /* reserved destination_address */
UBYTE access_segment; /* reserved destination_segment */
UBYTE sda; /* ... .sda = "ROLE"; sda unused by service "rsap_activate" */
UBYTE sdn; /* look sda; sdn unused by service "rsap_activate" */
UBYTE srd; /* look sda; */
UBYTE csrd; /* if you want to activate csrd for this SAP, type: ... .csrd = "ROLE"; */
/* (only INITIATOR or SERVICE_NOT_ACTIVATED possible) */
/* csrd unused by service "rsap_activate" */
void * rup_l_sdu_ptr_low; /* reserved for "sap_deactivate"; USER gets rup-buffer returned */
void * rup_l_sdu_ptr_high; /* reserved for "sap_deactivate"; USER gets rup-buffer returned */
UBYTE reserved[22]; /* reserved for FDL !!!!! */
};
/**********************************************************************/
/**************** fdl_event (returned by fma_indication) ************/
/**************** await_indication (for DSAP = EVENT_SAP)************/
/**********************************************************************/
struct event_ctr
{
UWORD threshold; /* if counter achieves threshold, a fma_indication is initiated */
UWORD counter;
};
struct event_indication
{
struct event_ctr time_out;
struct event_ctr not_syn;
struct event_ctr uart_error;
struct event_ctr out_of_ring;
struct event_ctr sdn_not_indicated;
struct event_ctr duplicate_address;
struct event_ctr hardware_error;
struct event_ctr mac_error;
};
/**********************************************************************/
/**************** fdl_read_statistic_ctr ***************************/
/**********************************************************************/
/* services fdl_read_statistic_ctr and fdl_read_las_statistic_ctr */
/* are NOT SUPPORTED!!! */
struct statistic_ctr_list
{
/* error-counter */
UWORD invalid_start_delimiter_ctr;
UWORD invalid_fcb_fcv_ctr;
UWORD invalid_token_ctr;
UWORD collision_ctr;
UWORD wrong_fcs_or_ed_ctr;
UWORD frame_error_ctr;
UWORD char_error_ctr;
UWORD retry_ctr;
/* reference-counter */
ULONG start_delimiter_ctr;
ULONG stop_receive_ctr;
ULONG send_confirmed_ctr;
ULONG send_sdn_ctr;
};
/*
* Prototypings
* ************
*/
/* old prototypes for MSDOS and Windows 3.x */
#ifdef M_DOS
#ifndef MM
#define MM far
#endif
int MM ihi_get_dev_list( short MM *, unsigned short MM *, char MM * );
int MM ihi_open( short );
int MM ihi_open_dev( unsigned short, char MM * );
int MM ihi_write( int, void MM * );
int MM ihi_read( int, short, void MM * MM * );
int MM ihi_close( int );
#ifdef M_WINDOWS
#define WM_SINEC 500
int MM SetSinecHWnd( int, HWND );
int MM SetSinecHWndMsg( int, HWND, unsigned int );
#endif
#else /* M_DOS */
/* prototypes for Win32 */
#ifdef __cplusplus
extern "C"
{
#endif
INT WINAPI SCP_open( CHAR * );
INT WINAPI SCP_close( INT );
INT WINAPI SCP_send( INT, USHORT, char * );
INT WINAPI SCP_receive( INT, SHORT, SHORT *, SHORT, CHAR * );
INT WINAPI SetSinecHWndMsg( INT, HANDLE, ULONG );
INT WINAPI SetSinecHWnd( INT, HANDLE );
INT WINAPI SCP_get_errno( VOID );
#ifdef __cplusplus
}
#endif
#define WM_SINEC (WM_USER+500)
#endif /* M_DOS */
#define LENGTH 80
#define RB_TYPE 2
#pragma pack()
#endif // _FDL_RB_H_INCD_
/****************************************************************************/
/* */
/* Copyright (C) Siemens AG 1991, 1999. All Rights Reserved */
/* */
/****************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -