B4R Question Callback from Inline C to B4R Sub with parms

KMatle

Expert
Licensed User
Longtime User
I try to pass the two variables from Inline C (without using global variables): from and &msg to a sub in B4R giving

b4r_main.cpp:85:35: error: no matching function for call to 'b4r_main::_newmessage(uint32_t&, String*)'

B4X:
void receivedCallback( uint32_t from, String &msg ) {
  Serial.printf("Received from %u msg=%s\n", from, msg.c_str());
  b4r_main::_newmessage(from, &msg);
}

B4X:
Sub newmessage(node As ULong, m As String)
    Log(node,"->",m)
End Sub

The second one seems to be a String pointer. Can someone give me a hint here?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…