This code will get the Mac-addres from a Wemos D1 Mini.
I would like to use the MacArray directly from C using b4r_main::_macarray = MAC_array;
But gets this error 'cannot convert 'uint8_t [6] {aka unsigned char [6]}' to 'B4R::Array*' in assignment'
I would like to use the MacArray directly from C using b4r_main::_macarray = MAC_array;
But gets this error 'cannot convert 'uint8_t [6] {aka unsigned char [6]}' to 'B4R::Array*' in assignment'
B4X:
sub Process_Globals
Dim MacArray(6) As Byte
Dim M1,M2,M3,M4,M5,M6 As Byte 'ignore
End Sub
Sub MacAddress() As Byte()
RunNative("getMac", Null)
bc.ArrayCopy(Array As Byte(M1,M2,M3,M4,M5,M6),MacArray)
Return MacArray
End Sub
#if C
#include <ESP8266WiFi.h>
uint8_t MAC_array[6];
void getMac(B4R::Object* u) {
WiFi.macAddress(MAC_array);
b4r_main::_m1 = MAC_array[0];
b4r_main::_m2 = MAC_array[1];
b4r_main::_m3 = MAC_array[2];
b4r_main::_m4 = MAC_array[3];
b4r_main::_m5 = MAC_array[4];
b4r_main::_m6 = MAC_array[5];
}
#end if