Combined the interface set into the datalink_init for all the datalink layers. Changed all the demo programs to use datalink_init instead of specific datalink functions.
This commit is contained in:
@@ -39,12 +39,6 @@
|
||||
|
||||
static int interface = SOCKET_ERROR; /* SOCKET_ERROR means no open interface */
|
||||
|
||||
void bip_set_interface(char *ifname)
|
||||
{
|
||||
/*dummy function - to make the demos compile easier */
|
||||
(void) ifname;
|
||||
}
|
||||
|
||||
/*-----------------------------------*/
|
||||
static void Error(const char *Msg)
|
||||
{
|
||||
@@ -244,7 +238,7 @@ static void set_broadcast_address(uint32_t net_address)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool bip_init(void)
|
||||
bool bip_init(char *ifname)
|
||||
{
|
||||
int rv = 0; /* return from socket lib calls */
|
||||
struct sockaddr_in sin = { -1 };
|
||||
@@ -252,6 +246,8 @@ bool bip_init(void)
|
||||
int sock_fd = -1;
|
||||
struct in_addr my_addr;
|
||||
|
||||
(void)ifname;
|
||||
|
||||
NetInitialize();
|
||||
|
||||
RTIP_To_Network_Address(TargetIP, &my_addr);
|
||||
|
||||
@@ -42,8 +42,9 @@ static uint8_t PDU_Buffer[MAX_MPDU];
|
||||
/* local MS/TP port data */
|
||||
static volatile struct mstp_port_struct_t MSTP_Port;
|
||||
|
||||
void dlmstp_init(void)
|
||||
{
|
||||
void dlmstp_init(char *ifname)
|
||||
{
|
||||
(void)ifname;
|
||||
/* initialize buffer */
|
||||
Receive_Buffer.ready = false;
|
||||
Receive_Buffer.pdu_len = 0;
|
||||
|
||||
@@ -140,18 +140,10 @@ int main(int argc, char *argv[])
|
||||
Init_Service_Handlers();
|
||||
RTOS_Initialize();
|
||||
/* init the physical layer */
|
||||
#ifdef BACDL_BIP
|
||||
if (!bip_init())
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef BACDL_ETHERNET
|
||||
if (!ethernet_init(NULL))
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef BACDL_MSTP
|
||||
dlmstp_set_my_address(0x05);
|
||||
dlmstp_init();
|
||||
#endif
|
||||
datalink_init(NULL);
|
||||
iam_send(&Handler_Transmit_Buffer[0]);
|
||||
/* loop forever */
|
||||
for (;;) {
|
||||
|
||||
Reference in New Issue
Block a user