Espressif Systems ESP8266EX Programming Manual page 37

Esp8266 rtos sdk
Hide thumbs Also See for ESP8266EX:
Table of Contents

Advertisement

!
const char *common_name = ssl_get_cert_dn(ssl,SSL_X509_CERT_COMMON_NAME);
if (common_name){
printf("Common Name:\t\t\t%s\n", common_name);
}
display_session_id(ssl);
display_cipher(ssl);
quiet = true;
os_printf("client handshake ok! heapsize %d\n",system_get_free_heap_size());
x509_free(ssl->x509_ctx);
ssl->x509_ctx=NULL;
os_printf("certificate free ok! heapsize %d\n",system_get_free_heap_size());
10.Transmit SSL data.
uint8 buf[512];
bzero(buf, sizeof(buf));
sprintf(buf,httphead,"/", "iot.espressif.cn",port);
os_printf("%s\n", buf);
if(ssl_write(ssl, buf, strlen(buf)+1) < 0) {
ssl_free(ssl);
ssl_ctx_free(ssl_ctx);
close(client_fd);
vTaskDelay(1000 / portTICK_RATE_MS);
os_printf("send fail\n");
continue;
}
11.Receive SSL data.
while((recbytes = ssl_read(ssl, &read_buf)) >= 0) {
if(recbytes == 0){
vTaskDelay(500 / portTICK_RATE_MS);
continue;
}
os_printf("%s\n", read_buf);
}
free(read_buf);
if(recbytes < 0) {
os_printf("ERROR:read data fail! recbytes %d\r\n",recbytes);
ssl_free(ssl);
ssl_ctx_free(ssl_ctx);
Espressif
33 37
!
/!
3. Sample Codes
2017.05

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP8266EX and is the answer not in the manual?

Questions and answers

Table of Contents