Hi, guys,
I am porting the mbedTLS library to a 32-bit MCU platform. My particular project involves a cellular socket modem and I am not sure exactly how to write the bio callbacks. The TCP/IP stack is inside the cellular module. All I have to do is send TCP payload to an IP address with a port number. On the receiving side, I get source IP, source port and TCP payload.
Here are my questions:
1. What is the difference between callback type mbedtls_ssl_recv_t and mbedtls_ssl_recv_timeout_t? Do I need both? If the library can perform timeout, how do I provide "tick" callback to the library?
2. My TCP data is sent/received via a 115200-bps serial channel. What do I need to do in the send callback function when the serial transmit is not ready, e.g., still busy sending the previous frame? Can I keep returning MBEDTLS_ERR_SSL_WANT_WRITE until the buffer is free?
Thanks!
Hi, guys, I am porting the mbedTLS library to a 32-bit MCU platform. My particular project involves a cellular socket modem and I am not sure exactly how to write the bio callbacks. The TCP/IP stack is inside the cellular module. All I have to do is send TCP payload to an IP address with a port number. On the receiving side, I get source IP, source port and TCP payload.
Here are my questions:
1. What is the difference between callback type mbedtls_ssl_recv_t and mbedtls_ssl_recv_timeout_t? Do I need both? If the library can perform timeout, how do I provide "tick" callback to the library?
2. My TCP data is sent/received via a 115200-bps serial channel. What do I need to do in the send callback function when the serial transmit is not ready, e.g., still busy sending the previous frame? Can I keep returning MBEDTLS_ERR_SSL_WANT_WRITE until the buffer is free?
Thanks!