Hi, All
Working with BLE devices it needs to get the device: name, mac and current string value of it.
How to pass such struct back to B4R ?
How to get back whole the type var "curserver" CORRECTLY ?
Task is collect the info of the device list, to check them in a loop.
Working with BLE devices it needs to get the device: name, mac and current string value of it.
How to pass such struct back to B4R ?
Module name 'espbleclient':
Private Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Private result() As Byte 'single returning value
Type bleServerType (name() As Byte, mac() As Byte, value() As Byte)
Private curserver As bleServerType
End Sub
#if c
....
String res = (String)myDevice->getName().c_str()
byte b1[res.length() + 1];
res.getBytes(b1, sizeof(b1));
b4r_espbleclient::_result->data = b1; ; //THIS PASSED TO B4R OK !
b4r_espbleclient::_result->length = sizeof(b1);
//BUT NEED TO PASS the struct
_bleservertype* tmp = (_bleservertype*)b4r_espbleclient::_curserver;
tmp->name = (B4R::B4RString*)res; // error
tmp->mac = myDevice->getAddress().toString().c_str();
tmp->value = value.c_str();
b4r_espbleclient::_server_found();
How to get back whole the type var "curserver" CORRECTLY ?
Task is collect the info of the device list, to check them in a loop.
Last edited: