Quectel BG95 Support
by arash.javanmard@inro-et.de
Hello,
unfortunately there is no support for Quectel BG95 in ofono. But nevertheless i tried to adapt the existing Quectel implementation for BG95.
So i added:
udevng.c
------- 8< -------------
{ "quectelqmi", "qmi_wwan", "2c7c", "0700" },
{ "quectelqmi", "qcserial", "2c7c", "0700" },
{ "quectel", "option", "2c7c", "0700" },
------- >8 -------------
It helps to recognize the modem, but it seems to be BUG in "setup_quectel" fucntion in "udevng.c" file.
Since checking for "modem->serial" in the function produces a segfault. so i just commented it out.
But after that the next problems popped up in "quectel.c"-Modul.
------- 8< ----------------------------------------
ofonod[273]: Aux: > AT+CGMM\r
ofonod[273]: Aux: < \r\nBG95-M3\r\n\r\nOK\r\n
ofonod[273]: plugins/quectel.c:cgmm_cb() 0x165dd0 ok 1
ofonod[273]: Failed to query modem model
------- >8 -----------------------------------------
As you can see it failed to query the model modem, even though the modem is answering correct.
so i digged deeper and found out, that only the number of lines save in result-argument which is a "GATResult"
is actually zero! That means somewho the answer of the modem is not parsed right!
Any help is welcome!
Best Regards
Arash
2 years, 2 months
[PATCH] Adds optional phone number parameter to ofono-phonesim
by Bettina Jennifer Riedl
Hello,
this patch adds an optional phone number parameter to ofono-phonesim, instead of using the default number.
Greetings
Bettina
Michael Klemm:
Added phone number as additional parameter (1/2)
AUTHORS: Mention Michael's contributions (2/2)
(1/2)
diff --git a/src/main.cpp b/src/main.cpp
index 712e767..a20bc1a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -28,13 +28,14 @@ static void usage()
{
qWarning() << "Usage:"
<< QFileInfo(QCoreApplication::instance()->applicationFilePath()).fileName().toLocal8Bit().constData()
- << "[-v] [-p port] [-gui] filename";
+ << "[-v] [-p port] [-gui] [-n number] filename";
exit(-1);
}
int main(int argc, char **argv)
{
QString filename = nullptr;
+ QString number = "+491701234567";
QCoreApplication *app;
int port = 12345;
int index;
@@ -61,6 +62,15 @@ int main(int argc, char **argv)
} else if ( strcmp(argv[index],"-h") == 0
|| strcmp(argv[index],"-help") == 0 ) {
usage();
+ } else if ( strcmp(argv[index],"-n") == 0
+ || strcmp(argv[index],"-num") == 0 ) {
+ index++;
+ if (index >= argc) {
+ qWarning() << "ERROR: Got -n but missing phone number";
+ usage();
+ } else {
+ number = argv[index];
+ }
} else {
// must be filename. SHOULD be last argument.
if (index != argc-1) {
@@ -85,7 +95,7 @@ int main(int argc, char **argv)
} else
app = new QCoreApplication(argc, argv);
- PhoneSimServer *pss = new PhoneSimServer(filename, port, nullptr);
+ PhoneSimServer *pss = new PhoneSimServer(filename, port, number, nullptr);
diff --git a/src/server.cpp b/src/server.cpp
index 3ff7def..856a90f 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -22,13 +22,12 @@
#include "hardwaremanipulator.h"
#include <qdebug.h>
-static int phonenumber = 555000;
-
-PhoneSimServer::PhoneSimServer(const QString &f, quint16 port, QObject *parent)
+PhoneSimServer::PhoneSimServer(const QString &f, quint16 port, const QString &n, QObject *parent)
: QTcpServer(parent), fact(nullptr), currentRules(nullptr)
{
listen( QHostAddress::Any, port );
filename = f;
+ number = n;
}
PhoneSimServer::~PhoneSimServer()
@@ -47,7 +46,6 @@ void PhoneSimServer::setHardwareManipulator(HardwareManipulatorFactory *f)
void PhoneSimServer::incomingConnection(qintptr s)
{
SimRules *sr = new SimRules(s, this, filename, fact);
- sr->setPhoneNumber(QString::number(phonenumber));
- phonenumber++;
+ sr->setPhoneNumber(number);
currentRules = sr;
}
diff --git a/src/server.h b/src/server.h
index 9175359..6790be4 100644
--- a/src/server.h
+++ b/src/server.h
@@ -32,7 +32,7 @@ class HardwareManipulatorFactory;
class PhoneSimServer : public QTcpServer
{
public:
- PhoneSimServer(const QString &, quint16 port, QObject *parent = nullptr);
+ PhoneSimServer(const QString &, quint16 port, const QString &, QObject *parent = nullptr);
~PhoneSimServer() override;
void setHardwareManipulator(HardwareManipulatorFactory *f);
@@ -44,6 +44,7 @@ protected:
private:
QString filename;
+ QString number;
(2/2)
diff --git a/AUTHORS b/AUTHORS
index 9b8a840..d8e107f 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -15,3 +15,4 @@ Jussi Pakkanen <jussi.pakkanen(a)canonical.com>
James Prestwood <james.prestwood(a)linux.intel.com>
Simon Busch <morphis(a)gravedo.de>
Jonah Brüchert <jbb.prv(a)gmx.de>
+Michael Klemm <mklemm(a)assystem.com>
_____________________________________________________________________________________
Expleo Germany GmbH
Sitz der Gesellschaft | Corporate Headquarters: München
Handelsregister | Commercial Register: Amtsgericht München HRB 83252
Geschäftsführung | Management: Ralph Gillessen, Josef Mitterhuber
This message contains information that may be privileged or confidential. It is intended only for the person to whom it is addressed.
If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof.
If you receive this message in error, please notify the sender immediately and delete all copies of this message.
_________________________________________________________
EMAIL LEGAL MENTION / DISCLAIMER
This message contains information that may be privileged or confidential and is the property of the Expleo Services SAS, RCS Versailles 831 178 348, located, 3 avenue des Prés, 78180 Montigny Le Bretonneux - France. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
Ce message contient des informations qui peuvent être privilégiées ou confidentielles et elles sont de la propriété d'Expleo Services SAS, RCS Versailles 831 178 348, situé, 3 avenue des Prés, 78180 Montigny le Bretonneux-France. Il est destiné uniquement à la personne à qui est adressé. Si vous n'êtes pas le destinataire visé, vous n'êtes pas autorisé à lire, imprimer, conserver, copier, diffuser, distribuer ou utiliser ce message ou toute partie de celui-ci. Si vous recevez ce message par erreur, veuillez en avertir immédiatement l'expéditeur et supprimer toutes les copies de ce message.
2 years, 2 months
crash in drivers/qmimodem/gprs.c:extract_ss_info()
by Pau Espin Pedrol
Hi all,
I reported an ofono recurring crash together with the corresponding
investigation & logs yesterday on #ofono IRC channel. The crash appears
on our osmo-gsm-tester setup several times per day.
In my opinion, the summary for the crash is following race condition:
1- We submit QMI request using qmi_attached_status() and expect callback
to be received at some point
2- While waiting for the response, modem announces becoming offline
(modem_change_state() MODEM_STATE_ONLINE -> MODEM_STATE_OFFLINE). Here
gprs_remove() is called which frees all related structures
3- We receive the QMI response of qmi_attached_status() and
get_ss_info_cb() is called, which eventually crashes because the "gprs =
cbd->user" is already gone, so use after free occurs and process
receives SIGSEGV.
The details of the issue can be found here:
https://osmocom.org/issues/4542
so far Denis proposed something like this on IRC:
* Tracking outstanding requests and cancel them. For instance GAtChat
(via g_at_chat_clone) creates a facade object instead, and assigns a
‘group id’ to it. So destroying the facade object also cancels any
outstanding requests associated with it. QMI should ideally do something
similar.
* An easy fix would be to store the request id for whatever NAS
request you’re doing in gprs.c and cancel it in gprs_remove. But you
might run into this in other places in drivers/qmimodem/gprs.c
I would welcome if someone with more knowledge of ofono code base than I
could have a look at this and provide some fix, or at least some
detailed pointers at the work required. I am happy to collaborate and
test the patches as needed.
Best Regards,
Pau
--
- Pau Espin Pedrol <pespin(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte
2 years, 2 months