Age | Commit message (Collapse) | Author |
|
the buffer
|
|
the buffer
|
|
the buffer
|
|
the buffer
|
|
the buffer
|
|
Some architectures require that the value of a pointer is aligned in memory.
Given that we're reading from a raw buffer, the integers in may not end up
aligned so we cannot safely cast any address to a valid 16/32/64 bit integer
value. Handle this by copying the integer from the raw buffer to an intermediate
properly aligned variable, before applying the endianness fix and returning it.
Also added new test cases to check this.
|
|
The compiler doesn't know the type of literals and may try to fit it
into a slot that is too small. This adds suffixes to the long long and
unsigned long long literals.
|
|
The buffer must contain *at least* the initial 1-byte marker plus the length
reported by the QMUX header. The minimum size check was wrong for 2 bytes, which
could cause errors when trying to decode a message without all bytes.
Can easily be triggered using 1 for the BUFFER_SIZE in QmiDevice.
|
|
Modems seem to report 0xFF when the operating mode is unknown or if it cannot
be retrieved.
|
|
This mode is not just used for notiying a transition, it can also be used to
wake up the modem from an 'offline' state:
$ sudo qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=offline
[/dev/cdc-wdm0] Operating mode set successfully
$ sudo qmicli -d /dev/cdc-wdm0 --dms-get-operating-mode
[/dev/cdc-wdm0] Operating mode retrieved:
Mode: 'offline'
Reason: 'unknown'
HW restricted: 'no'
$ sudo qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=reset
[/dev/cdc-wdm0] Operating mode set successfully
$ sudo qmicli -d /dev/cdc-wdm0 --dms-get-operating-mode
[/dev/cdc-wdm0] Operating mode retrieved:
Mode: 'online'
HW restricted: 'no'
|
|
If we get an error parsing a JSON file we really want to have the exact line
number where the error happened, so don't just skip the comment lines and
substitute them with an empty line instead so that the line numbers don't
change.
|
|
For those variables which are containers of other variables (struct, sequence
and array), ensure we call `emit_helper_methods()' in order to generate variable
specific dispose() helpers and such.
This fixes the case of nested arrays of structs (arrays of structs with arrays of
structs whithin).
|
|
The build system sets up this variable for us, so use it rather than
hardcoding "pkg-config" which might be the wrong one.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
'length-prefix-size'
Use the new 'size-prefix-format' property to specify whether the length prefix
variable is a 'guint8' or a 'guint16'.
We therefore consolidate the way how this length prefix variable is specified in
both arrays and strings.
So, instead of:
"length-prefix-size" : "16"
We now just do:
"size-prefix-format" : "guint16"
|
|
The 'array-size' property was used to define an implicit variable to be found at
the beginning of every array. This property expected a dictionary with one
single 'format' key.
Instead of this setup, create a new 'size-prefix-format' property which directly
expects the format string of the variable to be used as array-length indicator.
So, instead of:
"array-size" : { "format" : "guint16" }
We can now just use:
"size-prefix-format" : "guint16"
Also, remove the explicit size definitions when the format is "guint8", as that
is the default already when none specified and the array is not of fixed size.
|
|
|
|
|
|
|
|
The contents of the containers were not being freed properly.
|
|
This seems quite useless, as we know that the maximum NMEA trace length is 200
characters, but anyway.
|
|
|
|
|
|
The GPS module can give us already processed information in addition to the raw
NMEA traces, including GPS/UTC date, latitude/longitude, DOPs...
Add a TODO task to process these additional TLVs, which will require changes in
the codegen in order to handle single-precision and double-precision float
number reading.
|
|
Currently just some of the TLVs with the raw NMEA traces.
|
|
|
|
Including "PDS Reset".
|
|
|
|
|
|
This patch renames variable 'link' to 'link_protocol' in order to avoid
collision with the 'link' symbol exported by unistd.h, which causes the
following compilation error:
qmi-device.c: In function 'process_open_flags':
qmi-device.c:1513:32: error: declaration of 'link' shadows a global
declaration [-Werror=shadow]
|
|
If the sections and types files aren't cleaned, adding a function to
libqmi-glib, regenerating the docs, then removing that function
doesn't regenerate the docs for some reason, meaning the scanner
won't link due to the function-not-found error:
docs/reference/libqmi-glib/libqmi-glib-sections.txt:qmi_wds_authentication_preference_get_type
docs/reference/libqmi-glib/libqmi-glib.types:qmi_wds_authentication_preference_get_type
docs/reference/libqmi-glib/libqmi-glib-scan.c:extern GType qmi_wds_authentication_preference_get_type (void);
docs/reference/libqmi-glib/libqmi-glib-scan.c: object_types[i++] = qmi_wds_authentication_preference_get_type ();
Make sure 'make clean' regenerates this stuff so we don't have
link errors.
|
|
Use the more generic `QmiWdsAuthentication' flags instead, which match properly.
|
|
|
|
Like these:
struct {
uint8 num_instances;
struct {
uint8 length;
char data[];
};
};
|
|
Like IPv6 addresses.
|
|
Not a guint8; flattened Gobi API says:
enum eQMIWDSExtendedTechPrefs:UINT16
{
...
}
Plus the values are wrong, so fix that.
|
|
Most string lengths are UINT8, but some (WDS Get Current Settings
PCSCF Domain Name List, for example) are UINT16.
|
|
|
|
|
|
See the following ModemManager logs:
ModemManager[7942]: [/dev/cdc-wdm0] Sending message...
<<<<<< QMUX:
<<<<<< length = 47
<<<<<< flags = 0x00
<<<<<< service = "wms"
<<<<<< client = 16
<<<<<< QMI:
<<<<<< flags = "none"
<<<<<< transaction = 16
<<<<<< tlv_length = 35
<<<<<< message = "Raw Send" (0x0020)
<<<<<< TLV:
<<<<<< type = "Raw Message Data" (0x01)
<<<<<< length = 32
<<<<<< value = 06:1D:00:00:01:00:09:81:36:39:53:39:F6:00:00:12:C8:37:3B:0C:42:BE:D9:61:D0:30:2C:0F:8F:DF:EC:30
<<<<<< translated = [ format = '6' raw_data = '{ [0] = '0 ' [1] = '1 ' [2] = '0 ' [3] = '9 ' [4] = '129 ' [5] = '54 ' [6] = '57 ' [7] = '83 ' [8] = '57 ' [9] = '246 ' [10] = '0 ' [11] = '0 ' [12] = '18 ' [13]
= '200 ' [14] = '55 ' [15] = '59 ' [16] = '12 ' [17] = '66 ' [18] = '190 ' [19] = '217 ' [20] = '97 ' [21] = '208 ' [22] = '48 ' [23] = '44 ' [24] = '15 ' [25] = '143 ' [26] = '223 ' [27] = '236 ' [28] = '48 '}'
]
ModemManager[7942]: [/dev/cdc-wdm0] Received message...
>>>>>> QMUX:
>>>>>> length = 19
>>>>>> flags = 0x80
>>>>>> service = "wms"
>>>>>> client = 16
>>>>>> QMI:
>>>>>> flags = "response"
>>>>>> transaction = 16
>>>>>> tlv_length = 7
>>>>>> message = "Raw Send" (0x0020)
>>>>>> TLV:
>>>>>> type = "Result" (0x02)
>>>>>> length = 4
>>>>>> value = 00:00:00:00
>>>>>> translated = SUCCESS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|