I need to establish a serial communication through the main port of ESP32 (I am using the TTGO TCALL SIM800L module).
SerialNative2 is used to communicate with the SIM800L and it works properly.
SerialNative1 is used to receive serial data sent from a sensor module and works correctly
If I add the following line (to configure serial1)
astreamcom.Initialize (Serial0.Stream, "AstreamCom_NewData", "AstreamCom_Error")
I get this error:
b4r_main.cpp:242:104: error: invalid conversion from 'void (*)(B4R::Array*)' to 'B4R::SubVoidVoid {aka void (*)()}' [-fpermissive]
If I comment out that line, the code compiles correctly.
(astreamcom is of type AsyncStreams)
What is wrong with the configuration?
Thank you for your answers.
SerialNative2 is used to communicate with the SIM800L and it works properly.
SerialNative1 is used to receive serial data sent from a sensor module and works correctly
If I add the following line (to configure serial1)
astreamcom.Initialize (Serial0.Stream, "AstreamCom_NewData", "AstreamCom_Error")
I get this error:
b4r_main.cpp:242:104: error: invalid conversion from 'void (*)(B4R::Array*)' to 'B4R::SubVoidVoid {aka void (*)()}' [-fpermissive]
If I comment out that line, the code compiles correctly.
(astreamcom is of type AsyncStreams)
What is wrong with the configuration?
Thank you for your answers.
Serial COnfig:
'PUERTO SERIAL SIM800L
#if C
//Puerto Serial SIM800L
void SerialNative2(B4R::Object* unused)
{
::Serial2.begin(4800,SERIAL_8N1,26,27);
b4r_main::_serialnative2->wrappedStream = &::Serial2;
}
#End If
'PUERTO SERIAL MÓDULO SENSORES
'RX=2, TX=4
#if C
void SerialNative1(B4R::Object* unused){
::Serial1.begin(9600, SERIAL_8N1, 2, 4);
b4r_main::_serialnative1->wrappedStream = &::Serial1;
}
#End If
'**************************************************************************
Private Sub AppStart
'**********************************
'GESTIÓN PUERTO USB
Serial0.Initialize(115200)
astreamcom.Initialize(Serial0.Stream, "AstreamCom_NewData", "AstreamCom_Error")
'GESTION MODEM SIM800L
RunNative("SerialNative2", Null)
astream.Initialize(SerialNative2,"Astream_NewData", "Astream_Error")
'PUERTO SERIAL MÓDULO SENSORES
RunNative("SerialNative1", Null)
astream1.Initialize(SerialNative1,"AStream1_NewData", "Astream1_Error")
........