Esempio n. 1
0
/*
 * ----------------------------------------------------------------------------
 * Function Name: GUDPBC_Init()
 * Purpose: Initialization
 * Params:
 * Returns:
 * Note:
 * ----------------------------------------------------------------------------
 */
void GUDPBC_Init(U16_T localPort)
{
	U8_T i;

	for (i = 0; i < GUDPBC_MAX_CONNS; i++)
	{
		gudpbc_Conns[i].State = GUDPBC_STATE_FREE;
		gudpbc_Conns[i].UdpSocket = 0;
	}

	gudpbc_InterAppId = TCPIP_Bind(GUDPBC_NewConn, GUDPBC_Event, GUDPBC_Receive);
	/* unicast packet */
	TCPIP_UdpListen(localPort, gudpbc_InterAppId);
	
} /* End of GUDPBC_Init() */
Esempio n. 2
0
//extern	U8_T xdata IP_Addr[4];
void bip_Init(U16_T localPort)
{
	U8_T	i;

	for (i = 0; i < BIP_MAX_CONNS; i++)
		bip_Conns[i].State = BIP_STATE_FREE;

	bip_InterAppId = TCPIP_Bind(bip_NewConn, bip_Event, BIP_Receive_Handler);
	
//	bip_set_addr(((U32_T)IP_Addr[0] << 24) + ((U32_T)IP_Addr[1] << 16) + (U16_T)(IP_Addr[2] << 8) + IP_Addr[3]);
	/* unicast packet */
	TCPIP_UdpListen(localPort, bip_InterAppId);

	vSemaphoreCreateBinary(sembip);
} /* End of GUDPBC_Init() */