ENC28J60 Web Server

Again, I realy appreciate your reply

AndyL:
Basically the buffer is defined in the sketch and you are passing pointers to this buffer into the ip_arp_udp.c code. Due to memory limitations, the same buffer is used for both received and transmitted packets, but obviously not at the same time.

So ... (I hope you still have spare time to continue this "course").

In your Library, you wrap client_browse_url as :

void EtherShield::ES_client_browse_url(char *urlbuf, char *urlbuf_varpart, char *hoststr,

		void (*callback)(uint8_t,uint16_t)) {

	client_browse_url(urlbuf, urlbuf_varpart, hoststr, callback);

}

While in turn (in ip_arp_udp.c) .. client_browse_url call for 2 other function, via single call to client_tcp_req:

www_fd=client_tcp_req(&www_client_internal_result_callback,&www_client_internal_datafill_callback,80);

Kindly please cmiiw : www_client_internal_datafill_callback is the one that do buffer filling. and we can do it in sketch.

If So , while :

  1. Inside your library there is a wrapper for client_tcp_req as :
uint8_t EtherShield::ES_client_tcp_req(uint8_t (*result_callback)(uint8_t fd,uint8_t statuscode,uint16_t data_start_pos_in_buf, uint16_t len_of_data),uint16_t (*datafill_callback)(uint8_t fd),uint16_t port ) {

	return client_tcp_req( result_callback, datafill_callback, port );

}
  1. we Have (i.e) browserresult_callback() as our result_callback handler, and
  2. we have "buf" as our buffer,

Is it mean that we can call --> ES_client_tcp_req(&browserresult_callback, buf,80) ?

(Ah ... while waiting for your further enlightment, I'll try it my self. May God bless my lame brain)

Edit : This is my dirty try:

I'm pretty sure that the error is at the part I call --> es.ES_client_tcp_req
sincerely
-bino-