KMatle Expert Licensed User Longtime User Mar 17, 2019 #1 I'm working on how to use AES with an ESP32. Everything is fine except how to use/return strings (byte arrays/chars). There are some threads but I don't get it. Code: Code: Private enc() As Byte ' In Globals RunNative("InitAES",Null) ' Call Inline C Code: #if C #include <mbedtls/aes.h> char rstr[50]; void InitAES (B4R::Object* o) { b4r_main::_enc = rstr; } #End if Error: Code: b4r_main.cpp:61: error: cannot convert 'char [50]' to 'B4R::Array*' in assignment I simply need to return "rstr" to "enc"
I'm working on how to use AES with an ESP32. Everything is fine except how to use/return strings (byte arrays/chars). There are some threads but I don't get it. Code: Code: Private enc() As Byte ' In Globals RunNative("InitAES",Null) ' Call Inline C Code: #if C #include <mbedtls/aes.h> char rstr[50]; void InitAES (B4R::Object* o) { b4r_main::_enc = rstr; } #End if Error: Code: b4r_main.cpp:61: error: cannot convert 'char [50]' to 'B4R::Array*' in assignment I simply need to return "rstr" to "enc"
thetahsk Active Member Licensed User Longtime User Mar 17, 2019 #2 Try this Code: b4r_main::_enc->data = rstr; b4r_main::_enc->length = strlen(rstr); Last edited: Mar 17, 2019 Upvote 0
KMatle Expert Licensed User Longtime User Mar 18, 2019 #3 thetahsk said: Try this Code: b4r_main::_enc->data = rstr; b4r_main::_enc->length = strlen(rstr); Click to expand... Thanks. That worked. Upvote 0
thetahsk said: Try this Code: b4r_main::_enc->data = rstr; b4r_main::_enc->length = strlen(rstr); Click to expand... Thanks. That worked.