Topic: [SOLVED] Using custom send- & receive callback
Hi,
First of all, we have an Eval board that will use an ESP8266 to communicate with the internet. The ESP8266 can only take commands via serial interface and handles all the communication with the internet, from the TCP/IP-layer.
We want to skip the "socket"-communication in wolfSSL and create our own custom send- and receive callbacks that will include serial communication with the ESP8266.
We have read the wolfSSL manual and porting guide and done the following:
- Created (or more like copying EmbedSend and EmbedRecv) our own send- and receive functions, MyEmbedSend and MyEmbedRecv.
- Registered MyEmbedRecv and MyEmbedSend as CallbackIORecv respectively CallbackIOSend in the CTX object.
We trying to create custom send- and receive callbacks but get confused by how it should be done. In the wolfSSL manual there is an explanation for the functions wolfSSL_SetIOWriteCTX and wolfSSL_SetIOReadCTX:
"... If you’ve registered your own send callback you may want to set a specific context for the session. For example, if you’re using memory buffers the context may be a pointer to a structure describing where and how to access the memory buffers."
How should the structure look like if it were to describe where and how to access the memory buffers (or something similar)? It sounds like the structure needs to be formed in a certain way but no information regarding how that shall be done is given.
Can you help us? Maybe give us an example of how it can work or should be done in order to get our project going.