[PATCH v5 0/4]
by Bing Jupiter
Cleaned up comments and resubmit
Bing Jupiter (4):
Detect SARA R4 QMI device
Detect SARA R4 QMI device
Detect SARA R4 QMI device
Detect SARA R4 QMI device
drivers/atmodem/vendor.h | 1 +
drivers/qmimodem/gprs.c | 10 ++++++++++
plugins/gobi.c | 11 ++++++++++-
plugins/udevng.c | 42 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 63 insertions(+), 1 deletion(-)
--
2.25.1
11 months, 3 weeks
Bug/Oversight in gatchat/gatresult.c with negative numbers
by Alex J Lennon
Hi all,
I'm doing a bit of work with Ofono again, extending support for a
Quectel EG91 - handling additional cell strength information which seems
necessary for LTE.
I'm using Quectel's AT+QCOPS which is returning some negative signal
strengths and after some investigation I've spotted that
gatresult::g_at_result_iter_next_number() doesn't handle negative numbers.
No doubt there's a better solution than mine, but this does appear to work.
Cheers,
Alex
--- ofono-1.22.org/gatchat/gatresult.c 2011-10-11 18:21:45.000000000 +0000
+++ ofono-1.22/gatchat/gatresult.c 2021-07-20 15:50:06.300001000 +0000
@@ -262,6 +262,7 @@
int end;
int len;
int value = 0;
+ int sign = 1;
char *line;
if (iter == NULL)
@@ -276,10 +277,16 @@
pos = iter->line_pos;
end = pos;
+ if(line[end] == '-') {
+ sign = -1;
+ end += 1;
+ }
+
while (line[end] >= '0' && line[end] <= '9') {
value = value * 10 + (int)(line[end] - '0');
end += 1;
}
+ value = sign * value;
if (pos == end)
return FALSE;
1 year
[PATCH] simfs: Fix reads beyond the first block
by Slava Monich
---
src/simfs.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/simfs.c b/src/simfs.c
index 3d4f6283..cf770265 100644
--- a/src/simfs.c
+++ b/src/simfs.c
@@ -383,18 +383,18 @@ static void sim_fs_op_read_block_cb(const struct ofono_error *error,
}
start_block = op->offset / 256;
- end_block = (op->offset + (op->num_bytes - 1)) / 256;
+ end_block = op->num_bytes ? (op->offset + op->num_bytes - 1) / 256 :
+ start_block;
if (op->current == start_block) {
bufoff = 0;
dataoff = op->offset % 256;
- tocopy = MIN(256 - op->offset % 256,
- op->num_bytes - op->current * 256);
+ tocopy = MIN(256 - dataoff, op->num_bytes);
} else {
- bufoff = (op->current - start_block - 1) * 256 +
+ bufoff = (op->current - start_block) * 256 -
op->offset % 256;
dataoff = 0;
- tocopy = MIN(256, op->num_bytes - op->current * 256);
+ tocopy = MIN(256, op->num_bytes - bufoff);
}
DBG("bufoff: %d, dataoff: %d, tocopy: %d",
@@ -463,13 +463,12 @@ static gboolean sim_fs_op_read_block(gpointer user_data)
bufoff = 0;
seekoff = SIM_CACHE_HEADER_SIZE + op->current * 256 +
op->offset % 256;
- toread = MIN(256 - op->offset % 256,
- op->num_bytes - op->current * 256);
+ toread = MIN(256 - op->offset % 256, op->num_bytes);
} else {
- bufoff = (op->current - start_block - 1) * 256 +
+ bufoff = (op->current - start_block) * 256 -
op->offset % 256;
seekoff = SIM_CACHE_HEADER_SIZE + op->current * 256;
- toread = MIN(256, op->num_bytes - op->current * 256);
+ toread = MIN(256, op->num_bytes - bufoff);
}
DBG("bufoff: %d, seekoff: %d, toread: %d",
--
2.25.1
1 year
Documentation on when to free structures in/after callbacks
by ajlennon@dynamicdevices.co.uk
Hi all,
I'm trying to write a driver for Quectel modems as I need some specific bits and bobs - mainly signal strengths for the serving cell and neighbourhood cells
I can't quite get my head around when I am supposed to provide free() functions to to calls and when to free in callbacks on success or error conditions.
Is there a bit of a document somewhere somebody could direct me to that explains this?
Or maybe I am overthinking and somebody could just explain the logic behind it?
Thanks!
Alex
1 year
[PATCH] gemalto: radio-settings: cleanup
by Sergey Matyukevich
Enum ofono_radio_access_mode has been replaced by unsigned int.
This change allows to move handling of all the modes into
'switch' in the function gemalto_set_rat_mode.
---
drivers/gemaltomodem/radio-settings.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/gemaltomodem/radio-settings.c b/drivers/gemaltomodem/radio-settings.c
index 738a6908..50764f83 100644
--- a/drivers/gemaltomodem/radio-settings.c
+++ b/drivers/gemaltomodem/radio-settings.c
@@ -171,21 +171,18 @@ static void gemalto_set_rat_mode(struct ofono_radio_settings *rs,
case OFONO_RADIO_ACCESS_MODE_LTE:
val = 3;
break;
- }
-
- if (m == (OFONO_RADIO_ACCESS_MODE_UMTS|OFONO_RADIO_ACCESS_MODE_GSM)) {
+ case OFONO_RADIO_ACCESS_MODE_UMTS|OFONO_RADIO_ACCESS_MODE_GSM:
val = 1;
p1 = 2;
- }
-
- if (m == (OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_UMTS)) {
+ break;
+ case OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_UMTS:
val = 4;
p1 = 3;
- }
-
- if (m == (OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_GSM)) {
+ break;
+ case OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_GSM:
val = 5;
p1 = 3;
+ break;
}
if (val == 6)
--
2.32.0
1 year
Research for additional information related to your topic
by ronthomsoncc@gmail.com
It can help if you did a bit of research on topics related to the one you are writing on. Social science is a subject that has been widely studied, and a lot of concepts overlap one another. Thus, researching for additional information can help you solve and answer questions with ease. If you find yourself struggling to research properly, you can always reach out to assignment experts and help them solve your social science, computer science, or even your math assignment help.
https://myassignmenthelp.com/mathematics_assignment_help.html
1 year