Hi Erel,
I use B4J for programming with Raspberry Pi. Need to communicate with GPS receiver module.
I use jserial 1.05 with GPS receiver module.
For several seconds work well, can receive GPS data. After that always terminated with message :
terminate called after throwing an instance of std::bad_alloc.
My GPS Port initialization :
...
Private GPS_PORT As Serial
.......
.......
GPS_PORT.Initialize("")
GPS_PORT.Open("/dev/ttyAMA0")
GPS_PORT.SetParams(4800,8,1,0)
GPS_PORT.PurgePort(Bit.OR(GPS_PORT.PURGE_RXABORT,GPS_PORT.PURGE_RXCLEAR))
ASP.Initialize(GPS_PORT.GetInputStream,Null,"GPSPORT")
...........
...........
Sub GPSPORT_NewData(datanya() As Byte)
Dim ss As String = BytesToString(datanya,0,datanya.Length,"UTF8")
Log(ss)
End Sub
...........
...........
I make simple the function GPSPORT_NewData for this question, just to show you that LOG will output some serial data. After few seconds, program always break with std::bad_alloc.
I have tested using Java 1.7 (original Raspberian) and Java 1.8, resulting the same.
Any advice ?
Regards,
Rudy Darmawan