J javiman6969 Member Licensed User Longtime User Jul 9, 2018 #1 I have this problem too (std::bad_alloc). Raspberry PI 2 with a USB Dongle, Bus 001 Device 004: ID 0451:16a6 Texas Instruments, Inc. BM-USBD1 BlueRobin RF heart rate sensor receiver I have correctly open /dev/ttyACM0 but closing the port, the result is (std::bad_alloc). I use the last verison of JSSC and jSerial 1.06 Any suggestion? Thanks!
I have this problem too (std::bad_alloc). Raspberry PI 2 with a USB Dongle, Bus 001 Device 004: ID 0451:16a6 Texas Instruments, Inc. BM-USBD1 BlueRobin RF heart rate sensor receiver I have correctly open /dev/ttyACM0 but closing the port, the result is (std::bad_alloc). I use the last verison of JSSC and jSerial 1.06 Any suggestion? Thanks!
besoft Active Member Licensed User Longtime User Jul 9, 2018 #2 https://www.b4x.com/android/forum/threads/rpi3-and-std-bad_alloc-2.94435/ Maybe something helps Upvote 0
J javiman6969 Member Licensed User Longtime User Jul 9, 2018 #3 Hi. Thanks for your answer. IF i use this code: B4X: spRF.Initialize("spRF") spRF.Open("/dev/ttyACM0") spRF.SetParams(115200,8,1,0) astreamRF.Initialize( spRF.GetInputStream, spRF.GetOutputStream, "astreamRF" ) .... .... .... astreamRF.Close spRF.Close The result is the next error: what(): std::bad_alloc If I comment the line: B4X: 'astreamRF.Initializeprefix( spRF.GetInputStream, True, spRF.GetOutputStream, "astreamRF" ) 'astreamRF.Close Perfectly opens and closes the port and does not give an error. I have reviewed all the post but nothing. Any other suggestions? Thanks!!! Last edited: Jul 9, 2018 Upvote 0
Hi. Thanks for your answer. IF i use this code: B4X: spRF.Initialize("spRF") spRF.Open("/dev/ttyACM0") spRF.SetParams(115200,8,1,0) astreamRF.Initialize( spRF.GetInputStream, spRF.GetOutputStream, "astreamRF" ) .... .... .... astreamRF.Close spRF.Close The result is the next error: what(): std::bad_alloc If I comment the line: B4X: 'astreamRF.Initializeprefix( spRF.GetInputStream, True, spRF.GetOutputStream, "astreamRF" ) 'astreamRF.Close Perfectly opens and closes the port and does not give an error. I have reviewed all the post but nothing. Any other suggestions? Thanks!!!
Erel B4X founder Staff member Licensed User Longtime User Jul 10, 2018 #4 You shouldn't use prefix mode here. Prefix mode can only work when the other side of the connection also uses prefix mode. Upvote 0
You shouldn't use prefix mode here. Prefix mode can only work when the other side of the connection also uses prefix mode.