View: 1122|Reply: 0

C# Xamarin Android serial port reading doesn't work but writing

[Copy link]

1

threads

1

posts

9

credits

Novice

Rank: 1

credits
9
Published in 2022-9-8 20:33:45 | Show all floors |Read mode
I cannot receive data on serial port ttyS5. I able to write onto it, but the reading doesnt work. I'm using this https://github.com/officialdoniald/Xamarin.Android.SerialPort . I tried using adb shell commands like "cat /dev/ttyS5" but there is no received data either. When I try to send data with "LibSerialPort.WriteLine("text")" I can see it in Hercules Terminal so the writing works. In Visual Studio Output there is this line:
  1. [c.SerialPortPoc] type=1400 audit(0.0:532): avc: denied { read write } for name="ttyS5" dev="tmpfs" ino=2487 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:serial_device:s0 tclass=chr_file permissive=1 app=SerialPortPoc.SerialPortPoc
Copy code

Device: Orange Pi Zero 2, Android 10

You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list