woohoo..I am useful. HA!
okay..when you say at the top... do you mean at the top of my cpp file... like above main and all that?
or in the top of my ota_task before I set anything else up...
Cuz, i added this to the top of the file:
Code: Select all
esp_tls_cfg_t cfg = { .cacert_pem_bytes = strlen(aws_root_ca_pem) };
and added this in the ota_task where I am about to use it:
Code: Select all
cfg.cacert_pem_buf = (const unsigned char *)aws_root_ca_pem;
// cfg.cacert_pem_bytes = strlen(aws_root_ca_pem)+1;
cfg.non_block = true;
static const char *proto = "h2";
static const char *protos[] = { proto, NULL };
cfg.alpn_protos = protos;
but i get the warnings that equal errors about non-trivial designated initializers....
src\main.cpp:261:67: sorry, unimplemented: non-trivial designated initializers not supported
esp_tls_cfg_t cfg = { .cacert_pem_bytes = strlen(aws_root_ca_pem) };
^
src\main.cpp:261:67: warning: missing initializer for member 'esp_tls_cfg::cacert_pem_buf' [-Wmissing-field-initializers]
src\main.cpp:261:67: warning: missing initializer for member 'esp_tls_cfg::cacert_pem_bytes' [-Wmissing-field-initializers]
src\main.cpp:261:67: warning: missing initializer for member 'esp_tls_cfg::non_block' [-Wmissing-field-initializers]