QSerialPort bytesAvailable() and read() delayed, QextSerialPort works
-
Sorry I have deleted a duplicate message
-
Sorry I have deleted a duplicate message
-
Hello,
yes of course, I use Point of sale Industrial with Android, with workarround we can use serial port.
Best Regards
-
Hello,
yes of course, I use Point of sale Industrial with Android, with workarround we can use serial port.
Best Regards
-
Hi Mr_Wallyit,
Thanks for sharing the details.
I have an android device which has serial port attached to it. The manufacturer has a sample application with it which uses the serial port. The port name is "/dev/ttyS6".
As you mentioned I tried to create folder in my device. My device file explorer shows files structure as "/mnt/sdcard". So I created folders as below:
"/mnt/sdcard/data/lock"
"/mnt/sdcard/data/locks"
"/mnt/sdcard/data/spool/locks"
"/mnt/sdcard/data/spool/uucp"
"/mnt/sdcard/data/tmp"But, the folder "/mnt/data/local/tmp" is unable to create as my file explorer doesn't allow to create folder.
I kept my code as @QString serialPortLockFilePath(const QString &portName)
{
static const QStringList lockDirectoryPaths = QStringList()#ifdef Q_OS_ANDROID
<< QStringLiteral("/mnt/sdcard/data/lock")
<< QStringLiteral("/mnt/sdcard/data/locks")
<< QStringLiteral("/mnt/sdcard/data/spool/locks")
<< QStringLiteral("/mnt/sdcard/data/spool/uucp")
<< QStringLiteral("/mnt/sdcard/data/tmp");
#else
<< QStringLiteral("/var/lock")
<< QStringLiteral("/etc/locks")
<< QStringLiteral("/var/spool/locks")
<< QStringLiteral("/var/spool/uucp")
<< QStringLiteral("/tmp");
#endif@And I have a second device whose files structure as "/sdcard". So I created folders as below:
"/sdcard/data/lock"
"/sdcard/data/locks"
"/sdcard/data/spool/locks"
"/sdcard/data/spool/uucp"
"/sdcard/data/tmp"But, the folder "/data/local/tmp" is unable to create as my file explorer crashes on creating folder "/data/locaal" (need to retry with different file explorer application).
@QString serialPortLockFilePath(const QString &portName)
{
static const QStringList lockDirectoryPaths = QStringList()#ifdef Q_OS_ANDROID
<< QStringLiteral("/sdcard/data/lock")
<< QStringLiteral("/sdcard/data/locks")
<< QStringLiteral("/sdcard/data/spool/locks")
<< QStringLiteral("/sdcard/data/spool/uucp")
<< QStringLiteral("/sdcard/data/tmp");
#else
<< QStringLiteral("/var/lock")
<< QStringLiteral("/etc/locks")
<< QStringLiteral("/var/spool/locks")
<< QStringLiteral("/var/spool/uucp")
<< QStringLiteral("/tmp");
#endif@and created a sample application which tries to access the serial port. I set the port name as @setPortName("/dev/ttyS6");@
But when running the application I get the error "Permission denied".Could you help me to figure out where I am going wrong.
Thanks in advance.
-
Hi Mr_Wallyit,
Thanks for sharing the details.
I have an android device which has serial port attached to it. The manufacturer has a sample application with it which uses the serial port. The port name is "/dev/ttyS6".
As you mentioned I tried to create folder in my device. My device file explorer shows files structure as "/mnt/sdcard". So I created folders as below:
"/mnt/sdcard/data/lock"
"/mnt/sdcard/data/locks"
"/mnt/sdcard/data/spool/locks"
"/mnt/sdcard/data/spool/uucp"
"/mnt/sdcard/data/tmp"But, the folder "/mnt/data/local/tmp" is unable to create as my file explorer doesn't allow to create folder.
I kept my code as @QString serialPortLockFilePath(const QString &portName)
{
static const QStringList lockDirectoryPaths = QStringList()#ifdef Q_OS_ANDROID
<< QStringLiteral("/mnt/sdcard/data/lock")
<< QStringLiteral("/mnt/sdcard/data/locks")
<< QStringLiteral("/mnt/sdcard/data/spool/locks")
<< QStringLiteral("/mnt/sdcard/data/spool/uucp")
<< QStringLiteral("/mnt/sdcard/data/tmp");
#else
<< QStringLiteral("/var/lock")
<< QStringLiteral("/etc/locks")
<< QStringLiteral("/var/spool/locks")
<< QStringLiteral("/var/spool/uucp")
<< QStringLiteral("/tmp");
#endif@And I have a second device whose files structure as "/sdcard". So I created folders as below:
"/sdcard/data/lock"
"/sdcard/data/locks"
"/sdcard/data/spool/locks"
"/sdcard/data/spool/uucp"
"/sdcard/data/tmp"But, the folder "/data/local/tmp" is unable to create as my file explorer crashes on creating folder "/data/locaal" (need to retry with different file explorer application).
@QString serialPortLockFilePath(const QString &portName)
{
static const QStringList lockDirectoryPaths = QStringList()#ifdef Q_OS_ANDROID
<< QStringLiteral("/sdcard/data/lock")
<< QStringLiteral("/sdcard/data/locks")
<< QStringLiteral("/sdcard/data/spool/locks")
<< QStringLiteral("/sdcard/data/spool/uucp")
<< QStringLiteral("/sdcard/data/tmp");
#else
<< QStringLiteral("/var/lock")
<< QStringLiteral("/etc/locks")
<< QStringLiteral("/var/spool/locks")
<< QStringLiteral("/var/spool/uucp")
<< QStringLiteral("/tmp");
#endif@and created a sample application which tries to access the serial port. I set the port name as @setPortName("/dev/ttyS6");@
But when running the application I get the error "Permission denied".Could you help me to figure out where I am going wrong.
Thanks in advance.
-
Hello,
this is my source code, I think who is wrong “/mnt/sdcard/data/lock”.
@
bool s = true; QStringList pathList;
#ifdef ANDROID
pathList << "/sdcard/data";
pathList << "/sdcard/data/lock";
pathList << "/sdcard/data/locks";
pathList << "/sdcard/data/spool";
pathList << "/sdcard/data/spool/locks";
pathList << "/sdcard/data/spool/uucp";
pathList << "/sdcard/data/tmp";
pathList << "/sdcard/data/local";
pathList << "/sdcard/data/local/tmp";
#endifQDir d; foreach (const QString s, pathList) { d.setPath(s); if (!d.exists()){ if(d.mkpath(d.absolutePath())) qCCritical() << "error create directory " << d.absolutePath(); } }
@
-
Hello,
this is my source code, I think who is wrong “/mnt/sdcard/data/lock”.
@
bool s = true; QStringList pathList;
#ifdef ANDROID
pathList << "/sdcard/data";
pathList << "/sdcard/data/lock";
pathList << "/sdcard/data/locks";
pathList << "/sdcard/data/spool";
pathList << "/sdcard/data/spool/locks";
pathList << "/sdcard/data/spool/uucp";
pathList << "/sdcard/data/tmp";
pathList << "/sdcard/data/local";
pathList << "/sdcard/data/local/tmp";
#endifQDir d; foreach (const QString s, pathList) { d.setPath(s); if (!d.exists()){ if(d.mkpath(d.absolutePath())) qCCritical() << "error create directory " << d.absolutePath(); } }
@