B4J Question RPI jserial problems /dev/ttyACM0

javiman6969

Member
Licensed User
Longtime User
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!
 

javiman6969

Member
Licensed User
Longtime User
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:
Upvote 0
Top