Example #1
0
/* Processing an incoming message on the Event port. */
static void eventRecv(void *arg, struct udp_pcb *pcb, struct pbuf *p,
                      struct ip_addr *addr, u16_t port)
{
    NetPath *netPath = (NetPath *)arg;

    /* prevent warnings about unused arguments */
    (void)pcb;
    (void)addr;
    (void)port;

    /* Place the incoming message on the Event Port QUEUE. */
    if(!netQPut(&netPath->eventQ, p))
        PERROR("Event Queue Full!\n");
}
Example #2
0
/**
  * @brief  Processing an incoming message on the General port.
  * @param  arg the user argument
  * @param  pcb the tcp_pcb that has received the data
  * @param  p the packet buffer
  * @param  addr the addres of sender
  * @param  port the port number of sender
  * @retval None
  */
static void netRecvGeneralCallback(void *arg, struct udp_pcb *pcb, struct pbuf *p,
                                   struct ip_addr *addr, u16_t port)
{
    NetPath *netPath = (NetPath *)arg;

    /* Place the incoming message on the Event Port QUEUE. */

    if (!netQPut(&netPath->generalQ, p))
    {
        pbuf_free(p);
        p = NULL;
        ERROR("netRecvGeneralCallback: queue full\n");
        return;
    }
}
Example #3
0
/* Process an incoming message on the General port. */
static void netRecvGeneralCallback(void *arg, struct udp_pcb *pcb, struct pbuf *p,
																	 struct ip_addr *addr, u16_t port)
{
	NetPath *netPath = (NetPath *) arg;

	/* Place the incoming message on the Event Port QUEUE. */
	if (!netQPut(&netPath->generalQ, p))
	{
		pbuf_free(p);
		ERROR("netRecvGeneralCallback: queue full\n");
		return;
	}

	/* Alert the PTP thread there is now something to do. */
	ptpd_alert();
}