Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f0bf17ab5 | ||
|
|
9317cbc470 | ||
|
|
b422bd58ef | ||
|
|
ee761d009d | ||
|
|
faa5642962 | ||
|
|
ac03e70426 | ||
|
|
338ecc06f2 | ||
|
|
225e66fea9 | ||
|
|
efb6a9833e | ||
|
|
07893109ea | ||
|
|
0082587915 | ||
|
|
b2017e5fd1 | ||
|
|
30e4577b4d | ||
|
|
e1f8061541 | ||
|
|
69cde63231 | ||
|
|
357130472d | ||
|
|
5e12f3fab5 | ||
|
|
04c9797456 | ||
|
|
76c66944cc | ||
|
|
8d186a8df9 | ||
|
|
b12f3bee54 | ||
|
|
4449f2bc42 | ||
|
|
23a87628e9 | ||
|
|
ef88093931 | ||
|
|
5e91dd20c0 | ||
|
|
efe507c240 | ||
|
|
c920ea6592 | ||
|
|
a879fb717f | ||
|
|
dc16f48f41 | ||
|
|
6a14658a42 | ||
|
|
53a9ad1aa2 | ||
|
|
a838d3b98f | ||
|
|
cc29b5dac2 | ||
|
|
abf9babb02 | ||
|
|
306f6256f8 | ||
|
|
d446e495eb | ||
|
|
9a2d5863eb | ||
|
|
893ca6bdb0 | ||
|
|
de4306bfda | ||
|
|
07146dfdfd | ||
|
|
3568fb91a8 | ||
|
|
5bb7ece8b4 | ||
|
|
8b77e71298 | ||
|
|
96cb590724 | ||
|
|
e9932bde9d | ||
|
|
76ca77a897 | ||
|
|
9642ed9ab5 | ||
|
|
db72a182c1 | ||
|
|
c3e7ffaae0 | ||
|
|
166d6c5bc8 | ||
|
|
46a91399ca | ||
|
|
2b1aaca4a0 | ||
|
|
0280bbae3b | ||
|
|
691bb4286d | ||
|
|
6b3682ed65 | ||
|
|
3291e7dd1c | ||
|
|
50202ad76a | ||
|
|
dd54145d71 | ||
|
|
a39d46c637 | ||
|
|
1ee3a443b1 | ||
|
|
7088f5eaab | ||
|
|
30b76ac3e2 | ||
|
|
6bdee3cc68 | ||
|
|
d776ea38d2 | ||
|
|
913f05e0b4 | ||
|
|
cc69ce8aaf | ||
|
|
2c3e8aeee0 | ||
|
|
2b2560c567 | ||
|
|
0fbb9d05d2 | ||
|
|
98777e693f | ||
|
|
97c24d68e2 | ||
|
|
3ca0cba220 | ||
|
|
846048caa5 | ||
|
|
069212e43e | ||
|
|
e292401beb | ||
|
|
545b183934 | ||
|
|
3dbdc0704d | ||
|
|
fcc9d19f5e | ||
|
|
13a3ee81a3 | ||
|
|
c0d9497066 | ||
|
|
f7da97989b | ||
|
|
38548fedd3 | ||
|
|
42ca47472a | ||
|
|
027c8c068c | ||
|
|
62a967131d | ||
|
|
07704018dd | ||
|
|
de5058c283 | ||
|
|
fc1b1e9b1e | ||
|
|
87c88dc237 | ||
|
|
a94dd40a2a | ||
|
|
fd98a809af | ||
|
|
a486776a44 | ||
|
|
d6fe0722c9 | ||
|
|
64d8053413 | ||
|
|
4fead86d24 | ||
|
|
3f7b39075c | ||
|
|
07dc7e7304 | ||
|
|
1565e3ada7 | ||
|
|
174f17f6ea | ||
|
|
62cc4de68e | ||
|
|
a02355c5ce | ||
|
|
31cbf9c1be | ||
|
|
56f3ba761a | ||
|
|
f6676cc5f3 | ||
|
|
50759a2e52 | ||
|
|
4a33e408e3 | ||
|
|
74159e05e2 | ||
|
|
44330936c6 | ||
|
|
d111c242c9 | ||
|
|
b10139f96b | ||
|
|
fa32b5e1e9 | ||
|
|
b6d53915a6 | ||
|
|
c34b326709 | ||
|
|
e5ce798783 | ||
|
|
b59e0acb08 | ||
|
|
eae9ed5485 | ||
|
|
49fb75cd94 | ||
|
|
8053db6cc0 | ||
|
|
d8a01479ed | ||
|
|
66e72979a1 | ||
|
|
387c41cb04 | ||
|
|
1fc9059407 | ||
|
|
aa2aa54748 | ||
|
|
6131303fb2 | ||
|
|
c1386905f3 | ||
|
|
8f4e8bd24c | ||
|
|
089d0e3353 | ||
|
|
c0f0c02ac1 | ||
|
|
8b6116fe6c | ||
|
|
a108a0fe7c | ||
|
|
8ac3dfb955 | ||
|
|
81101b0147 | ||
|
|
90e71e2817 | ||
|
|
061a9956d0 | ||
|
|
314b6e7761 | ||
|
|
0636260a39 | ||
|
|
61e2f69d48 | ||
|
|
e12e1f4183 | ||
|
|
5ca95a64ab | ||
|
|
4678f3226e | ||
|
|
d2de8ff226 | ||
|
|
0f19f10958 | ||
|
|
3a2a33d3f0 | ||
|
|
a73b0675b5 | ||
|
|
936379a832 | ||
|
|
d2b7453422 | ||
|
|
c1112a2ee4 | ||
|
|
ff6a1ec9e6 | ||
|
|
4023c61c71 | ||
|
|
2a4c7e3a5b | ||
|
|
9c4aeeb33a | ||
|
|
f2318ecc7b | ||
|
|
7e5e6c6912 | ||
|
|
a2ed571ccf | ||
|
|
469c686504 | ||
|
|
a8280207fc | ||
|
|
bf67727c1c | ||
|
|
7b44ca740c | ||
|
|
c3ef78cc6c | ||
|
|
72dca00e69 | ||
|
|
0edcb916ad | ||
|
|
8d911cdd1a | ||
|
|
9ec1d25607 | ||
|
|
c6740c0a7e | ||
|
|
d2f4ca8a5b | ||
|
|
01e9b1ab48 | ||
|
|
c0933d2f18 | ||
|
|
af622ab19d | ||
|
|
37f73c7b6b | ||
|
|
a1ef6a16c4 | ||
|
|
76c055dcef | ||
|
|
f79cf7c78e | ||
|
|
186768a071 | ||
|
|
b3b221a458 | ||
|
|
6eaf45c194 | ||
|
|
ee75d23f00 | ||
|
|
672a1e29c8 | ||
|
|
ae3731ca69 | ||
|
|
4821968fb2 | ||
|
|
d5bee2bca6 | ||
|
|
2f6fc0d038 | ||
|
|
5833887c21 | ||
|
|
9405ade83b | ||
|
|
f5a650b9bd | ||
|
|
9fced3767a | ||
|
|
0e1bfdb5b6 | ||
|
|
1547c4d812 | ||
|
|
0d69304702 | ||
|
|
90843b7a0d | ||
|
|
b529b69fb6 | ||
|
|
848c4a95ee | ||
|
|
aca647cf9d | ||
|
|
c2a5b54f79 | ||
|
|
f51cc9488b | ||
|
|
14031a4b1b | ||
|
|
ef757daa1a | ||
|
|
5121a9413a | ||
|
|
e8a5ba04d0 | ||
|
|
3b8332a5a8 | ||
|
|
d9d1907157 | ||
|
|
1a9602ab6a | ||
|
|
5d4b0d3516 | ||
|
|
a107de32a8 | ||
|
|
ebebce6111 | ||
|
|
f4a1c0fcec | ||
|
|
70ad037146 | ||
|
|
07aca09af2 | ||
|
|
41133db361 | ||
|
|
f0a9aba63b | ||
|
|
ddea6c02d5 | ||
|
|
7ff47d795c | ||
|
|
d69dd96174 | ||
|
|
01208cc6c0 | ||
|
|
11489152d8 | ||
|
|
f7897daeb5 | ||
|
|
6c75cbcf74 | ||
|
|
0e1ba4c530 | ||
|
|
7fefddab05 | ||
|
|
b1d5006953 | ||
|
|
c070b9015e | ||
|
|
0ef7bf3fdb | ||
|
|
91adec212d | ||
|
|
1861ae1411 | ||
|
|
ca4334de94 | ||
|
|
2529159cee | ||
|
|
e8d781ae0b | ||
|
|
9d11ff4ba9 | ||
|
|
a24b60e52e | ||
|
|
7d4784ed28 | ||
|
|
0b2d7d6388 | ||
|
|
c30052ffc9 | ||
|
|
45d817c50f | ||
|
|
7029cdba3e | ||
|
|
04c5c1c31f | ||
|
|
c21191b59a | ||
|
|
e97bd6d407 | ||
|
|
aa9447c833 | ||
|
|
04229ca146 | ||
|
|
fc762626ab | ||
|
|
8553dc3623 | ||
|
|
38417c6520 | ||
|
|
0d29f6dfa5 | ||
|
|
4c319181e2 | ||
|
|
adb6dc9b44 | ||
|
|
0787d04a39 | ||
|
|
6c4b90de79 | ||
|
|
912e857831 | ||
|
|
a83a9bf437 | ||
|
|
5059b812fc | ||
|
|
df9f2d0de5 | ||
|
|
f9146378b8 | ||
|
|
93a63c85ea | ||
|
|
ad23d5f22c | ||
|
|
5d663976ea | ||
|
|
e55dde034b | ||
|
|
5ecf00aaf0 | ||
|
|
c89266facb | ||
|
|
061bc1ff2d | ||
|
|
1bc3db766b | ||
|
|
41f82a4d33 | ||
|
|
bf5458acdd | ||
|
|
8486641f92 | ||
|
|
e88e481ca3 | ||
|
|
32f7e3ec09 | ||
|
|
cf7d037ed3 | ||
|
|
6a2cb8dd8e | ||
|
|
44b9f74301 | ||
|
|
37f17d4b58 | ||
|
|
dad2d49b69 | ||
|
|
ae3d37030a | ||
|
|
56fe8e7d31 | ||
|
|
957a141e57 | ||
|
|
2726f8e8a2 | ||
|
|
5448a85a2b | ||
|
|
28b1954654 | ||
|
|
b9c49c7b4d | ||
|
|
8392f30388 | ||
|
|
3ed7f37876 | ||
|
|
7d410387cf | ||
|
|
a769bbed6d | ||
|
|
b24615d801 | ||
|
|
42ead88266 | ||
|
|
39f4cf77f2 | ||
|
|
87aaebcec0 | ||
|
|
68d241b5aa | ||
|
|
9625c81d39 | ||
|
|
95d65ecd8d | ||
|
|
0bd0cad705 | ||
|
|
3559f606d2 | ||
|
|
cdc6bf9529 | ||
|
|
857efa1fba | ||
|
|
5a3b810bc9 | ||
|
|
9cc5582bf2 | ||
|
|
5c1fcbfe4a | ||
|
|
757df26b29 | ||
|
|
c5a2cd3157 | ||
|
|
3d3182534e | ||
|
|
1192f49868 | ||
|
|
d058dd0775 | ||
|
|
680aed6acf | ||
|
|
c04f178dda | ||
|
|
9cb5a2d090 | ||
|
|
c6d1d020f7 | ||
|
|
382c3e114c | ||
|
|
7ae153880c | ||
|
|
c3c6fdc55e | ||
|
|
24f9309d6e | ||
|
|
7f014add61 | ||
|
|
41ceaf6d5e | ||
|
|
5888949fa3 | ||
|
|
847ce9ada5 | ||
|
|
0ccc3fbeec | ||
|
|
f17430b662 | ||
|
|
ba8633e48a | ||
|
|
6a4fdbba42 | ||
|
|
e3acdd8743 | ||
|
|
e74a563f87 | ||
|
|
4da9a26d54 | ||
|
|
b0589932d7 | ||
|
|
ec218e7052 | ||
|
|
0780526594 | ||
|
|
dea8f27464 | ||
|
|
2d29832f89 | ||
|
|
f3aaa113e0 | ||
|
|
a4421095f8 | ||
|
|
02131bf3bb | ||
|
|
e5c4cbc79a | ||
|
|
51b14b8ef8 | ||
|
|
bee6bce2fa | ||
|
|
2c66b5ee16 | ||
|
|
c99c300ad5 | ||
|
|
4cae040645 | ||
|
|
d165d61a95 | ||
|
|
d4c0bbc839 | ||
|
|
4bb6026e37 | ||
|
|
1d5cc0addb | ||
|
|
51ff44f1f5 | ||
|
|
03027b5ec2 | ||
|
|
97c189910b | ||
|
|
c6af442053 | ||
|
|
1781ffaad4 | ||
|
|
9c8ec57c24 | ||
|
|
b81f23e24a | ||
|
|
9830e3955a | ||
|
|
6d0e4daf87 | ||
|
|
1283ee8c2a | ||
|
|
683a33b303 | ||
|
|
08a65a0bed | ||
|
|
efcc960b13 | ||
|
|
1fa21fcc48 | ||
|
|
ec5104c9a8 | ||
|
|
ef5cee3ab5 | ||
|
|
7262b46a82 | ||
|
|
02942a04f9 | ||
|
|
0bfb11c62c | ||
|
|
e05af7442c | ||
|
|
bf416a7462 | ||
|
|
4d2d01b2c6 | ||
|
|
4b0d3b7147 | ||
|
|
352b8ed53d | ||
|
|
27384681a7 | ||
|
|
b13bdacf38 | ||
|
|
0f97d90490 | ||
|
|
0cb1c1f157 | ||
|
|
564bdab99e | ||
|
|
e0c0c68688 | ||
|
|
f4cbca56d5 | ||
|
|
6350b0a85f | ||
|
|
6b25476dbb | ||
|
|
c6d1a26a93 | ||
|
|
6f942f5774 | ||
|
|
2e27b02004 | ||
|
|
0ed5ce1ac3 | ||
|
|
febab17f07 | ||
|
|
8ef4ce4d61 | ||
|
|
6fd0ebcaa9 | ||
|
|
cd898f4a4d | ||
|
|
39a74ae6fb | ||
|
|
436081648b | ||
|
|
39123f964b | ||
|
|
8cf25a97a1 | ||
|
|
02898fed11 | ||
|
|
92e666e1c9 | ||
|
|
19b798fa99 | ||
|
|
6b6997362b | ||
|
|
8fc3f44e76 | ||
|
|
361e9c58c0 | ||
|
|
95496539e9 | ||
|
|
046b79a676 | ||
|
|
e3d7439551 | ||
|
|
219e8eb103 | ||
|
|
e25dd7db97 | ||
|
|
1ea564f5e8 | ||
|
|
9c5f5833e5 | ||
|
|
bf8bd7c4ad | ||
|
|
3504a438c2 | ||
|
|
b9e9a71dc3 | ||
|
|
9e205f4784 | ||
|
|
66c3631a2f | ||
|
|
078a92cd5c | ||
|
|
67a9e58f30 | ||
|
|
8174be2aec |
@@ -4,3 +4,6 @@
|
|||||||
tags
|
tags
|
||||||
/.vscode
|
/.vscode
|
||||||
/cscope.out
|
/cscope.out
|
||||||
|
/.cache
|
||||||
|
subprojects/libmbim
|
||||||
|
subprojects/libqmi
|
||||||
|
|||||||
+53
-10
@@ -12,8 +12,8 @@ stages:
|
|||||||
.common_variables:
|
.common_variables:
|
||||||
variables:
|
variables:
|
||||||
FDO_UPSTREAM_REPO: mobile-broadband/ModemManager
|
FDO_UPSTREAM_REPO: mobile-broadband/ModemManager
|
||||||
FDO_DISTRIBUTION_VERSION: '20.04'
|
FDO_DISTRIBUTION_VERSION: '22.04'
|
||||||
FDO_DISTRIBUTION_TAG: '2023-01-03.1'
|
FDO_DISTRIBUTION_TAG: '2026-01-05.1'
|
||||||
FDO_DISTRIBUTION_PACKAGES: ca-certificates git gcc meson ninja-build gawk
|
FDO_DISTRIBUTION_PACKAGES: ca-certificates git gcc meson ninja-build gawk
|
||||||
libgettextpo-dev libgirepository1.0-dev libglib2.0-dev
|
libgettextpo-dev libgirepository1.0-dev libglib2.0-dev
|
||||||
libgudev-1.0-dev python3-dbus python3-gi autopoint
|
libgudev-1.0-dev python3-dbus python3-gi autopoint
|
||||||
@@ -24,8 +24,11 @@ stages:
|
|||||||
LIBQMI_BRANCH: 'main'
|
LIBQMI_BRANCH: 'main'
|
||||||
LIBQRTR_BRANCH: 'main'
|
LIBQRTR_BRANCH: 'main'
|
||||||
LIBMBIM_BRANCH: 'main'
|
LIBMBIM_BRANCH: 'main'
|
||||||
|
BUILD_MBIM: true
|
||||||
|
BUILD_QMI: true
|
||||||
|
BUILD_QRTR: true
|
||||||
|
|
||||||
build container:
|
build_container:
|
||||||
extends:
|
extends:
|
||||||
- .fdo.container-build@ubuntu
|
- .fdo.container-build@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -36,11 +39,6 @@ build container:
|
|||||||
- tags
|
- tags
|
||||||
- schedules
|
- schedules
|
||||||
|
|
||||||
before_script:
|
|
||||||
- export BUILD_MBIM=true
|
|
||||||
- export BUILD_QMI=true
|
|
||||||
- export BUILD_QRTR=true
|
|
||||||
|
|
||||||
.prepare_deps: &prepare_deps
|
.prepare_deps: &prepare_deps
|
||||||
- >
|
- >
|
||||||
if [ "$BUILD_MBIM" == "true" ]; then
|
if [ "$BUILD_MBIM" == "true" ]; then
|
||||||
@@ -64,7 +62,7 @@ before_script:
|
|||||||
if [ "$BUILD_QMI" == "true" ]; then
|
if [ "$BUILD_QMI" == "true" ]; then
|
||||||
git clone --depth 1 --branch ${LIBQMI_BRANCH} https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
|
git clone --depth 1 --branch ${LIBQMI_BRANCH} https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
|
||||||
pushd libqmi
|
pushd libqmi
|
||||||
meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=false -Dbash_completion=false -Dmbim_qmux=$BUILD_MBIM -Dqrtr=$BUILD_QRTR -Dcollection=basic
|
meson setup build --prefix=/usr -Dgtk_doc=false -Dintrospection=false -Dbash_completion=false -Dmbim_qmux=$BUILD_MBIM -Dqrtr=$BUILD_QRTR
|
||||||
ninja -C build
|
ninja -C build
|
||||||
ninja -C build install
|
ninja -C build install
|
||||||
popd
|
popd
|
||||||
@@ -75,6 +73,8 @@ verify-dco:
|
|||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
only:
|
only:
|
||||||
- merge_requests
|
- merge_requests
|
||||||
script: |
|
script: |
|
||||||
@@ -91,6 +91,8 @@ verify-dco:
|
|||||||
|
|
||||||
build-no-qmi:
|
build-no-qmi:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -109,6 +111,8 @@ build-no-qmi:
|
|||||||
|
|
||||||
build-qmi-qrtr-no-mbim:
|
build-qmi-qrtr-no-mbim:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -126,6 +130,8 @@ build-qmi-qrtr-no-mbim:
|
|||||||
|
|
||||||
build-qmi-no-qrtr-no-mbim:
|
build-qmi-no-qrtr-no-mbim:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -144,6 +150,8 @@ build-qmi-no-qrtr-no-mbim:
|
|||||||
|
|
||||||
build-no-qmi-no-mbim:
|
build-no-qmi-no-mbim:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -164,6 +172,8 @@ build-no-qmi-no-mbim:
|
|||||||
|
|
||||||
build-no-qmi-no-mbim-no-tests:
|
build-no-qmi-no-mbim-no-tests:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -183,6 +193,8 @@ build-no-qmi-no-mbim-no-tests:
|
|||||||
|
|
||||||
build-no-deprecated:
|
build-no-deprecated:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -196,13 +208,15 @@ build-no-deprecated:
|
|||||||
- export BUILD_QRTR=false
|
- export BUILD_QRTR=false
|
||||||
- export BUILD_QMI=false
|
- export BUILD_QMI=false
|
||||||
- *prepare_deps
|
- *prepare_deps
|
||||||
- CFLAGS="-DMM_DISABLE_DEPRECATED" meson setup build --prefix=/usr -Dwerror=true -Dgtk_doc=false -Dqmi=false -Dqrtr=false -Dmbim=false
|
- meson setup build --prefix=/usr -Dwerror=true -Dgtk_doc=false -Dqmi=false -Dqrtr=false -Dmbim=false -Ddeprecated=false
|
||||||
- ninja -C build
|
- ninja -C build
|
||||||
- ninja -C build test
|
- ninja -C build test
|
||||||
- ninja -C build install
|
- ninja -C build install
|
||||||
|
|
||||||
build-no-suspend-resume:
|
build-no-suspend-resume:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -219,6 +233,8 @@ build-no-suspend-resume:
|
|||||||
|
|
||||||
build-suspend-resume-powerd:
|
build-suspend-resume-powerd:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -235,6 +251,8 @@ build-suspend-resume-powerd:
|
|||||||
|
|
||||||
build-single-plugins:
|
build-single-plugins:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -251,6 +269,8 @@ build-single-plugins:
|
|||||||
|
|
||||||
build-single-plugins-builtin:
|
build-single-plugins-builtin:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -267,6 +287,8 @@ build-single-plugins-builtin:
|
|||||||
|
|
||||||
build-debug:
|
build-debug:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -285,6 +307,8 @@ build-debug:
|
|||||||
|
|
||||||
build-release:
|
build-release:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -303,6 +327,8 @@ build-release:
|
|||||||
|
|
||||||
build-release-builtin:
|
build-release-builtin:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
extends:
|
extends:
|
||||||
- .fdo.distribution-image@ubuntu
|
- .fdo.distribution-image@ubuntu
|
||||||
- .common_variables
|
- .common_variables
|
||||||
@@ -318,3 +344,20 @@ build-release-builtin:
|
|||||||
- ninja -C build test
|
- ninja -C build test
|
||||||
- ninja -C build install
|
- ninja -C build install
|
||||||
- ninja -C build uninstall
|
- ninja -C build uninstall
|
||||||
|
|
||||||
|
build-asan:
|
||||||
|
stage: build
|
||||||
|
needs:
|
||||||
|
- build_container
|
||||||
|
extends:
|
||||||
|
- .fdo.distribution-image@ubuntu
|
||||||
|
- .common_variables
|
||||||
|
only:
|
||||||
|
- main
|
||||||
|
- merge_requests
|
||||||
|
- tags
|
||||||
|
- schedules
|
||||||
|
script:
|
||||||
|
- *prepare_deps
|
||||||
|
- meson setup build-asan -Db_sanitize=address -Dwerror=true -Dgtk_doc=false -Dqmi=true -Dqrtr=true -Dmbim=true
|
||||||
|
- meson test -C build-asan --suite=daemon --timeout-multiplier=5 --print-errorlogs
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
mm-enumflags-types.c.template
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
mm-enumflags-types.h.template
|
||||||
@@ -138,6 +138,7 @@ print_bearer_info (MMBearer *bearer)
|
|||||||
g_autoptr(MMBearerProperties) properties = NULL;
|
g_autoptr(MMBearerProperties) properties = NULL;
|
||||||
g_autoptr(MMBearerStats) stats = NULL;
|
g_autoptr(MMBearerStats) stats = NULL;
|
||||||
g_autoptr(GError) connection_error = NULL;
|
g_autoptr(GError) connection_error = NULL;
|
||||||
|
gboolean disconnect_request = FALSE;
|
||||||
gint profile_id;
|
gint profile_id;
|
||||||
gchar *profile_id_str;
|
gchar *profile_id_str;
|
||||||
|
|
||||||
@@ -147,6 +148,7 @@ print_bearer_info (MMBearer *bearer)
|
|||||||
stats = mm_bearer_get_stats (bearer);
|
stats = mm_bearer_get_stats (bearer);
|
||||||
profile_id = mm_bearer_get_profile_id (bearer);
|
profile_id = mm_bearer_get_profile_id (bearer);
|
||||||
connection_error = mm_bearer_get_connection_error (bearer);
|
connection_error = mm_bearer_get_connection_error (bearer);
|
||||||
|
disconnect_request = mm_bearer_get_disconnect_request (bearer);
|
||||||
|
|
||||||
profile_id_str = (profile_id != MM_3GPP_PROFILE_ID_UNKNOWN) ? g_strdup_printf ("%d", profile_id) : NULL;
|
profile_id_str = (profile_id != MM_3GPP_PROFILE_ID_UNKNOWN) ? g_strdup_printf ("%d", profile_id) : NULL;
|
||||||
|
|
||||||
@@ -156,6 +158,7 @@ print_bearer_info (MMBearer *bearer)
|
|||||||
mmcli_output_string (MMC_F_BEARER_STATUS_CONNECTED, mm_bearer_get_connected (bearer) ? "yes" : "no");
|
mmcli_output_string (MMC_F_BEARER_STATUS_CONNECTED, mm_bearer_get_connected (bearer) ? "yes" : "no");
|
||||||
mmcli_output_string_take (MMC_F_BEARER_STATUS_CONNECTION_ERROR_NAME, connection_error ? g_dbus_error_encode_gerror (connection_error) : NULL);
|
mmcli_output_string_take (MMC_F_BEARER_STATUS_CONNECTION_ERROR_NAME, connection_error ? g_dbus_error_encode_gerror (connection_error) : NULL);
|
||||||
mmcli_output_string (MMC_F_BEARER_STATUS_CONNECTION_ERROR_MESSAGE, connection_error ? connection_error->message : NULL);
|
mmcli_output_string (MMC_F_BEARER_STATUS_CONNECTION_ERROR_MESSAGE, connection_error ? connection_error->message : NULL);
|
||||||
|
mmcli_output_string (MMC_F_BEARER_STATUS_DISCONNECT_REQUEST, disconnect_request ? "yes" : "no");
|
||||||
mmcli_output_string (MMC_F_BEARER_STATUS_SUSPENDED, mm_bearer_get_suspended (bearer) ? "yes" : "no");
|
mmcli_output_string (MMC_F_BEARER_STATUS_SUSPENDED, mm_bearer_get_suspended (bearer) ? "yes" : "no");
|
||||||
mmcli_output_string (MMC_F_BEARER_STATUS_MULTIPLEXED, mm_bearer_get_multiplexed (bearer) ? "yes" : "no");
|
mmcli_output_string (MMC_F_BEARER_STATUS_MULTIPLEXED, mm_bearer_get_multiplexed (bearer) ? "yes" : "no");
|
||||||
mmcli_output_string (MMC_F_BEARER_STATUS_INTERFACE, mm_bearer_get_interface (bearer));
|
mmcli_output_string (MMC_F_BEARER_STATUS_INTERFACE, mm_bearer_get_interface (bearer));
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ mmcli_cbm_shutdown (void)
|
|||||||
static void
|
static void
|
||||||
print_cbm_info (MMCbm *cbm)
|
print_cbm_info (MMCbm *cbm)
|
||||||
{
|
{
|
||||||
|
const gchar *lang;
|
||||||
gchar *channel;
|
gchar *channel;
|
||||||
gchar *update;
|
gchar *update;
|
||||||
gchar *code;
|
gchar *code;
|
||||||
@@ -122,9 +123,12 @@ print_cbm_info (MMCbm *cbm)
|
|||||||
update = g_strdup_printf ("%u", mm_cbm_get_update (cbm));
|
update = g_strdup_printf ("%u", mm_cbm_get_update (cbm));
|
||||||
channel = g_strdup_printf ("%u", mm_cbm_get_channel (cbm));
|
channel = g_strdup_printf ("%u", mm_cbm_get_channel (cbm));
|
||||||
code = g_strdup_printf ("%u", mm_cbm_get_message_code (cbm));
|
code = g_strdup_printf ("%u", mm_cbm_get_message_code (cbm));
|
||||||
|
lang = mm_cbm_get_language (cbm);
|
||||||
|
|
||||||
mmcli_output_string (MMC_F_CBM_GENERAL_DBUS_PATH, mm_cbm_get_path (cbm));
|
mmcli_output_string (MMC_F_CBM_GENERAL_DBUS_PATH, mm_cbm_get_path (cbm));
|
||||||
mmcli_output_string (MMC_F_CBM_CONTENT_TEXT, mm_cbm_get_text (cbm));
|
mmcli_output_string (MMC_F_CBM_CONTENT_TEXT, mm_cbm_get_text (cbm));
|
||||||
|
if (lang)
|
||||||
|
mmcli_output_string (MMC_F_CBM_PROPERTIES_LANG, mm_cbm_get_language (cbm));
|
||||||
mmcli_output_string_take (MMC_F_CBM_PROPERTIES_CHANNEL, channel);
|
mmcli_output_string_take (MMC_F_CBM_PROPERTIES_CHANNEL, channel);
|
||||||
mmcli_output_string_take (MMC_F_CBM_PROPERTIES_UPDATE, update);
|
mmcli_output_string_take (MMC_F_CBM_PROPERTIES_UPDATE, update);
|
||||||
mmcli_output_string_take (MMC_F_CBM_PROPERTIES_MESSAGE_CODE, code);
|
mmcli_output_string_take (MMC_F_CBM_PROPERTIES_MESSAGE_CODE, code);
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ set_supl_server_process_reply (gboolean result,
|
|||||||
const GError *error)
|
const GError *error)
|
||||||
{
|
{
|
||||||
if (!result) {
|
if (!result) {
|
||||||
g_printerr ("error: couldn't set SUPL servert address: '%s'\n",
|
g_printerr ("error: couldn't set SUPL server address: '%s'\n",
|
||||||
error ? error->message : "unknown error");
|
error ? error->message : "unknown error");
|
||||||
exit (EXIT_FAILURE);
|
exit (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -458,7 +458,7 @@ mmcli_modem_signal_run_synchronous (GDBusConnection *connection)
|
|||||||
exit (EXIT_FAILURE);
|
exit (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_debug ("Asynchronously setting up threshold values...");
|
g_debug ("Synchronously setting up threshold values...");
|
||||||
result = mm_modem_signal_setup_thresholds_sync (ctx->modem_signal,
|
result = mm_modem_signal_setup_thresholds_sync (ctx->modem_signal,
|
||||||
properties,
|
properties,
|
||||||
NULL,
|
NULL,
|
||||||
|
|||||||
+11
-1
@@ -316,8 +316,11 @@ print_modem_info (void)
|
|||||||
MMModemBand *bands = NULL;
|
MMModemBand *bands = NULL;
|
||||||
guint n_bands = 0;
|
guint n_bands = 0;
|
||||||
MMModemPortInfo *ports = NULL;
|
MMModemPortInfo *ports = NULL;
|
||||||
|
MMModemPortInfo *ignored_ports = NULL;
|
||||||
guint n_ports = 0;
|
guint n_ports = 0;
|
||||||
|
guint n_ignored_ports = 0;
|
||||||
gchar *ports_string;
|
gchar *ports_string;
|
||||||
|
gchar *ignored_ports_string;
|
||||||
MMUnlockRetries *unlock_retries;
|
MMUnlockRetries *unlock_retries;
|
||||||
guint signal_quality = 0;
|
guint signal_quality = 0;
|
||||||
gboolean signal_quality_recent = FALSE;
|
gboolean signal_quality_recent = FALSE;
|
||||||
@@ -343,7 +346,12 @@ print_modem_info (void)
|
|||||||
g_free (bands);
|
g_free (bands);
|
||||||
mm_modem_get_ports (ctx->modem, &ports, &n_ports);
|
mm_modem_get_ports (ctx->modem, &ports, &n_ports);
|
||||||
ports_string = mm_common_build_ports_string (ports, n_ports);
|
ports_string = mm_common_build_ports_string (ports, n_ports);
|
||||||
mm_modem_port_info_array_free (ports, n_ports);
|
if (ports)
|
||||||
|
mm_modem_port_info_array_free (ports, n_ports);
|
||||||
|
mm_modem_get_ignored_ports (ctx->modem, &ignored_ports, &n_ignored_ports);
|
||||||
|
ignored_ports_string = mm_common_build_ports_string (ignored_ports, n_ignored_ports);
|
||||||
|
if (ignored_ports)
|
||||||
|
mm_modem_port_info_array_free (ignored_ports, n_ignored_ports);
|
||||||
if (mm_modem_get_current_modes (ctx->modem, &allowed_modes, &preferred_mode)) {
|
if (mm_modem_get_current_modes (ctx->modem, &allowed_modes, &preferred_mode)) {
|
||||||
allowed_modes_string = mm_modem_mode_build_string_from_mask (allowed_modes);
|
allowed_modes_string = mm_modem_mode_build_string_from_mask (allowed_modes);
|
||||||
preferred_mode_string = mm_modem_mode_build_string_from_mask (preferred_mode);
|
preferred_mode_string = mm_modem_mode_build_string_from_mask (preferred_mode);
|
||||||
@@ -376,6 +384,7 @@ print_modem_info (void)
|
|||||||
mmcli_output_string (MMC_F_SYSTEM_PLUGIN, mm_modem_get_plugin (ctx->modem));
|
mmcli_output_string (MMC_F_SYSTEM_PLUGIN, mm_modem_get_plugin (ctx->modem));
|
||||||
mmcli_output_string (MMC_F_SYSTEM_PRIMARY_PORT, mm_modem_get_primary_port (ctx->modem));
|
mmcli_output_string (MMC_F_SYSTEM_PRIMARY_PORT, mm_modem_get_primary_port (ctx->modem));
|
||||||
mmcli_output_string_list (MMC_F_SYSTEM_PORTS, ports_string);
|
mmcli_output_string_list (MMC_F_SYSTEM_PORTS, ports_string);
|
||||||
|
mmcli_output_string_list (MMC_F_SYSTEM_IGNORED_PORTS, ignored_ports_string);
|
||||||
|
|
||||||
mmcli_output_string_array (MMC_F_NUMBERS_OWN, (const gchar **) mm_modem_get_own_numbers (ctx->modem), FALSE);
|
mmcli_output_string_array (MMC_F_NUMBERS_OWN, (const gchar **) mm_modem_get_own_numbers (ctx->modem), FALSE);
|
||||||
|
|
||||||
@@ -540,6 +549,7 @@ print_modem_info (void)
|
|||||||
mmcli_output_dump ();
|
mmcli_output_dump ();
|
||||||
|
|
||||||
g_free (ports_string);
|
g_free (ports_string);
|
||||||
|
g_free (ignored_ports_string);
|
||||||
g_free (supported_ip_families_string);
|
g_free (supported_ip_families_string);
|
||||||
g_free (current_bands_string);
|
g_free (current_bands_string);
|
||||||
g_free (supported_bands_string);
|
g_free (supported_bands_string);
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ static FieldInfo field_infos[] = {
|
|||||||
[MMC_F_SYSTEM_PLUGIN] = { "modem.generic.plugin", "plugin", MMC_S_MODEM_SYSTEM, },
|
[MMC_F_SYSTEM_PLUGIN] = { "modem.generic.plugin", "plugin", MMC_S_MODEM_SYSTEM, },
|
||||||
[MMC_F_SYSTEM_PRIMARY_PORT] = { "modem.generic.primary-port", "primary port", MMC_S_MODEM_SYSTEM, },
|
[MMC_F_SYSTEM_PRIMARY_PORT] = { "modem.generic.primary-port", "primary port", MMC_S_MODEM_SYSTEM, },
|
||||||
[MMC_F_SYSTEM_PORTS] = { "modem.generic.ports", "ports", MMC_S_MODEM_SYSTEM, },
|
[MMC_F_SYSTEM_PORTS] = { "modem.generic.ports", "ports", MMC_S_MODEM_SYSTEM, },
|
||||||
|
[MMC_F_SYSTEM_IGNORED_PORTS] = { "modem.generic.ignored-ports", "ignored ports", MMC_S_MODEM_SYSTEM, },
|
||||||
[MMC_F_NUMBERS_OWN] = { "modem.generic.own-numbers", "own", MMC_S_MODEM_NUMBERS, },
|
[MMC_F_NUMBERS_OWN] = { "modem.generic.own-numbers", "own", MMC_S_MODEM_NUMBERS, },
|
||||||
[MMC_F_STATUS_LOCK] = { "modem.generic.unlock-required", "lock", MMC_S_MODEM_STATUS, },
|
[MMC_F_STATUS_LOCK] = { "modem.generic.unlock-required", "lock", MMC_S_MODEM_STATUS, },
|
||||||
[MMC_F_STATUS_UNLOCK_RETRIES] = { "modem.generic.unlock-retries", "unlock retries", MMC_S_MODEM_STATUS, },
|
[MMC_F_STATUS_UNLOCK_RETRIES] = { "modem.generic.unlock-retries", "unlock retries", MMC_S_MODEM_STATUS, },
|
||||||
@@ -241,6 +242,7 @@ static FieldInfo field_infos[] = {
|
|||||||
[MMC_F_BEARER_STATUS_CONNECTED] = { "bearer.status.connected", "connected", MMC_S_BEARER_STATUS, },
|
[MMC_F_BEARER_STATUS_CONNECTED] = { "bearer.status.connected", "connected", MMC_S_BEARER_STATUS, },
|
||||||
[MMC_F_BEARER_STATUS_CONNECTION_ERROR_NAME] = { "bearer.status.connection-error.name", "connection error name", MMC_S_BEARER_STATUS, },
|
[MMC_F_BEARER_STATUS_CONNECTION_ERROR_NAME] = { "bearer.status.connection-error.name", "connection error name", MMC_S_BEARER_STATUS, },
|
||||||
[MMC_F_BEARER_STATUS_CONNECTION_ERROR_MESSAGE] = { "bearer.status.connection-error.message", "connection error message", MMC_S_BEARER_STATUS, },
|
[MMC_F_BEARER_STATUS_CONNECTION_ERROR_MESSAGE] = { "bearer.status.connection-error.message", "connection error message", MMC_S_BEARER_STATUS, },
|
||||||
|
[MMC_F_BEARER_STATUS_DISCONNECT_REQUEST] = { "bearer.status.disconnect-request", "disconnect request", MMC_S_BEARER_STATUS, },
|
||||||
[MMC_F_BEARER_STATUS_SUSPENDED] = { "bearer.status.suspended", "suspended", MMC_S_BEARER_STATUS, },
|
[MMC_F_BEARER_STATUS_SUSPENDED] = { "bearer.status.suspended", "suspended", MMC_S_BEARER_STATUS, },
|
||||||
[MMC_F_BEARER_STATUS_MULTIPLEXED] = { "bearer.status.multiplexed", "multiplexed", MMC_S_BEARER_STATUS, },
|
[MMC_F_BEARER_STATUS_MULTIPLEXED] = { "bearer.status.multiplexed", "multiplexed", MMC_S_BEARER_STATUS, },
|
||||||
[MMC_F_BEARER_STATUS_INTERFACE] = { "bearer.status.interface", "interface", MMC_S_BEARER_STATUS, },
|
[MMC_F_BEARER_STATUS_INTERFACE] = { "bearer.status.interface", "interface", MMC_S_BEARER_STATUS, },
|
||||||
@@ -296,6 +298,7 @@ static FieldInfo field_infos[] = {
|
|||||||
[MMC_F_CBM_PROPERTIES_CHANNEL] = { "cbm.properties.channel", "channel", MMC_S_CBM_PROPERTIES, },
|
[MMC_F_CBM_PROPERTIES_CHANNEL] = { "cbm.properties.channel", "channel", MMC_S_CBM_PROPERTIES, },
|
||||||
[MMC_F_CBM_PROPERTIES_UPDATE] = { "cbm.properties.update", "update", MMC_S_CBM_PROPERTIES, },
|
[MMC_F_CBM_PROPERTIES_UPDATE] = { "cbm.properties.update", "update", MMC_S_CBM_PROPERTIES, },
|
||||||
[MMC_F_CBM_PROPERTIES_MESSAGE_CODE] = { "cbm.properties.message-code", "message code", MMC_S_CBM_PROPERTIES, },
|
[MMC_F_CBM_PROPERTIES_MESSAGE_CODE] = { "cbm.properties.message-code", "message code", MMC_S_CBM_PROPERTIES, },
|
||||||
|
[MMC_F_CBM_PROPERTIES_LANG ] = { "cbm.properties.lang", "lang", MMC_S_CBM_PROPERTIES, },
|
||||||
[MMC_F_SMS_GENERAL_DBUS_PATH] = { "sms.dbus-path", "path", MMC_S_SMS_GENERAL, },
|
[MMC_F_SMS_GENERAL_DBUS_PATH] = { "sms.dbus-path", "path", MMC_S_SMS_GENERAL, },
|
||||||
[MMC_F_SMS_CONTENT_NUMBER] = { "sms.content.number", "number", MMC_S_SMS_CONTENT, },
|
[MMC_F_SMS_CONTENT_NUMBER] = { "sms.content.number", "number", MMC_S_SMS_CONTENT, },
|
||||||
[MMC_F_SMS_CONTENT_TEXT] = { "sms.content.text", "text", MMC_S_SMS_CONTENT, },
|
[MMC_F_SMS_CONTENT_TEXT] = { "sms.content.text", "text", MMC_S_SMS_CONTENT, },
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ typedef enum {
|
|||||||
MMC_F_SYSTEM_PLUGIN,
|
MMC_F_SYSTEM_PLUGIN,
|
||||||
MMC_F_SYSTEM_PRIMARY_PORT,
|
MMC_F_SYSTEM_PRIMARY_PORT,
|
||||||
MMC_F_SYSTEM_PORTS,
|
MMC_F_SYSTEM_PORTS,
|
||||||
|
MMC_F_SYSTEM_IGNORED_PORTS,
|
||||||
/* Numbers section */
|
/* Numbers section */
|
||||||
MMC_F_NUMBERS_OWN,
|
MMC_F_NUMBERS_OWN,
|
||||||
/* Status section */
|
/* Status section */
|
||||||
@@ -259,6 +260,7 @@ typedef enum {
|
|||||||
MMC_F_BEARER_STATUS_CONNECTED,
|
MMC_F_BEARER_STATUS_CONNECTED,
|
||||||
MMC_F_BEARER_STATUS_CONNECTION_ERROR_NAME,
|
MMC_F_BEARER_STATUS_CONNECTION_ERROR_NAME,
|
||||||
MMC_F_BEARER_STATUS_CONNECTION_ERROR_MESSAGE,
|
MMC_F_BEARER_STATUS_CONNECTION_ERROR_MESSAGE,
|
||||||
|
MMC_F_BEARER_STATUS_DISCONNECT_REQUEST,
|
||||||
MMC_F_BEARER_STATUS_SUSPENDED,
|
MMC_F_BEARER_STATUS_SUSPENDED,
|
||||||
MMC_F_BEARER_STATUS_MULTIPLEXED,
|
MMC_F_BEARER_STATUS_MULTIPLEXED,
|
||||||
MMC_F_BEARER_STATUS_INTERFACE,
|
MMC_F_BEARER_STATUS_INTERFACE,
|
||||||
@@ -315,6 +317,7 @@ typedef enum {
|
|||||||
MMC_F_CBM_PROPERTIES_CHANNEL,
|
MMC_F_CBM_PROPERTIES_CHANNEL,
|
||||||
MMC_F_CBM_PROPERTIES_UPDATE,
|
MMC_F_CBM_PROPERTIES_UPDATE,
|
||||||
MMC_F_CBM_PROPERTIES_MESSAGE_CODE,
|
MMC_F_CBM_PROPERTIES_MESSAGE_CODE,
|
||||||
|
MMC_F_CBM_PROPERTIES_LANG,
|
||||||
MMC_F_SMS_GENERAL_DBUS_PATH,
|
MMC_F_SMS_GENERAL_DBUS_PATH,
|
||||||
MMC_F_SMS_CONTENT_NUMBER,
|
MMC_F_SMS_CONTENT_NUMBER,
|
||||||
MMC_F_SMS_CONTENT_TEXT,
|
MMC_F_SMS_CONTENT_TEXT,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ BusName=org.freedesktop.ModemManager1
|
|||||||
ExecStart=@sbindir@/ModemManager
|
ExecStart=@sbindir@/ModemManager
|
||||||
StandardError=null
|
StandardError=null
|
||||||
Restart=on-abort
|
Restart=on-abort
|
||||||
|
KillMode=mixed
|
||||||
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_NET_ADMIN
|
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_NET_ADMIN
|
||||||
ProtectSystem=true
|
ProtectSystem=true
|
||||||
ProtectHome=true
|
ProtectHome=true
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
# 2021 Aleksander Morgado <aleksander@aleksander.es>
|
# 2021 Aleksander Morgado <aleksander@aleksander.es>
|
||||||
# 2022 Thilo-Alexander Ginkel <thilo@ginkel.com>
|
# 2022 Thilo-Alexander Ginkel <thilo@ginkel.com>
|
||||||
# 2022 Bjørn Mork <bjorn@mork.no>
|
# 2022 Bjørn Mork <bjorn@mork.no>
|
||||||
|
# 2025 Kajetan Krykwiński <gitlab@kitor.pl>
|
||||||
#
|
#
|
||||||
# Foxconn SDX55 (Lenovo T99W175) FCC unlock operation
|
# Foxconn SDX55 (Lenovo T99W175) FCC unlock operation
|
||||||
#
|
#
|
||||||
@@ -22,7 +23,8 @@ for PORT in "$@"; do
|
|||||||
# match port type in Linux 5.14 and newer
|
# match port type in Linux 5.14 and newer
|
||||||
grep -q MBIM "/sys/class/wwan/$PORT/type" 2>/dev/null ||
|
grep -q MBIM "/sys/class/wwan/$PORT/type" 2>/dev/null ||
|
||||||
# match port name in Linux 5.13
|
# match port name in Linux 5.13
|
||||||
echo "$PORT" | grep -qi MBIM && {
|
echo "$PORT" | grep -qi MBIM ||
|
||||||
|
echo "$PORT" | grep -q cdc-wdm && {
|
||||||
MBIM_PORT="$PORT"
|
MBIM_PORT="$PORT"
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,131 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
# 2024 Thomas Vogt
|
||||||
|
#
|
||||||
|
# RPC-powered Intel XMM7360 (8086:7360) FCC unlock
|
||||||
|
|
||||||
|
if [[ "$FCC_UNLOCK_DEBUG_LOG" == '1' ]]; then
|
||||||
|
exec 3>&1 4>&2
|
||||||
|
trap 'exec 2>&4 1>&3' 0 1 2 3
|
||||||
|
exec 1>>/var/log/mm-xmm7360-fcc.log 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# require program name and at least 2 arguments
|
||||||
|
[ $# -lt 2 ] && exit 1
|
||||||
|
|
||||||
|
# first argument is DBus path, not needed here
|
||||||
|
shift
|
||||||
|
|
||||||
|
# second and next arguments are control port names
|
||||||
|
for PORT in "$@"; do
|
||||||
|
# support for XMM7360 has been added in 5.18
|
||||||
|
# match port type, assuming Linux 5.14 and newer
|
||||||
|
grep -q XMMRPC "/sys/class/wwan/$PORT/type" 2>/dev/null && {
|
||||||
|
XMMRPC_PORT=$PORT
|
||||||
|
break
|
||||||
|
}
|
||||||
|
done
|
||||||
|
|
||||||
|
# fail if no XMMRPC port exposed
|
||||||
|
[ -n "$XMMRPC_PORT" ] || exit 2
|
||||||
|
|
||||||
|
DEVICE=/dev/${XMMRPC_PORT}
|
||||||
|
|
||||||
|
log() {
|
||||||
|
echo "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
error() {
|
||||||
|
echo "$1" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
reverseHexEndianness() {
|
||||||
|
num="$1"
|
||||||
|
printf "%s" "${num:6:2}${num:4:2}${num:2:2}${num:0:2}"
|
||||||
|
}
|
||||||
|
|
||||||
|
littleEndianToDec() {
|
||||||
|
printf "%d" "0x$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
bigEndianToDec() {
|
||||||
|
littleEndianToDec "$(reverseHexEndianness "$1")"
|
||||||
|
}
|
||||||
|
|
||||||
|
readNBytesAsHex() {
|
||||||
|
data=$(head "-c$1" <&99 | xxd -p -c0 | tr -d '\n')
|
||||||
|
printf "%s" "$data"
|
||||||
|
}
|
||||||
|
|
||||||
|
writeHexAsBinary() {
|
||||||
|
printf "%s" "$1" | xxd -r -p >&99
|
||||||
|
}
|
||||||
|
|
||||||
|
readResponseAsHex() {
|
||||||
|
length_hex=$(readNBytesAsHex 4)
|
||||||
|
length=$(bigEndianToDec "$length_hex")
|
||||||
|
content=$(readNBytesAsHex $length)
|
||||||
|
printf "%s" "$length_hex$content"
|
||||||
|
}
|
||||||
|
|
||||||
|
rpc_command() {
|
||||||
|
exec 99<>"$DEVICE"
|
||||||
|
writeHexAsBinary $1
|
||||||
|
answer=$(readResponseAsHex) # ignore "async-ack" response
|
||||||
|
answer=$(readResponseAsHex)
|
||||||
|
printf "%s" "$answer"
|
||||||
|
exec 99>&-
|
||||||
|
}
|
||||||
|
|
||||||
|
VENDOR_ID_HASH="3df8c719"
|
||||||
|
|
||||||
|
for i in {1..3}; do
|
||||||
|
log "Attempt #${i} to unlock WWAN modem"
|
||||||
|
|
||||||
|
log "Requesting FCC lock state from modem"
|
||||||
|
# --> (async) csi-fcc-lock-query-req
|
||||||
|
RESP=$(rpc_command "1c00000002040000001c02040000018e11000101020411000101020400000000")
|
||||||
|
MODE=$(littleEndianToDec "${RESP: -8}")
|
||||||
|
STATE=$(littleEndianToDec "${RESP: -20:8}")
|
||||||
|
|
||||||
|
log "Got response from modem: state=$STATE, mode=$MODE"
|
||||||
|
|
||||||
|
if [ "$MODE" = "0" ]; then
|
||||||
|
log "FCC lock is deactivated, nothing to do."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$STATE" != "0" ]; then
|
||||||
|
log "FCC already unlocked, nothing to do."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Requesting challenge from modem"
|
||||||
|
# --> (async) csi-fcc-lock-gen-challenge-req
|
||||||
|
RESP=$(rpc_command "1c00000002040000001c02040000019011000101020411000101020400000000")
|
||||||
|
HEX_CHALLENGE=$(printf "%s" "${RESP: -8}")
|
||||||
|
|
||||||
|
log "Got challenge from modem: $HEX_CHALLENGE"
|
||||||
|
REVERSE_HEX_CHALLENGE=$(reverseHexEndianness "${HEX_CHALLENGE}")
|
||||||
|
COMBINED_CHALLENGE="${REVERSE_HEX_CHALLENGE}${VENDOR_ID_HASH}"
|
||||||
|
RESPONSE_HASH=$(printf "%s" "$COMBINED_CHALLENGE" | xxd -r -p | sha256sum | cut -d ' ' -f 1)
|
||||||
|
REVERSED_RESPONSE=$(reverseHexEndianness "${RESPONSE_HASH:0:8}")
|
||||||
|
|
||||||
|
log "Sending hash to modem: $REVERSED_RESPONSE"
|
||||||
|
# --> (async) csi-fcc-lock-ver-challenge-req
|
||||||
|
RESP=$(rpc_command "1c00000002040000001c020400000192110001010204110001010204${REVERSED_RESPONSE}")
|
||||||
|
UNLOCK_RESPONSE=$(littleEndianToDec "${RESP: -8}")
|
||||||
|
|
||||||
|
if [ "$UNLOCK_RESPONSE" = "0" ]; then
|
||||||
|
error "Unlock failed."
|
||||||
|
else
|
||||||
|
log "FCC unlock successful (response $UNLOCK_RESPONSE)"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 0.5
|
||||||
|
done
|
||||||
|
|
||||||
|
exit 2
|
||||||
|
|
||||||
@@ -15,6 +15,7 @@ examples = files(
|
|||||||
'1199',
|
'1199',
|
||||||
'14c3',
|
'14c3',
|
||||||
'2c7c',
|
'2c7c',
|
||||||
|
'8086:7360',
|
||||||
)
|
)
|
||||||
|
|
||||||
install_data(
|
install_data(
|
||||||
@@ -26,6 +27,7 @@ install_data(
|
|||||||
vidpids = {
|
vidpids = {
|
||||||
'105b:e0ab': '105b',
|
'105b:e0ab': '105b',
|
||||||
'105b:e0c3': '105b',
|
'105b:e0c3': '105b',
|
||||||
|
'05c6:90d5': '105b',
|
||||||
'03f0:4e1d': '1199',
|
'03f0:4e1d': '1199',
|
||||||
'1199:9079': '1199',
|
'1199:9079': '1199',
|
||||||
'413c:81a3': '1199',
|
'413c:81a3': '1199',
|
||||||
|
|||||||
@@ -71,6 +71,10 @@
|
|||||||
send_interface="org.freedesktop.ModemManager1.Modem"
|
send_interface="org.freedesktop.ModemManager1.Modem"
|
||||||
send_member="SetCurrentModes"/>
|
send_member="SetCurrentModes"/>
|
||||||
|
|
||||||
|
<allow send_destination="org.freedesktop.ModemManager1"
|
||||||
|
send_interface="org.freedesktop.ModemManager1.Modem"
|
||||||
|
send_member="SetPrimarySimSlot"/>
|
||||||
|
|
||||||
<allow send_destination="org.freedesktop.ModemManager1"
|
<allow send_destination="org.freedesktop.ModemManager1"
|
||||||
send_interface="org.freedesktop.ModemManager1.Modem"
|
send_interface="org.freedesktop.ModemManager1.Modem"
|
||||||
send_member="SetCurrentBands"/>
|
send_member="SetCurrentBands"/>
|
||||||
@@ -351,6 +355,10 @@
|
|||||||
send_interface="org.freedesktop.ModemManager1.Modem.Signal"
|
send_interface="org.freedesktop.ModemManager1.Modem.Signal"
|
||||||
send_member="Setup"/>
|
send_member="Setup"/>
|
||||||
|
|
||||||
|
<allow send_destination="org.freedesktop.ModemManager1"
|
||||||
|
send_interface="org.freedesktop.ModemManager1.Modem.Signal"
|
||||||
|
send_member="SetupThresholds"/>
|
||||||
|
|
||||||
<!-- org.freedesktop.ModemManager1.Modem.Time.xml -->
|
<!-- org.freedesktop.ModemManager1.Modem.Time.xml -->
|
||||||
|
|
||||||
<!-- Protected by the Time policy rule -->
|
<!-- Protected by the Time policy rule -->
|
||||||
@@ -358,6 +366,22 @@
|
|||||||
send_interface="org.freedesktop.ModemManager1.Modem.Time"
|
send_interface="org.freedesktop.ModemManager1.Modem.Time"
|
||||||
send_member="GetNetworkTime"/>
|
send_member="GetNetworkTime"/>
|
||||||
|
|
||||||
|
<!-- org.freedesktop.ModemManager1.Modem.CellBroadcast.xml -->
|
||||||
|
|
||||||
|
<!-- Allowed for everyone -->
|
||||||
|
<allow send_destination="org.freedesktop.ModemManager1"
|
||||||
|
send_interface="org.freedesktop.ModemManager1.Modem.CellBroadcast"
|
||||||
|
send_member="List"/>
|
||||||
|
|
||||||
|
<!-- Protected by the CellBroadcast policy rule -->
|
||||||
|
<allow send_destination="org.freedesktop.ModemManager1"
|
||||||
|
send_interface="org.freedesktop.ModemManager1.Modem.CellBroadcast"
|
||||||
|
send_member="Delete"/>
|
||||||
|
|
||||||
|
<!-- Protected by the Device.Control policy rule -->
|
||||||
|
<allow send_destination="org.freedesktop.ModemManager1"
|
||||||
|
send_interface="org.freedesktop.ModemManager1.Modem.CellBroadcast"
|
||||||
|
send_member="SetChannels"/>
|
||||||
</policy>
|
</policy>
|
||||||
|
|
||||||
<policy user="root">
|
<policy user="root">
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<action id="org.freedesktop.ModemManager1.CellBroadcast">
|
<action id="org.freedesktop.ModemManager1.CellBroadcast">
|
||||||
<description>Enable and view Cell Broadcast messages</description>
|
<description>Enable and view Cell Broadcast messages</description>
|
||||||
<message>System policy prevents enabling or viewing this device's text messages.</message>
|
<message>System policy prevents enabling or viewing this device's cell broadcast messages.</message>
|
||||||
<defaults>
|
<defaults>
|
||||||
<allow_inactive>no</allow_inactive>
|
<allow_inactive>no</allow_inactive>
|
||||||
<allow_active>@MM_DEFAULT_USER_POLICY@</allow_active>
|
<allow_active>@MM_DEFAULT_USER_POLICY@</allow_active>
|
||||||
@@ -27,6 +27,15 @@
|
|||||||
</defaults>
|
</defaults>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
|
<action id="org.freedesktop.ModemManager1.Modem.SetPrimarySimSlot">
|
||||||
|
<description>Set the primary sim slot of a modem</description>
|
||||||
|
<message>System policy prevents configuring modem properties.</message>
|
||||||
|
<defaults>
|
||||||
|
<allow_inactive>no</allow_inactive>
|
||||||
|
<allow_active>@MM_DEFAULT_USER_POLICY@</allow_active>
|
||||||
|
</defaults>
|
||||||
|
</action>
|
||||||
|
|
||||||
<action id="org.freedesktop.ModemManager1.Device.Control">
|
<action id="org.freedesktop.ModemManager1.Device.Control">
|
||||||
<description>Unlock and control a mobile broadband device</description>
|
<description>Unlock and control a mobile broadband device</description>
|
||||||
<message>System policy prevents unlocking or controlling the mobile broadband device.</message>
|
<message>System policy prevents unlocking or controlling the mobile broadband device.</message>
|
||||||
|
|||||||
+59
-26
@@ -176,8 +176,10 @@ in use, like \fIBearer\fR. For example:
|
|||||||
.RE
|
.RE
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-m, \-\-modem=[PATH|INDEX]
|
.B \-m, \-\-modem=[PATH|INDEX|any]
|
||||||
Specify a modem.
|
Specify a modem via full D-Bus object path, modem index, or 'any'. 'any' selects
|
||||||
|
the first available modem regardless of index or path, which can simplify
|
||||||
|
operation for single-modem systems.
|
||||||
.TP
|
.TP
|
||||||
.B \-b, \-\-bearer=[PATH|INDEX]
|
.B \-b, \-\-bearer=[PATH|INDEX]
|
||||||
Specify a bearer.
|
Specify a bearer.
|
||||||
@@ -496,6 +498,10 @@ This DBus property signal updates are by default disabled.
|
|||||||
.B \-\-location\-set\-disable\-signal
|
.B \-\-location\-set\-disable\-signal
|
||||||
Disable reporting location updates via DBus property signals.
|
Disable reporting location updates via DBus property signals.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-\-location\-monitor
|
||||||
|
Continuously monitor all available location information.
|
||||||
|
|
||||||
.SH MESSAGING OPTIONS
|
.SH MESSAGING OPTIONS
|
||||||
All messaging options must be used with \fB\-\-modem\fR or \fB\-m\fR.
|
All messaging options must be used with \fB\-\-modem\fR or \fB\-m\fR.
|
||||||
|
|
||||||
@@ -764,7 +770,7 @@ Set the list of channels on which cell broadcasts are received (e.g. \fB5370,537
|
|||||||
You'll need first to know which the proper path/index is for the SIM in your
|
You'll need first to know which the proper path/index is for the SIM in your
|
||||||
modem:
|
modem:
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ mmcli -m 0 -K | grep "modem.generic.sim" | awk -F ": " '{ print $2 }'
|
$ mmcli -m any -K | grep "modem.generic.sim" | awk -F ": " '{ print $2 }'
|
||||||
/org/freedesktop/ModemManager1/SIM/0
|
/org/freedesktop/ModemManager1/SIM/0
|
||||||
.Ed
|
.Ed
|
||||||
|
|
||||||
@@ -778,13 +784,13 @@ And after that, you can just use the SIM index:
|
|||||||
|
|
||||||
You can launch the simple connection process like:
|
You can launch the simple connection process like:
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ sudo mmcli -m 0 --simple-connect="pin=1234,apn=internet"
|
$ sudo mmcli -m any --simple-connect="pin=1234,apn=internet"
|
||||||
successfully connected the modem
|
successfully connected the modem
|
||||||
.Ed
|
.Ed
|
||||||
|
|
||||||
Then, you can disconnect it like:
|
Then, you can disconnect it like:
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ sudo mmcli -m 0 --simple-disconnect
|
$ sudo mmcli -m any --simple-disconnect
|
||||||
successfully disconnected all bearers in the modem
|
successfully disconnected all bearers in the modem
|
||||||
.Ed
|
.Ed
|
||||||
|
|
||||||
@@ -793,7 +799,7 @@ Then, you can disconnect it like:
|
|||||||
Scanning for 3GPP networks may really take a long time, so a specific timeout
|
Scanning for 3GPP networks may really take a long time, so a specific timeout
|
||||||
must be given:
|
must be given:
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ sudo mmcli -m 0 --3gpp-scan --timeout=300
|
$ sudo mmcli -m any --3gpp-scan --timeout=300
|
||||||
---------------------
|
---------------------
|
||||||
3GPP scan | networks: 21403 - Orange SP (gprs, unknown)
|
3GPP scan | networks: 21403 - Orange SP (gprs, unknown)
|
||||||
| 21407 - Movistar (gprs, unknown)
|
| 21407 - Movistar (gprs, unknown)
|
||||||
@@ -806,7 +812,7 @@ must be given:
|
|||||||
Using the “sm” (SIM), you can do this using:
|
Using the “sm” (SIM), you can do this using:
|
||||||
|
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ sudo mmcli -m 0 --messaging-create-sms="text='Hello world',number='+1234567890'"
|
$ sudo mmcli -m any --messaging-create-sms="text='Hello world',number='+1234567890'"
|
||||||
Successfully created new SMS:
|
Successfully created new SMS:
|
||||||
/org/freedesktop/ModemManager1/SMS/21 (unknown)
|
/org/freedesktop/ModemManager1/SMS/21 (unknown)
|
||||||
|
|
||||||
@@ -829,7 +835,7 @@ Using the “sm” (SIM), you can do this using:
|
|||||||
| delivery report: not requested
|
| delivery report: not requested
|
||||||
| message reference: 0
|
| message reference: 0
|
||||||
|
|
||||||
$ sudo mmcli -m 0 --messaging-status
|
$ sudo mmcli -m any --messaging-status
|
||||||
----------------------------
|
----------------------------
|
||||||
Messaging | supported storages: sm, me
|
Messaging | supported storages: sm, me
|
||||||
| default storage: me
|
| default storage: me
|
||||||
@@ -841,7 +847,7 @@ As you can see below, the important part is the
|
|||||||
\fB\-\-messaging\-create\-sms\-with\-data\fR and the \fBPATH\fR provided.
|
\fB\-\-messaging\-create\-sms\-with\-data\fR and the \fBPATH\fR provided.
|
||||||
|
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ sudo mmcli -m 0 \\
|
$ sudo mmcli -m any \\
|
||||||
--messaging-create-sms="number='+1234567890'" \\
|
--messaging-create-sms="number='+1234567890'" \\
|
||||||
--messaging-create-sms-with-data=/path/to/your/file
|
--messaging-create-sms-with-data=/path/to/your/file
|
||||||
Successfully created new SMS:
|
Successfully created new SMS:
|
||||||
@@ -858,7 +864,7 @@ recover the sent file with another \fBmmcli\fR command in their
|
|||||||
ModemManager setup:
|
ModemManager setup:
|
||||||
|
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$> sudo mmcli -m 0 --messaging-list-sms
|
$> sudo mmcli -m any --messaging-list-sms
|
||||||
/org/freedesktop/ModemManager1/SMS/0 (received)
|
/org/freedesktop/ModemManager1/SMS/0 (received)
|
||||||
|
|
||||||
$> sudo mmcli -s 0 --create-file-with-data=/path/to/the/output/file
|
$> sudo mmcli -s 0 --create-file-with-data=/path/to/the/output/file
|
||||||
@@ -872,7 +878,7 @@ if you have more than one modem, just use --list-modems to check the
|
|||||||
proper modem index:
|
proper modem index:
|
||||||
|
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ mmcli -m 0 --location-status
|
$ mmcli -m any --location-status
|
||||||
----------------------------
|
----------------------------
|
||||||
Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea
|
Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea
|
||||||
| enabled: none
|
| enabled: none
|
||||||
@@ -884,10 +890,10 @@ ID, GPS raw and GPS-NMEA location sources. None is enabled yet, as we
|
|||||||
didn’t enable the modem, which we can do issuing:
|
didn’t enable the modem, which we can do issuing:
|
||||||
|
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ sudo mmcli -m 0 --enable
|
$ sudo mmcli -m any --enable
|
||||||
successfully enabled the modem
|
successfully enabled the modem
|
||||||
|
|
||||||
$ mmcli -m 0 --location-status
|
$ mmcli -m any --location-status
|
||||||
----------------------------
|
----------------------------
|
||||||
Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea
|
Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea
|
||||||
| enabled: 3gpp-lac-ci
|
| enabled: 3gpp-lac-ci
|
||||||
@@ -899,7 +905,7 @@ didn’t enable the modem, which we can do issuing:
|
|||||||
We can start the GPS engine by enabling the RAW or NMEA GPS location sources:
|
We can start the GPS engine by enabling the RAW or NMEA GPS location sources:
|
||||||
|
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ sudo mmcli -m 0 \\
|
$ sudo mmcli -m any \\
|
||||||
--location-enable-gps-raw \\
|
--location-enable-gps-raw \\
|
||||||
--location-enable-gps-nmea
|
--location-enable-gps-nmea
|
||||||
successfully setup location gathering
|
successfully setup location gathering
|
||||||
@@ -908,7 +914,7 @@ We can start the GPS engine by enabling the RAW or NMEA GPS location sources:
|
|||||||
If we do check again the status, we’ll see the GPS-specific locations are enabled:
|
If we do check again the status, we’ll see the GPS-specific locations are enabled:
|
||||||
|
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ mmcli -m 0 --location-status
|
$ mmcli -m any --location-status
|
||||||
--------------------------------
|
--------------------------------
|
||||||
Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea
|
Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea
|
||||||
| enabled: 3gpp-lac-ci, gps-raw, gps-nmea
|
| enabled: 3gpp-lac-ci, gps-raw, gps-nmea
|
||||||
@@ -922,7 +928,7 @@ If any of the specific outputs is not available, the corresponding section will
|
|||||||
be omitted from the output.
|
be omitted from the output.
|
||||||
|
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ sudo mmcli -m 0 --location-get
|
$ sudo mmcli -m any --location-get
|
||||||
-------------------------
|
-------------------------
|
||||||
3GPP location | Mobile country code: 214
|
3GPP location | Mobile country code: 214
|
||||||
| Mobile network code: 3
|
| Mobile network code: 3
|
||||||
@@ -939,6 +945,33 @@ be omitted from the output.
|
|||||||
| $GPVTG,,T,,M,,N,,K,N*2C
|
| $GPVTG,,T,,M,,N,,K,N*2C
|
||||||
.Ed
|
.Ed
|
||||||
|
|
||||||
|
Location information may be continuously monitored using
|
||||||
|
\fB\-\-location\-monitor\fR, which watches 'Location' property updates. Note
|
||||||
|
that these updates must first be enabled with
|
||||||
|
\fB\-\-location\-set\-enable\-signal\fR.
|
||||||
|
|
||||||
|
.Bd -literal -compact
|
||||||
|
$ sudo mmcli -m 0 --location-set-gps-refresh-rate=10
|
||||||
|
successfully set GPS refresh rate
|
||||||
|
|
||||||
|
$ sudo mmcli -m 0 --location-enable-gps-nmea --location-set-enable-signal
|
||||||
|
successfully setup location gathering
|
||||||
|
|
||||||
|
$ sudo mmcli -m 0 --location-monitor
|
||||||
|
-----------
|
||||||
|
GPS | nmea: $GPGSA,A,2,03,04,06,07,09,,,,,,,,1.7,1.4,1.0*3E
|
||||||
|
| $GPGSV,3,1,11,03,38,123,37,04,56,037,18,06,41,277,21,07,52,209,32*75
|
||||||
|
| $GPGSV,3,2,11,09,61,320,23,11,17,313,19,30,12,217,24,01,02,168,*77
|
||||||
|
| $GPGSV,3,3,11,16,21,077,,26,13,047,,40,,,36*79
|
||||||
|
| $GPGGA,152454.00,3651.420706,N,03101.297031,E,1,05,1.4,128.4,M,32.0,M,,*6A
|
||||||
|
-----------
|
||||||
|
GPS | nmea: $GPGSA,A,2,03,04,06,07,09,,,,,,,,1.7,1.4,1.0*3E
|
||||||
|
| $GPGSV,3,1,11,03,38,123,37,04,56,037,24,06,41,277,20,07,52,209,33*7A
|
||||||
|
| $GPGSV,3,2,11,09,61,320,23,11,17,313,18,30,12,217,23,01,02,168,*71
|
||||||
|
| $GPGSV,3,3,11,16,21,077,,26,13,047,,40,,,36*79
|
||||||
|
| $GPGGA,152504.00,3651.420036,N,03101.297176,E,1,05,1.4,60.7,M,32.0,M,,*56
|
||||||
|
.Ed
|
||||||
|
|
||||||
.SS A-GPS support
|
.SS A-GPS support
|
||||||
|
|
||||||
If A-GPS is enabled before starting the GPS engine, and if a data connection
|
If A-GPS is enabled before starting the GPS engine, and if a data connection
|
||||||
@@ -950,7 +983,7 @@ enabled. An explicit output (RAW or NMEA) is required to be enabled in order
|
|||||||
to start the GPS engine.
|
to start the GPS engine.
|
||||||
|
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ mmcli -m 0 --location-status
|
$ mmcli -m any --location-status
|
||||||
--------------------------------
|
--------------------------------
|
||||||
Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea, agps-msa, agps-msb
|
Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea, agps-msa, agps-msb
|
||||||
| enabled: 3gpp-lac-ci
|
| enabled: 3gpp-lac-ci
|
||||||
@@ -959,13 +992,13 @@ to start the GPS engine.
|
|||||||
GPS | refresh rate: 30 seconds
|
GPS | refresh rate: 30 seconds
|
||||||
| a-gps supl server: supl.google.com:7276
|
| a-gps supl server: supl.google.com:7276
|
||||||
|
|
||||||
$ sudo mmcli -m 0 --location-enable-agps-msa
|
$ sudo mmcli -m any --location-enable-agps-msa
|
||||||
successfully setup location gathering
|
successfully setup location gathering
|
||||||
|
|
||||||
$ sudo mmcli -m 0 --location-enable-gps-nmea
|
$ sudo mmcli -m any --location-enable-gps-nmea
|
||||||
successfully setup location gathering
|
successfully setup location gathering
|
||||||
|
|
||||||
$ sudo mmcli -m 0 --location-enable-gps-raw
|
$ sudo mmcli -m any --location-enable-gps-raw
|
||||||
successfully setup location gathering
|
successfully setup location gathering
|
||||||
.Ed
|
.Ed
|
||||||
|
|
||||||
@@ -981,7 +1014,7 @@ one of the servers listed by ModemManager and manually inject it afterwards. The
|
|||||||
XTRA assistance data is usually valid for several days.
|
XTRA assistance data is usually valid for several days.
|
||||||
|
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ mmcli -m 0 --location-status
|
$ mmcli -m any --location-status
|
||||||
--------------------------------
|
--------------------------------
|
||||||
Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea, agps-msa, agps-msb
|
Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea, agps-msa, agps-msb
|
||||||
| enabled: 3gpp-lac-ci
|
| enabled: 3gpp-lac-ci
|
||||||
@@ -996,13 +1029,13 @@ XTRA assistance data is usually valid for several days.
|
|||||||
|
|
||||||
$ wget -q https://xtrapath3.izatcloud.net/xtra3grcej.bin
|
$ wget -q https://xtrapath3.izatcloud.net/xtra3grcej.bin
|
||||||
|
|
||||||
$ sudo mmcli -m 0 --location-inject-assistance-data=./xtra3grcej.bin
|
$ sudo mmcli -m any --location-inject-assistance-data=./xtra3grcej.bin
|
||||||
successfully injected assistance data
|
successfully injected assistance data
|
||||||
|
|
||||||
$ sudo mmcli -m 0 --location-enable-gps-nmea
|
$ sudo mmcli -m any --location-enable-gps-nmea
|
||||||
successfully setup location gathering
|
successfully setup location gathering
|
||||||
|
|
||||||
$ sudo mmcli -m 0 --location-enable-gps-raw
|
$ sudo mmcli -m any --location-enable-gps-raw
|
||||||
successfully setup location gathering
|
successfully setup location gathering
|
||||||
.Ed
|
.Ed
|
||||||
|
|
||||||
@@ -1011,7 +1044,7 @@ XTRA assistance data is usually valid for several days.
|
|||||||
The channel list can be set as a comma separated list of channels or channel intervals:
|
The channel list can be set as a comma separated list of channels or channel intervals:
|
||||||
|
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ sudo mmcli -m 0 \\
|
$ sudo mmcli -m any \\
|
||||||
--cell-broadcast-set-channels=5370,5371,5373-5000
|
--cell-broadcast-set-channels=5370,5371,5373-5000
|
||||||
successfully set channels in the modem
|
successfully set channels in the modem
|
||||||
.Ed
|
.Ed
|
||||||
@@ -1024,7 +1057,7 @@ example, you could gather all the main status information of the modem
|
|||||||
with a single call and then parse it to read single fields:
|
with a single call and then parse it to read single fields:
|
||||||
|
|
||||||
.Bd -literal -compact
|
.Bd -literal -compact
|
||||||
$ STATUS=$(mmcli -m 0 --output-keyvalue)
|
$ STATUS=$(mmcli -m any --output-keyvalue)
|
||||||
$ echo "${STATUS}" | grep "modem.generic.state " | awk -F ": " '{ print $2 }'
|
$ echo "${STATUS}" | grep "modem.generic.state " | awk -F ": " '{ print $2 }'
|
||||||
failed
|
failed
|
||||||
$ echo "${STATUS}" | grep "modem.generic.state-failed-reason " | awk -F ": " '{ print $2 }'
|
$ echo "${STATUS}" | grep "modem.generic.state-failed-reason " | awk -F ": " '{ print $2 }'
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
This object also controls any process-wide operation, such as the log
|
This object also controls any process-wide operation, such as the log
|
||||||
level being used by the daemon.
|
level being used by the daemon.
|
||||||
</para>
|
</para>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.xml"/>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
<chapter id="ref-dbus-object-modem">
|
<chapter id="ref-dbus-object-modem">
|
||||||
@@ -129,22 +129,22 @@
|
|||||||
or the
|
or the
|
||||||
<link linkend="gdbus-org.freedesktop.ModemManager1.Modem.ModemCdma">CDMA interface</link>.
|
<link linkend="gdbus-org.freedesktop.ModemManager1.Modem.ModemCdma">CDMA interface</link>.
|
||||||
</para>
|
</para>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Voice.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Voice.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.CellBroadcast.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.CellBroadcast.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Sar.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Sar.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml"/>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml"/>
|
||||||
<!--xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Contacts.xml"/-->
|
<!--xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Contacts.xml"/-->
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
<chapter id="ref-dbus-object-bearer">
|
<chapter id="ref-dbus-object-bearer">
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
may expose one or more Bearer objects, which can then be used to get the
|
may expose one or more Bearer objects, which can then be used to get the
|
||||||
modem into connected state.
|
modem into connected state.
|
||||||
</para>
|
</para>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml"/>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
<chapter id="ref-dbus-object-sim">
|
<chapter id="ref-dbus-object-sim">
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
expose up to one SIM object, which allows SIM-specific actions such as PIN
|
expose up to one SIM object, which allows SIM-specific actions such as PIN
|
||||||
unlocking.
|
unlocking.
|
||||||
</para>
|
</para>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Sim.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Sim.xml"/>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
<chapter id="ref-dbus-object-sms">
|
<chapter id="ref-dbus-object-sms">
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
<link linkend="gdbus-org.freedesktop.ModemManager1.Modem.Messaging">Messaging interface</link>
|
<link linkend="gdbus-org.freedesktop.ModemManager1.Modem.Messaging">Messaging interface</link>
|
||||||
will export one SMS object for each SMS stored in the device.
|
will export one SMS object for each SMS stored in the device.
|
||||||
</para>
|
</para>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml"/>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
<chapter id="ref-dbus-object-call">
|
<chapter id="ref-dbus-object-call">
|
||||||
@@ -186,17 +186,17 @@
|
|||||||
<link linkend="gdbus-org.freedesktop.ModemManager1.Modem.Voice">Voice interface</link>
|
<link linkend="gdbus-org.freedesktop.ModemManager1.Modem.Voice">Voice interface</link>
|
||||||
will export one Call object for each Call managed in the device.
|
will export one Call object for each Call managed in the device.
|
||||||
</para>
|
</para>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Call.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Call.xml"/>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
<chapter id="ref-dbus-object-call">
|
<chapter id="ref-dbus-object-cbm">
|
||||||
<title>The <literal>/org/freedesktop/ModemManager/CBM</literal> objects</title>
|
<title>The <literal>/org/freedesktop/ModemManager/CBM</literal> objects</title>
|
||||||
<para>
|
<para>
|
||||||
Modems implementing the
|
Modems implementing the
|
||||||
<link linkend="gdbus-org.freedesktop.ModemManager1.Modem.CellBroadcast">Cell Broadcast interface</link>
|
<link linkend="gdbus-org.freedesktop.ModemManager1.Modem.CellBroadcast">Cell Broadcast interface</link>
|
||||||
will export one CBM object for each Cell Broadcast message received by the device.
|
will export one CBM object for each Cell Broadcast message received by the device.
|
||||||
</para>
|
</para>
|
||||||
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Call.xml"/>
|
<xi:include href="mm-gdbus-doc-org.freedesktop.ModemManager1.Cbm.xml"/>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
</part>
|
</part>
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ ID_MM_TTY_BAUDRATE
|
|||||||
ID_MM_TTY_FLOW_CONTROL
|
ID_MM_TTY_FLOW_CONTROL
|
||||||
ID_MM_REQUIRED
|
ID_MM_REQUIRED
|
||||||
ID_MM_MAX_MULTIPLEXED_LINKS
|
ID_MM_MAX_MULTIPLEXED_LINKS
|
||||||
|
ID_MM_INITIAL_QMAP_MUX_ID
|
||||||
<SUBSECTION Deprecated>
|
<SUBSECTION Deprecated>
|
||||||
ID_MM_TTY_BLACKLIST
|
ID_MM_TTY_BLACKLIST
|
||||||
ID_MM_TTY_MANUAL_SCAN_ONLY
|
ID_MM_TTY_MANUAL_SCAN_ONLY
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ expand_content_files = [
|
|||||||
'ModemManager-overview.xml',
|
'ModemManager-overview.xml',
|
||||||
# FIXME: workaround because only strings can be included and not custom targets (gen_docs)
|
# FIXME: workaround because only strings can be included and not custom targets (gen_docs)
|
||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml',
|
||||||
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Call.xml',
|
||||||
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Cbm.xml',
|
||||||
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.CellBroadcast.xml',
|
||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml',
|
||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml',
|
||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml',
|
||||||
@@ -30,9 +33,11 @@ expand_content_files = [
|
|||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml',
|
||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml',
|
||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml',
|
||||||
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Sar.xml',
|
||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml',
|
||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml',
|
||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml',
|
||||||
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Voice.xml',
|
||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml',
|
||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Sim.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Sim.xml',
|
||||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml',
|
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml',
|
||||||
|
|||||||
@@ -1448,6 +1448,7 @@ mm_bearer_dup_path
|
|||||||
mm_bearer_get_interface
|
mm_bearer_get_interface
|
||||||
mm_bearer_dup_interface
|
mm_bearer_dup_interface
|
||||||
mm_bearer_get_connected
|
mm_bearer_get_connected
|
||||||
|
mm_bearer_get_disconnect_request
|
||||||
mm_bearer_get_suspended
|
mm_bearer_get_suspended
|
||||||
mm_bearer_get_multiplexed
|
mm_bearer_get_multiplexed
|
||||||
mm_bearer_get_ip_timeout
|
mm_bearer_get_ip_timeout
|
||||||
@@ -2345,6 +2346,7 @@ mm_gdbus_bearer_dup_properties
|
|||||||
mm_gdbus_bearer_get_connected
|
mm_gdbus_bearer_get_connected
|
||||||
mm_gdbus_bearer_get_connection_error
|
mm_gdbus_bearer_get_connection_error
|
||||||
mm_gdbus_bearer_dup_connection_error
|
mm_gdbus_bearer_dup_connection_error
|
||||||
|
mm_gdbus_bearer_get_disconnect_request
|
||||||
mm_gdbus_bearer_get_suspended
|
mm_gdbus_bearer_get_suspended
|
||||||
mm_gdbus_bearer_get_multiplexed
|
mm_gdbus_bearer_get_multiplexed
|
||||||
mm_gdbus_bearer_get_bearer_type
|
mm_gdbus_bearer_get_bearer_type
|
||||||
@@ -2363,6 +2365,7 @@ mm_gdbus_bearer_call_disconnect_sync
|
|||||||
mm_gdbus_bearer_interface_info
|
mm_gdbus_bearer_interface_info
|
||||||
mm_gdbus_bearer_set_connected
|
mm_gdbus_bearer_set_connected
|
||||||
mm_gdbus_bearer_set_connection_error
|
mm_gdbus_bearer_set_connection_error
|
||||||
|
mm_gdbus_bearer_set_disconnect_request
|
||||||
mm_gdbus_bearer_set_interface
|
mm_gdbus_bearer_set_interface
|
||||||
mm_gdbus_bearer_set_ip4_config
|
mm_gdbus_bearer_set_ip4_config
|
||||||
mm_gdbus_bearer_set_ip6_config
|
mm_gdbus_bearer_set_ip6_config
|
||||||
@@ -2822,6 +2825,8 @@ mm_gdbus_modem_get_primary_port
|
|||||||
mm_gdbus_modem_dup_primary_port
|
mm_gdbus_modem_dup_primary_port
|
||||||
mm_gdbus_modem_get_ports
|
mm_gdbus_modem_get_ports
|
||||||
mm_gdbus_modem_dup_ports
|
mm_gdbus_modem_dup_ports
|
||||||
|
mm_gdbus_modem_get_ignored_ports
|
||||||
|
mm_gdbus_modem_dup_ignored_ports
|
||||||
mm_gdbus_modem_get_revision
|
mm_gdbus_modem_get_revision
|
||||||
mm_gdbus_modem_dup_revision
|
mm_gdbus_modem_dup_revision
|
||||||
mm_gdbus_modem_get_carrier_configuration
|
mm_gdbus_modem_get_carrier_configuration
|
||||||
@@ -2908,6 +2913,7 @@ mm_gdbus_modem_set_own_numbers
|
|||||||
mm_gdbus_modem_set_plugin
|
mm_gdbus_modem_set_plugin
|
||||||
mm_gdbus_modem_set_primary_port
|
mm_gdbus_modem_set_primary_port
|
||||||
mm_gdbus_modem_set_ports
|
mm_gdbus_modem_set_ports
|
||||||
|
mm_gdbus_modem_set_ignored_ports
|
||||||
mm_gdbus_modem_set_revision
|
mm_gdbus_modem_set_revision
|
||||||
mm_gdbus_modem_set_carrier_configuration
|
mm_gdbus_modem_set_carrier_configuration
|
||||||
mm_gdbus_modem_set_carrier_configuration_revision
|
mm_gdbus_modem_set_carrier_configuration_revision
|
||||||
|
|||||||
@@ -386,6 +386,7 @@ typedef enum { /*< underscore_name=mm_modem_mode >*/
|
|||||||
* @MM_MODEM_BAND_EUTRAN_70: E-UTRAN band 70. Since 1.8.
|
* @MM_MODEM_BAND_EUTRAN_70: E-UTRAN band 70. Since 1.8.
|
||||||
* @MM_MODEM_BAND_EUTRAN_71: E-UTRAN band 71. Since 1.8.
|
* @MM_MODEM_BAND_EUTRAN_71: E-UTRAN band 71. Since 1.8.
|
||||||
* @MM_MODEM_BAND_EUTRAN_85: E-UTRAN band 85. Since 1.20.
|
* @MM_MODEM_BAND_EUTRAN_85: E-UTRAN band 85. Since 1.20.
|
||||||
|
* @MM_MODEM_BAND_EUTRAN_106: E-UTRAN band 106. Since 1.26.
|
||||||
* @MM_MODEM_BAND_CDMA_BC0: CDMA Band Class 0 (US Cellular 850MHz). Since 1.8.
|
* @MM_MODEM_BAND_CDMA_BC0: CDMA Band Class 0 (US Cellular 850MHz). Since 1.8.
|
||||||
* @MM_MODEM_BAND_CDMA_BC1: CDMA Band Class 1 (US PCS 1900MHz). Since 1.8.
|
* @MM_MODEM_BAND_CDMA_BC1: CDMA Band Class 1 (US PCS 1900MHz). Since 1.8.
|
||||||
* @MM_MODEM_BAND_CDMA_BC2: CDMA Band Class 2 (UK TACS 900MHz). Since 1.8.
|
* @MM_MODEM_BAND_CDMA_BC2: CDMA Band Class 2 (UK TACS 900MHz). Since 1.8.
|
||||||
@@ -652,7 +653,9 @@ typedef enum { /*< underscore_name=mm_modem_band >*/
|
|||||||
MM_MODEM_BAND_NGRAN_257 = 557,
|
MM_MODEM_BAND_NGRAN_257 = 557,
|
||||||
MM_MODEM_BAND_NGRAN_258 = 558,
|
MM_MODEM_BAND_NGRAN_258 = 558,
|
||||||
MM_MODEM_BAND_NGRAN_260 = 560,
|
MM_MODEM_BAND_NGRAN_260 = 560,
|
||||||
MM_MODEM_BAND_NGRAN_261 = 561
|
MM_MODEM_BAND_NGRAN_261 = 561,
|
||||||
|
/* LTE bands > 97 follow EUTRAN numbering + 1000 as offset */
|
||||||
|
MM_MODEM_BAND_EUTRAN_106 = 1136
|
||||||
} MMModemBand;
|
} MMModemBand;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -521,6 +521,7 @@ typedef enum { /*< underscore_name=mm_connection_error >*/
|
|||||||
* @MM_SERIAL_ERROR_NOT_OPEN: The serial port is not open.
|
* @MM_SERIAL_ERROR_NOT_OPEN: The serial port is not open.
|
||||||
* @MM_SERIAL_ERROR_PARSE_FAILED: The serial port specific parsing failed.
|
* @MM_SERIAL_ERROR_PARSE_FAILED: The serial port specific parsing failed.
|
||||||
* @MM_SERIAL_ERROR_FRAME_NOT_FOUND: The serial port reported that the frame marker wasn't found (e.g. for QCDM). Since 1.6.
|
* @MM_SERIAL_ERROR_FRAME_NOT_FOUND: The serial port reported that the frame marker wasn't found (e.g. for QCDM). Since 1.6.
|
||||||
|
* @MM_SERIAL_ERROR_SEND_TIMEOUT: Could not write once again to the serial device.
|
||||||
*
|
*
|
||||||
* Serial errors that may be reported by ModemManager.
|
* Serial errors that may be reported by ModemManager.
|
||||||
*
|
*
|
||||||
@@ -536,6 +537,7 @@ typedef enum { /*< underscore_name=mm_serial_error >*/
|
|||||||
MM_SERIAL_ERROR_NOT_OPEN = 6, /*< nick=NotOpen >*/
|
MM_SERIAL_ERROR_NOT_OPEN = 6, /*< nick=NotOpen >*/
|
||||||
MM_SERIAL_ERROR_PARSE_FAILED = 7, /*< nick=ParseFailed >*/
|
MM_SERIAL_ERROR_PARSE_FAILED = 7, /*< nick=ParseFailed >*/
|
||||||
MM_SERIAL_ERROR_FRAME_NOT_FOUND = 8, /*< nick=FrameNotFound >*/
|
MM_SERIAL_ERROR_FRAME_NOT_FOUND = 8, /*< nick=FrameNotFound >*/
|
||||||
|
MM_SERIAL_ERROR_SEND_TIMEOUT = 9, /*< nick=SendTimeout >*/
|
||||||
} MMSerialError;
|
} MMSerialError;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -323,6 +323,49 @@
|
|||||||
*/
|
*/
|
||||||
#define ID_MM_TTY_AT_PROBE_TRIES "ID_MM_TTY_AT_PROBE_TRIES"
|
#define ID_MM_TTY_AT_PROBE_TRIES "ID_MM_TTY_AT_PROBE_TRIES"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID_MM_INITIAL_QMAP_MUX_ID:
|
||||||
|
*
|
||||||
|
* This is a device-specific tag that allows users to specify the initial value
|
||||||
|
* of the QMAP multiplexed id to be used.
|
||||||
|
*
|
||||||
|
* An integer value greater or equal than 1 and smaller than 255.
|
||||||
|
*
|
||||||
|
* This setting does nothing if the modem doesn't support multiplexing.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
#define ID_MM_INITIAL_QMAP_MUX_ID "ID_MM_INITIAL_QMAP_MUX_ID"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID_MM_AT_NETWORK_TIME_BROKEN:
|
||||||
|
*
|
||||||
|
* This is a device-specific tag that allows users to prevent ModemManager from
|
||||||
|
* attempting to read network time using AT commands, even if the device
|
||||||
|
* supports them.
|
||||||
|
*
|
||||||
|
* An integer value of 1 prevents reading network time with AT commands.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
#define ID_MM_AT_NETWORK_TIME_BROKEN "ID_MM_AT_NETWORK_TIME_BROKEN"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID_MM_MAX_TIMEOUTS:
|
||||||
|
*
|
||||||
|
* This is a device-specific tag that allows users to specify the maximum number
|
||||||
|
* of consecutive command timeouts allowed before the modem is marked as invalid
|
||||||
|
* and re-probed.
|
||||||
|
*
|
||||||
|
* An integer value greater or equal than 0 must be given. The value 0 in this
|
||||||
|
* tag completely disables the timeout monitoring feature.
|
||||||
|
*
|
||||||
|
* If not given, the default value of 10 consecutive timeouts is used.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
#define ID_MM_MAX_TIMEOUTS "ID_MM_MAX_TIMEOUTS"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following symbols are deprecated. We don't add them to -compat
|
* The following symbols are deprecated. We don't add them to -compat
|
||||||
* because this -tags file is not really part of the installed API.
|
* because this -tags file is not really part of the installed API.
|
||||||
|
|||||||
@@ -115,6 +115,16 @@
|
|||||||
-->
|
-->
|
||||||
<property name="ConnectionError" type="(ss)" access="read" />
|
<property name="ConnectionError" type="(ss)" access="read" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
DisconnectRequest:
|
||||||
|
|
||||||
|
Indicates that the bearer is no longer useable and the connection
|
||||||
|
manager should terminate it as soon as possible.
|
||||||
|
|
||||||
|
Since: 1.26
|
||||||
|
-->
|
||||||
|
<property name="DisconnectRequest" type="b" access="read" />
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Suspended:
|
Suspended:
|
||||||
|
|
||||||
|
|||||||
@@ -103,9 +103,15 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
SendDtmf:
|
SendDtmf:
|
||||||
@dtmf: DTMF tone identifier [0-9A-D*#].
|
@dtmf: A string of DTMF tone identifiers [0-9A-D*#] and/or pause characters [,].
|
||||||
|
|
||||||
Send a DTMF tone (Dual Tone Multi-Frequency) (only on supported modem).
|
Send one or more DTMF tones (Dual Tone Multi-Frequency) (only on supported modems).
|
||||||
|
Before 1.26 only the first character in @dtmf was sent to the modem;
|
||||||
|
all others were discarded.
|
||||||
|
|
||||||
|
Since 1.26 up to 50 tone identifiers are accepted and each will be
|
||||||
|
sent to the modem in the order given. The comma [,] character pauses
|
||||||
|
DTMF tones for two-seconds then continues with the remaining characters.
|
||||||
|
|
||||||
Applicable only if state is <link linkend="MM-CALL-STATE-ACTIVE:CAPS"><constant>MM_CALL_STATE_ACTIVE</constant></link>.
|
Applicable only if state is <link linkend="MM-CALL-STATE-ACTIVE:CAPS"><constant>MM_CALL_STATE_ACTIVE</constant></link>.
|
||||||
|
|
||||||
@@ -119,7 +125,7 @@
|
|||||||
DtmfReceived:
|
DtmfReceived:
|
||||||
@dtmf: DTMF tone identifier [0-9A-D*#].
|
@dtmf: DTMF tone identifier [0-9A-D*#].
|
||||||
|
|
||||||
Emitted when a DTMF tone is received (only on supported modem)
|
Emitted when a DTMF tone is received (only on supported modems)
|
||||||
|
|
||||||
Since: 1.6
|
Since: 1.6
|
||||||
-->
|
-->
|
||||||
@@ -232,5 +238,18 @@
|
|||||||
Since: 1.10
|
Since: 1.10
|
||||||
-->
|
-->
|
||||||
<property name="AudioFormat" type="a{sv}" access="read" />
|
<property name="AudioFormat" type="a{sv}" access="read" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
DtmfToneDuration:
|
||||||
|
|
||||||
|
The length of DTMF tones, in milliseconds. Valid range is 100ms to
|
||||||
|
1000ms and is rounded up to the next 100ms if not evenly divisble
|
||||||
|
by 100. Set the duration by passing this property to
|
||||||
|
<link linkend="gdbus-method-org-freedesktop-ModemManager1-Voice.CreateCall">CreateCall()</link>
|
||||||
|
at call creation time.
|
||||||
|
|
||||||
|
Since: 1.26
|
||||||
|
-->
|
||||||
|
<property name="DtmfToneDuration" type="u" access="read" />
|
||||||
</interface>
|
</interface>
|
||||||
</node>
|
</node>
|
||||||
|
|||||||
@@ -65,5 +65,14 @@
|
|||||||
-->
|
-->
|
||||||
<property name="Update" type="u" access="read" />
|
<property name="Update" type="u" access="read" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Language:
|
||||||
|
|
||||||
|
The language of the CBM as ISO639 two letter code
|
||||||
|
|
||||||
|
Since: 1.26
|
||||||
|
-->
|
||||||
|
<property name="Language" type="s" access="read" />
|
||||||
|
|
||||||
</interface>
|
</interface>
|
||||||
</node>
|
</node>
|
||||||
|
|||||||
@@ -922,7 +922,7 @@
|
|||||||
In Linux for example, this points to a sysfs path of the usb_device
|
In Linux for example, this points to a sysfs path of the usb_device
|
||||||
object.
|
object.
|
||||||
|
|
||||||
This value may also be set by the user using the MM_ID_PHYSDEV_UID udev
|
This value may also be set by the user using the ID_MM_PHYSDEV_UID udev
|
||||||
tag (e.g. binding the tag to a specific sysfs path).
|
tag (e.g. binding the tag to a specific sysfs path).
|
||||||
|
|
||||||
Since: 1.0
|
Since: 1.0
|
||||||
@@ -973,15 +973,27 @@
|
|||||||
<!--
|
<!--
|
||||||
Ports:
|
Ports:
|
||||||
|
|
||||||
The list of ports in the modem, given as an array of string and unsigned
|
The list of used ports in the modem, given as an array of string and
|
||||||
integer pairs. The string is the port name or path, and the integer is
|
unsigned integer pairs. The string is the port name or path, and the
|
||||||
the port type given as a
|
integer is the port type given as a
|
||||||
<link linkend="MMModemPortType">MMModemPortType</link> value.
|
<link linkend="MMModemPortType">MMModemPortType</link> value.
|
||||||
|
|
||||||
Since: 1.0
|
Since: 1.0
|
||||||
-->
|
-->
|
||||||
<property name="Ports" type="a(su)" access="read" />
|
<property name="Ports" type="a(su)" access="read" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
IgnoredPorts:
|
||||||
|
|
||||||
|
The list of ignored ports in the modem, given as an array of string and
|
||||||
|
unsigned integer pairs. The string is the port name or path, and the
|
||||||
|
integer is the port type given as a
|
||||||
|
<link linkend="MMModemPortType">MMModemPortType</link> value.
|
||||||
|
|
||||||
|
Since: 1.26
|
||||||
|
-->
|
||||||
|
<property name="IgnoredPorts" type="a(su)" access="read" />
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
EquipmentIdentifier:
|
EquipmentIdentifier:
|
||||||
|
|
||||||
|
|||||||
@@ -517,6 +517,27 @@ PROPERTY_ERROR_DEFINE_FAILABLE (connection_error,
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_bearer_get_disconnect_request:
|
||||||
|
* @self: A #MMBearer.
|
||||||
|
*
|
||||||
|
* Gets whether a disconnect request is pending for this bearer
|
||||||
|
*
|
||||||
|
* Returns: %TRUE if the #MMBearer is waiting for disconnection,
|
||||||
|
* #FALSE otherwise.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
mm_bearer_get_disconnect_request (MMBearer *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (MM_IS_BEARER (self), FALSE);
|
||||||
|
|
||||||
|
return mm_gdbus_bearer_get_disconnect_request (MM_GDBUS_BEARER (self));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mm_bearer_connect_finish:
|
* mm_bearer_connect_finish:
|
||||||
* @self: A #MMBearer.
|
* @self: A #MMBearer.
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ gchar *mm_bearer_dup_interface (MMBearer *self);
|
|||||||
|
|
||||||
gboolean mm_bearer_get_connected (MMBearer *self);
|
gboolean mm_bearer_get_connected (MMBearer *self);
|
||||||
|
|
||||||
|
gboolean mm_bearer_get_disconnect_request (MMBearer *self);
|
||||||
|
|
||||||
gboolean mm_bearer_get_reload_stats_supported (MMBearer *self);
|
gboolean mm_bearer_get_reload_stats_supported (MMBearer *self);
|
||||||
|
|
||||||
gboolean mm_bearer_get_suspended (MMBearer *self);
|
gboolean mm_bearer_get_suspended (MMBearer *self);
|
||||||
|
|||||||
@@ -44,10 +44,12 @@
|
|||||||
|
|
||||||
G_DEFINE_TYPE (MMCallProperties, mm_call_properties, G_TYPE_OBJECT)
|
G_DEFINE_TYPE (MMCallProperties, mm_call_properties, G_TYPE_OBJECT)
|
||||||
|
|
||||||
#define PROPERTY_NUMBER "number"
|
#define PROPERTY_NUMBER "number"
|
||||||
|
#define PROPERTY_DTMF_TONE_DURATION "dtmf-tone-duration"
|
||||||
|
|
||||||
struct _MMCallPropertiesPrivate {
|
struct _MMCallPropertiesPrivate {
|
||||||
gchar *number;
|
gchar *number;
|
||||||
|
guint dtmf_tone_duration;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -92,6 +94,43 @@ mm_call_properties_get_number (MMCallProperties *self)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_call_properties_set_dtmf_tone_duration:
|
||||||
|
* @self: A #MMCallProperties.
|
||||||
|
* @duration_ms: The desired duration of DTMF tones in milliseconds.
|
||||||
|
*
|
||||||
|
* Sets the DTMF tone duration if supported by the modem.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
mm_call_properties_set_dtmf_tone_duration (MMCallProperties *self,
|
||||||
|
const guint duration_ms)
|
||||||
|
{
|
||||||
|
g_return_if_fail (MM_IS_CALL_PROPERTIES (self));
|
||||||
|
|
||||||
|
self->priv->dtmf_tone_duration = duration_ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_call_properties_get_dtmf_tone_duration:
|
||||||
|
* @self: A #MMCallProperties.
|
||||||
|
*
|
||||||
|
* Gets the desired DTMF tone duration in milliseconds.
|
||||||
|
*
|
||||||
|
* Returns: the DTMF tone duration in milliseconds.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
guint
|
||||||
|
mm_call_properties_get_dtmf_tone_duration (MMCallProperties *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (MM_IS_CALL_PROPERTIES (self), 0);
|
||||||
|
|
||||||
|
return self->priv->dtmf_tone_duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
/*
|
/*
|
||||||
* mm_call_properties_get_dictionary: (skip)
|
* mm_call_properties_get_dictionary: (skip)
|
||||||
*/
|
*/
|
||||||
@@ -114,6 +153,12 @@ mm_call_properties_get_dictionary (MMCallProperties *self)
|
|||||||
PROPERTY_NUMBER,
|
PROPERTY_NUMBER,
|
||||||
g_variant_new_string (self->priv->number));
|
g_variant_new_string (self->priv->number));
|
||||||
|
|
||||||
|
if (self->priv->dtmf_tone_duration)
|
||||||
|
g_variant_builder_add (&builder,
|
||||||
|
"{sv}",
|
||||||
|
PROPERTY_DTMF_TONE_DURATION,
|
||||||
|
g_variant_new_uint32 (self->priv->dtmf_tone_duration));
|
||||||
|
|
||||||
return g_variant_ref_sink (g_variant_builder_end (&builder));
|
return g_variant_ref_sink (g_variant_builder_end (&builder));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,6 +171,18 @@ consume_string (MMCallProperties *self,
|
|||||||
{
|
{
|
||||||
if (g_str_equal (key, PROPERTY_NUMBER)) {
|
if (g_str_equal (key, PROPERTY_NUMBER)) {
|
||||||
mm_call_properties_set_number (self, value);
|
mm_call_properties_set_number (self, value);
|
||||||
|
} else if (g_str_equal (key, PROPERTY_DTMF_TONE_DURATION)) {
|
||||||
|
guint num;
|
||||||
|
|
||||||
|
if (!mm_get_uint_from_str (value, &num)) {
|
||||||
|
g_set_error (error,
|
||||||
|
MM_CORE_ERROR,
|
||||||
|
MM_CORE_ERROR_INVALID_ARGS,
|
||||||
|
"Failed to parse DTMF tone duration from value '%s'",
|
||||||
|
value);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
mm_call_properties_set_dtmf_tone_duration (self, num);
|
||||||
} else {
|
} else {
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
MM_CORE_ERROR,
|
MM_CORE_ERROR,
|
||||||
@@ -189,11 +246,29 @@ consume_variant (MMCallProperties *properties,
|
|||||||
GVariant *value,
|
GVariant *value,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
if (g_str_equal (key, PROPERTY_NUMBER))
|
if (g_str_equal (key, PROPERTY_NUMBER)) {
|
||||||
|
if (!g_variant_is_of_type (value, G_VARIANT_TYPE_STRING)) {
|
||||||
|
g_set_error_literal (error,
|
||||||
|
MM_CORE_ERROR,
|
||||||
|
MM_CORE_ERROR_INVALID_ARGS,
|
||||||
|
"Invalid properties dictionary; number not a string");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
mm_call_properties_set_number (
|
mm_call_properties_set_number (
|
||||||
properties,
|
properties,
|
||||||
g_variant_get_string (value, NULL));
|
g_variant_get_string (value, NULL));
|
||||||
else {
|
} else if (g_str_equal (key, PROPERTY_DTMF_TONE_DURATION)) {
|
||||||
|
if (!g_variant_is_of_type (value, G_VARIANT_TYPE_UINT32)) {
|
||||||
|
g_set_error_literal (error,
|
||||||
|
MM_CORE_ERROR,
|
||||||
|
MM_CORE_ERROR_INVALID_ARGS,
|
||||||
|
"Invalid properties dictionary; dtmf-tone-duration not a uint32");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
mm_call_properties_set_dtmf_tone_duration (
|
||||||
|
properties,
|
||||||
|
g_variant_get_uint32 (value));
|
||||||
|
} else {
|
||||||
/* Set error */
|
/* Set error */
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
MM_CORE_ERROR,
|
MM_CORE_ERROR,
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ void mm_call_properties_set_number (MMCallProperties *self,
|
|||||||
const gchar *text);
|
const gchar *text);
|
||||||
const gchar *mm_call_properties_get_number (MMCallProperties *self);
|
const gchar *mm_call_properties_get_number (MMCallProperties *self);
|
||||||
|
|
||||||
|
void mm_call_properties_set_dtmf_tone_duration (MMCallProperties *self,
|
||||||
|
const guint duration_ms);
|
||||||
|
guint mm_call_properties_get_dtmf_tone_duration (MMCallProperties *self);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* ModemManager/libmm-glib/mmcli specific methods */
|
/* ModemManager/libmm-glib/mmcli specific methods */
|
||||||
|
|
||||||
|
|||||||
@@ -215,6 +215,52 @@ mm_cbm_get_update (MMCbm *self)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_cbm_get_language:
|
||||||
|
* @self: A #MMCbm.
|
||||||
|
*
|
||||||
|
* Gets the language the message is in as ISO639 two letter code
|
||||||
|
*
|
||||||
|
* <warning>The returned value is only valid until the property changes so it is
|
||||||
|
* only safe to use this function on the thread where @self was constructed. Use
|
||||||
|
* mm_cbm_dup_language() if on another thread.</warning>
|
||||||
|
*
|
||||||
|
* Returns: (transfer none): The message's language, or %NULL if unknown
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
const gchar *
|
||||||
|
mm_cbm_get_language (MMCbm *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (MM_IS_CBM (self), NULL);
|
||||||
|
|
||||||
|
RETURN_NON_EMPTY_CONSTANT_STRING (
|
||||||
|
mm_gdbus_cbm_get_language (MM_GDBUS_CBM (self)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_cbm_dup_language:
|
||||||
|
* @self: A #MMCbm.
|
||||||
|
*
|
||||||
|
* Gets the language the message is in as ISO639 two letter code
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): The message lang, or %NULL if it doesn't contain
|
||||||
|
* any (e.g. contains data instead). The returned value should be freed with
|
||||||
|
* g_free().
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
gchar *
|
||||||
|
mm_cbm_dup_language (MMCbm *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (MM_IS_CBM (self), NULL);
|
||||||
|
|
||||||
|
RETURN_NON_EMPTY_STRING (
|
||||||
|
mm_gdbus_cbm_dup_language (MM_GDBUS_CBM (self)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mm_cbm_init (MMCbm *self)
|
mm_cbm_init (MMCbm *self)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ guint mm_cbm_get_channel (MMCbm *self);
|
|||||||
guint mm_cbm_get_message_code (MMCbm *self);
|
guint mm_cbm_get_message_code (MMCbm *self);
|
||||||
guint mm_cbm_get_update (MMCbm *self);
|
guint mm_cbm_get_update (MMCbm *self);
|
||||||
|
|
||||||
|
const gchar *mm_cbm_get_language (MMCbm *self);
|
||||||
|
gchar *mm_cbm_dup_language (MMCbm *self);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* _MM_CBM_H_ */
|
#endif /* _MM_CBM_H_ */
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ mm_cell_info_gsm_set_operator_id (MMCellInfoGsm *self,
|
|||||||
* Encoded in upper-case hexadecimal format without leading zeros,
|
* Encoded in upper-case hexadecimal format without leading zeros,
|
||||||
* as specified in 3GPP TS 27.007.
|
* as specified in 3GPP TS 27.007.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the MCCMNC, or %NULL if not available.
|
* Returns: (transfer none): the Location Area Code, or %NULL if not available.
|
||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
*/
|
*/
|
||||||
@@ -126,7 +126,7 @@ mm_cell_info_gsm_set_lac (MMCellInfoGsm *self,
|
|||||||
* Encoded in upper-case hexadecimal format without leading zeros,
|
* Encoded in upper-case hexadecimal format without leading zeros,
|
||||||
* as specified in 3GPP TS 27.007.
|
* as specified in 3GPP TS 27.007.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the MCCMNC, or %NULL if not available.
|
* Returns: (transfer none): the Cell Identifier, or %NULL if not available.
|
||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ mm_cell_info_lte_set_operator_id (MMCellInfoLte *self,
|
|||||||
* Encoded in upper-case hexadecimal format without leading zeros,
|
* Encoded in upper-case hexadecimal format without leading zeros,
|
||||||
* as specified in 3GPP TS 27.007.
|
* as specified in 3GPP TS 27.007.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the MCCMNC, or %NULL if not available.
|
* Returns: (transfer none): the Tracking Area Code, or %NULL if not available.
|
||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
*/
|
*/
|
||||||
@@ -133,7 +133,7 @@ mm_cell_info_lte_set_tac (MMCellInfoLte *self,
|
|||||||
* Encoded in upper-case hexadecimal format without leading zeros,
|
* Encoded in upper-case hexadecimal format without leading zeros,
|
||||||
* as specified in 3GPP TS 27.007.
|
* as specified in 3GPP TS 27.007.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the MCCMNC, or %NULL if not available.
|
* Returns: (transfer none): the Cell Identifier, or %NULL if not available.
|
||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
*/
|
*/
|
||||||
@@ -165,7 +165,7 @@ mm_cell_info_lte_set_ci (MMCellInfoLte *self,
|
|||||||
* Encoded in upper-case hexadecimal format without leading zeros,
|
* Encoded in upper-case hexadecimal format without leading zeros,
|
||||||
* as specified in 3GPP TS 27.007.
|
* as specified in 3GPP TS 27.007.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the MCCMNC, or %NULL if not available.
|
* Returns: (transfer none): the physical cell identifier, or %NULL if not available.
|
||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ mm_cell_info_nr5g_set_operator_id (MMCellInfoNr5g *self,
|
|||||||
* Encoded in upper-case hexadecimal format without leading zeros,
|
* Encoded in upper-case hexadecimal format without leading zeros,
|
||||||
* as specified in 3GPP TS 27.007.
|
* as specified in 3GPP TS 27.007.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the MCCMNC, or %NULL if not available.
|
* Returns: (transfer none): the Tracking Area Code, or %NULL if not available.
|
||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
*/
|
*/
|
||||||
@@ -135,7 +135,7 @@ mm_cell_info_nr5g_set_tac (MMCellInfoNr5g *self,
|
|||||||
* Encoded in upper-case hexadecimal format without leading zeros,
|
* Encoded in upper-case hexadecimal format without leading zeros,
|
||||||
* as specified in 3GPP TS 27.007.
|
* as specified in 3GPP TS 27.007.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the MCCMNC, or %NULL if not available.
|
* Returns: (transfer none): the Cell Identifier, or %NULL if not available.
|
||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
*/
|
*/
|
||||||
@@ -167,7 +167,7 @@ mm_cell_info_nr5g_set_ci (MMCellInfoNr5g *self,
|
|||||||
* Encoded in upper-case hexadecimal format without leading zeros,
|
* Encoded in upper-case hexadecimal format without leading zeros,
|
||||||
* as specified in 3GPP TS 27.007.
|
* as specified in 3GPP TS 27.007.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the MCCMNC, or %NULL if not available.
|
* Returns: (transfer none): the physical cell identifier, or %NULL if not available.
|
||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ mm_cell_info_tdscdma_set_operator_id (MMCellInfoTdscdma *self,
|
|||||||
* Encoded in upper-case hexadecimal format without leading zeros,
|
* Encoded in upper-case hexadecimal format without leading zeros,
|
||||||
* as specified in 3GPP TS 27.007.
|
* as specified in 3GPP TS 27.007.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the MCCMNC, or %NULL if not available.
|
* Returns: (transfer none): the Location Area Code, or %NULL if not available.
|
||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
*/
|
*/
|
||||||
@@ -128,7 +128,7 @@ mm_cell_info_tdscdma_set_lac (MMCellInfoTdscdma *self,
|
|||||||
* Encoded in upper-case hexadecimal format without leading zeros,
|
* Encoded in upper-case hexadecimal format without leading zeros,
|
||||||
* as specified in 3GPP TS 27.007.
|
* as specified in 3GPP TS 27.007.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the MCCMNC, or %NULL if not available.
|
* Returns: (transfer none): the Cell Identifier, or %NULL if not available.
|
||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ mm_cell_info_umts_set_operator_id (MMCellInfoUmts *self,
|
|||||||
* Encoded in upper-case hexadecimal format without leading zeros,
|
* Encoded in upper-case hexadecimal format without leading zeros,
|
||||||
* as specified in 3GPP TS 27.007.
|
* as specified in 3GPP TS 27.007.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the MCCMNC, or %NULL if not available.
|
* Returns: (transfer none): the Location Area Code, or %NULL if not available.
|
||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
*/
|
*/
|
||||||
@@ -134,7 +134,7 @@ mm_cell_info_umts_set_lac (MMCellInfoUmts *self,
|
|||||||
* Encoded in upper-case hexadecimal format without leading zeros,
|
* Encoded in upper-case hexadecimal format without leading zeros,
|
||||||
* as specified in 3GPP TS 27.007.
|
* as specified in 3GPP TS 27.007.
|
||||||
*
|
*
|
||||||
* Returns: (transfer none): the MCCMNC, or %NULL if not available.
|
* Returns: (transfer none): the Cell Identifier, or %NULL if not available.
|
||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1314,7 +1314,9 @@ mm_common_band_is_utran (MMModemBand band)
|
|||||||
gboolean
|
gboolean
|
||||||
mm_common_band_is_eutran (MMModemBand band)
|
mm_common_band_is_eutran (MMModemBand band)
|
||||||
{
|
{
|
||||||
return (band >= MM_MODEM_BAND_EUTRAN_1 && band <= MM_MODEM_BAND_EUTRAN_71);
|
return ((band >= MM_MODEM_BAND_EUTRAN_1 && band <= MM_MODEM_BAND_EUTRAN_71) ||
|
||||||
|
(band == MM_MODEM_BAND_EUTRAN_85) ||
|
||||||
|
(band == MM_MODEM_BAND_EUTRAN_106));
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
|||||||
@@ -45,16 +45,20 @@ G_DEFINE_TYPE (MMLocationGpsNmea, mm_location_gps_nmea, G_TYPE_OBJECT)
|
|||||||
|
|
||||||
struct _MMLocationGpsNmeaPrivate {
|
struct _MMLocationGpsNmeaPrivate {
|
||||||
GHashTable *traces;
|
GHashTable *traces;
|
||||||
GRegex *sequence_regex;
|
gchar *sequence_last_trace;
|
||||||
|
gchar *sequence_last_trace_type;
|
||||||
|
GRegex *sequence_regex;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
check_append_or_replace (MMLocationGpsNmea *self,
|
is_sequence_trace_type (MMLocationGpsNmea *self,
|
||||||
const gchar *trace)
|
const gchar *trace,
|
||||||
|
gboolean *first)
|
||||||
{
|
{
|
||||||
g_autoptr(GMatchInfo) match_info = NULL;
|
g_autoptr(GMatchInfo) match_info = NULL;
|
||||||
|
guint index;
|
||||||
|
|
||||||
if (G_UNLIKELY (!self->priv->sequence_regex))
|
if (G_UNLIKELY (!self->priv->sequence_regex))
|
||||||
self->priv->sequence_regex = g_regex_new ("\\$..(?:ALM|GSV|RTE|SFI),(\\d),(\\d).*",
|
self->priv->sequence_regex = g_regex_new ("\\$..(?:ALM|GSV|RTE|SFI),(\\d),(\\d).*",
|
||||||
@@ -62,30 +66,31 @@ check_append_or_replace (MMLocationGpsNmea *self,
|
|||||||
0,
|
0,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
*first = FALSE;
|
||||||
if (g_regex_match (self->priv->sequence_regex, trace, 0, &match_info)) {
|
if (g_regex_match (self->priv->sequence_regex, trace, 0, &match_info)) {
|
||||||
guint index;
|
if (mm_get_uint_from_match_info (match_info, 2, &index)) {
|
||||||
|
*first = (index == 1);
|
||||||
/* If we don't have the first element of a sequence, append */
|
|
||||||
if (mm_get_uint_from_match_info (match_info, 2, &index) && index != 1)
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* By default, replace */
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
location_gps_nmea_take_trace (MMLocationGpsNmea *self,
|
location_gps_nmea_take_trace (MMLocationGpsNmea *self,
|
||||||
gchar *trace)
|
gchar *_trace)
|
||||||
{
|
{
|
||||||
gchar *i;
|
gchar *i;
|
||||||
gchar *trace_type;
|
g_autofree gchar *trace_type = NULL;
|
||||||
|
g_autofree gchar *trace = _trace;
|
||||||
|
g_autofree gchar *sequence = NULL;
|
||||||
|
gboolean first;
|
||||||
|
gboolean sequence_trace;
|
||||||
|
|
||||||
|
|
||||||
i = strchr (trace, ',');
|
i = strchr (trace, ',');
|
||||||
if (!i || i == trace) {
|
if (!i || i == trace)
|
||||||
g_free (trace);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
|
||||||
|
|
||||||
trace_type = g_malloc (i - trace + 1);
|
trace_type = g_malloc (i - trace + 1);
|
||||||
memcpy (trace_type, trace, i - trace);
|
memcpy (trace_type, trace, i - trace);
|
||||||
@@ -94,33 +99,58 @@ location_gps_nmea_take_trace (MMLocationGpsNmea *self,
|
|||||||
/* Some traces are part of a SEQUENCE; so we need to decide whether we
|
/* Some traces are part of a SEQUENCE; so we need to decide whether we
|
||||||
* completely replace the previous trace, or we append the new one to
|
* completely replace the previous trace, or we append the new one to
|
||||||
* the already existing list */
|
* the already existing list */
|
||||||
if (check_append_or_replace (self, trace)) {
|
sequence_trace = is_sequence_trace_type (self, trace, &first);
|
||||||
|
|
||||||
|
/* Save previous sequence trace, if
|
||||||
|
* new trace type is different or this is the first sequence trace */
|
||||||
|
if (self->priv->sequence_last_trace_type &&
|
||||||
|
self->priv->sequence_last_trace &&
|
||||||
|
(g_strcmp0 (self->priv->sequence_last_trace_type, trace_type) ||
|
||||||
|
(sequence_trace && first))) {
|
||||||
|
g_hash_table_replace (self->priv->traces,
|
||||||
|
g_steal_pointer (&self->priv->sequence_last_trace_type),
|
||||||
|
g_steal_pointer (&self->priv->sequence_last_trace));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sequence_trace) {
|
||||||
|
g_hash_table_replace (self->priv->traces,
|
||||||
|
g_steal_pointer (&trace_type),
|
||||||
|
g_steal_pointer (&trace));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Process the trace as part of a sequence. */
|
||||||
|
if (first) {
|
||||||
|
/* Record first record in the sequence */
|
||||||
|
sequence = g_steal_pointer (&trace);
|
||||||
|
} else {
|
||||||
/* Append */
|
/* Append */
|
||||||
const gchar *previous;
|
const gchar *previous = self->priv->sequence_last_trace;
|
||||||
|
|
||||||
|
if (!previous)
|
||||||
|
previous = g_hash_table_lookup (self->priv->traces, trace_type);
|
||||||
|
|
||||||
previous = g_hash_table_lookup (self->priv->traces, trace_type);
|
|
||||||
if (previous) {
|
if (previous) {
|
||||||
gchar *sequence;
|
|
||||||
|
|
||||||
/* Skip the trace if we already have it there */
|
/* Skip the trace if we already have it there */
|
||||||
if (strstr (previous, trace)) {
|
if (strstr (previous, trace))
|
||||||
g_free (trace_type);
|
|
||||||
g_free (trace);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
|
||||||
|
|
||||||
sequence = g_strdup_printf ("%s%s%s",
|
sequence = g_strdup_printf ("%s%s%s",
|
||||||
previous,
|
previous,
|
||||||
g_str_has_suffix (previous, "\r\n") ? "" : "\r\n",
|
g_str_has_suffix (previous, "\r\n") ? "" : "\r\n",
|
||||||
trace);
|
trace);
|
||||||
g_free (trace);
|
} else {
|
||||||
trace = sequence;
|
/* No previous records, record first record in the sequence */
|
||||||
|
sequence = g_steal_pointer (&trace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_hash_table_replace (self->priv->traces,
|
g_clear_pointer (&self->priv->sequence_last_trace, g_free);
|
||||||
trace_type,
|
self->priv->sequence_last_trace = g_steal_pointer (&sequence);
|
||||||
trace);
|
|
||||||
|
g_clear_pointer (&self->priv->sequence_last_trace_type, g_free);
|
||||||
|
self->priv->sequence_last_trace_type = g_steal_pointer (&trace_type);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,6 +321,8 @@ finalize (GObject *object)
|
|||||||
g_hash_table_destroy (self->priv->traces);
|
g_hash_table_destroy (self->priv->traces);
|
||||||
if (self->priv->sequence_regex)
|
if (self->priv->sequence_regex)
|
||||||
g_regex_unref (self->priv->sequence_regex);
|
g_regex_unref (self->priv->sequence_regex);
|
||||||
|
g_free (self->priv->sequence_last_trace);
|
||||||
|
g_free (self->priv->sequence_last_trace_type);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_location_gps_nmea_parent_class)->finalize (object);
|
G_OBJECT_CLASS (mm_location_gps_nmea_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|||||||
+42
-1
@@ -47,6 +47,7 @@ struct _MMModemPrivate {
|
|||||||
GMutex mutex;
|
GMutex mutex;
|
||||||
|
|
||||||
PROPERTY_ARRAY_DECLARE (ports)
|
PROPERTY_ARRAY_DECLARE (ports)
|
||||||
|
PROPERTY_ARRAY_DECLARE (ignored_ports)
|
||||||
PROPERTY_ARRAY_DECLARE (supported_modes)
|
PROPERTY_ARRAY_DECLARE (supported_modes)
|
||||||
PROPERTY_ARRAY_DECLARE (supported_capabilities)
|
PROPERTY_ARRAY_DECLARE (supported_capabilities)
|
||||||
PROPERTY_ARRAY_DECLARE (supported_bands)
|
PROPERTY_ARRAY_DECLARE (supported_bands)
|
||||||
@@ -984,7 +985,7 @@ mm_modem_dup_primary_port (MMModem *self)
|
|||||||
* mm_modem_port_info_array_free() when no longer needed.
|
* mm_modem_port_info_array_free() when no longer needed.
|
||||||
* @n_ports: (out): Return location for the number of values in @ports.
|
* @n_ports: (out): Return location for the number of values in @ports.
|
||||||
*
|
*
|
||||||
* Gets the list of ports in the modem.
|
* Gets the list of used ports in the modem.
|
||||||
*
|
*
|
||||||
* Returns: %TRUE if @ports and @n_ports are set, %FALSE otherwise.
|
* Returns: %TRUE if @ports and @n_ports are set, %FALSE otherwise.
|
||||||
*
|
*
|
||||||
@@ -999,6 +1000,44 @@ PROPERTY_ARRAY_DEFINE_DEEP (ports,
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_modem_peek_ignored_ports:
|
||||||
|
* @self: A #MMModem.
|
||||||
|
* @ports: (out) (array length=n_ports) (transfer none): Return location for the
|
||||||
|
* array of #MMModemPortInfo values. Do not free the returned value, it is
|
||||||
|
* owned by @self.
|
||||||
|
* @n_ports: (out): Return location for the number of values in @ports.
|
||||||
|
*
|
||||||
|
* Gets the list of ignored ports in the modem.
|
||||||
|
*
|
||||||
|
* Returns: %TRUE if @ports and @n_ports are set, %FALSE otherwise.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_modem_get_ignored_ports:
|
||||||
|
* @self: A #MMModem.
|
||||||
|
* @ports: (out) (array length=n_ports): Return location for the array of
|
||||||
|
* #MMModemPortInfo values. The returned array should be freed with
|
||||||
|
* mm_modem_port_info_array_free() when no longer needed.
|
||||||
|
* @n_ports: (out): Return location for the number of values in @ports.
|
||||||
|
*
|
||||||
|
* Gets the list of ignored ports in the modem.
|
||||||
|
*
|
||||||
|
* Returns: %TRUE if @ports and @n_ports are set, %FALSE otherwise.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
|
||||||
|
PROPERTY_ARRAY_DEFINE_DEEP (ignored_ports,
|
||||||
|
Modem, modem, MODEM,
|
||||||
|
MMModemPortInfo,
|
||||||
|
mm_common_ports_variant_to_garray,
|
||||||
|
mm_common_ports_garray_to_array)
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mm_modem_get_equipment_identifier:
|
* mm_modem_get_equipment_identifier:
|
||||||
* @self: A #MMModem.
|
* @self: A #MMModem.
|
||||||
@@ -3430,6 +3469,7 @@ mm_modem_init (MMModem *self)
|
|||||||
g_mutex_init (&self->priv->mutex);
|
g_mutex_init (&self->priv->mutex);
|
||||||
|
|
||||||
PROPERTY_INITIALIZE (ports, "ports")
|
PROPERTY_INITIALIZE (ports, "ports")
|
||||||
|
PROPERTY_INITIALIZE (ignored_ports, "ignored-ports")
|
||||||
PROPERTY_INITIALIZE (supported_modes, "supported-modes")
|
PROPERTY_INITIALIZE (supported_modes, "supported-modes")
|
||||||
PROPERTY_INITIALIZE (supported_capabilities, "supported-capabilities")
|
PROPERTY_INITIALIZE (supported_capabilities, "supported-capabilities")
|
||||||
PROPERTY_INITIALIZE (supported_bands, "supported-bands")
|
PROPERTY_INITIALIZE (supported_bands, "supported-bands")
|
||||||
@@ -3445,6 +3485,7 @@ finalize (GObject *object)
|
|||||||
g_mutex_clear (&self->priv->mutex);
|
g_mutex_clear (&self->priv->mutex);
|
||||||
|
|
||||||
PROPERTY_ARRAY_FINALIZE (ports)
|
PROPERTY_ARRAY_FINALIZE (ports)
|
||||||
|
PROPERTY_ARRAY_FINALIZE (ignored_ports)
|
||||||
PROPERTY_ARRAY_FINALIZE (supported_modes)
|
PROPERTY_ARRAY_FINALIZE (supported_modes)
|
||||||
PROPERTY_ARRAY_FINALIZE (supported_capabilities)
|
PROPERTY_ARRAY_FINALIZE (supported_capabilities)
|
||||||
PROPERTY_ARRAY_FINALIZE (supported_bands)
|
PROPERTY_ARRAY_FINALIZE (supported_bands)
|
||||||
|
|||||||
@@ -138,6 +138,14 @@ gboolean mm_modem_get_ports (MMModem *self,
|
|||||||
MMModemPortInfo **ports,
|
MMModemPortInfo **ports,
|
||||||
guint *n_ports);
|
guint *n_ports);
|
||||||
|
|
||||||
|
gboolean mm_modem_peek_ignored_ports (MMModem *self,
|
||||||
|
const MMModemPortInfo **ports,
|
||||||
|
guint *n_ports);
|
||||||
|
|
||||||
|
gboolean mm_modem_get_ignored_ports (MMModem *self,
|
||||||
|
MMModemPortInfo **ports,
|
||||||
|
guint *n_ports);
|
||||||
|
|
||||||
const gchar *mm_modem_get_equipment_identifier (MMModem *self);
|
const gchar *mm_modem_get_equipment_identifier (MMModem *self);
|
||||||
gchar *mm_modem_dup_equipment_identifier (MMModem *self);
|
gchar *mm_modem_dup_equipment_identifier (MMModem *self);
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
test_units = [
|
test_units = [
|
||||||
'common-helpers',
|
'common-helpers',
|
||||||
'pco',
|
'pco',
|
||||||
|
'location-gps-nmea',
|
||||||
]
|
]
|
||||||
|
|
||||||
foreach test_unit: test_units
|
foreach test_unit: test_units
|
||||||
|
|||||||
@@ -0,0 +1,376 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2026 Dan Williams <dan@ioncontrol.co>
|
||||||
|
* Copyright (C) 2026 Andrey Skvortsov <andrej.skvortzov@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
#include <libmm-glib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
static gchar *
|
||||||
|
combine_traces (const gchar *traces[],
|
||||||
|
const guint num_traces,
|
||||||
|
gboolean trailing_crlf)
|
||||||
|
{
|
||||||
|
guint i;
|
||||||
|
GString *all = g_string_new ("");
|
||||||
|
|
||||||
|
for (i = 0; i < num_traces; i++) {
|
||||||
|
g_string_append (all, traces[i]);
|
||||||
|
if (i != num_traces - 1) {
|
||||||
|
g_string_append_c (all, '\r');
|
||||||
|
g_string_append_c (all, '\n');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return g_string_free (all, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gchar *
|
||||||
|
get_trace_type (const gchar *trace)
|
||||||
|
{
|
||||||
|
gchar *trace_type = g_strdup (trace);
|
||||||
|
gchar *p;
|
||||||
|
|
||||||
|
p = strchr (trace_type, ',');
|
||||||
|
g_assert (p);
|
||||||
|
*p = '\0';
|
||||||
|
return trace_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_round_trip (void)
|
||||||
|
{
|
||||||
|
MMLocationGpsNmea *nmea;
|
||||||
|
g_autofree gchar *combined_traces;
|
||||||
|
g_autofree gchar **all_traces;
|
||||||
|
GError *error = NULL;
|
||||||
|
guint traces_len;
|
||||||
|
guint i, j;
|
||||||
|
|
||||||
|
#define TRACE0 "$GNGGA,001626.000,,,,,0,00,25.5,,,,,,*79"
|
||||||
|
#define TRACE1 "$GPGSV,2,1,08,04,41,189,,07,49,311,28,08,67,149,25,09,55,237,18,0*68"
|
||||||
|
#define TRACE2 "$GPGSV,2,2,08,16,31,057,,21,05,153,,27,56,070,,30,19,303,,0*61"
|
||||||
|
#define TRACE3 "$BDGSV,1,1,00,0*74"
|
||||||
|
#define TRACE4 "$GNGGA,001626.000,,,,,0,00,25.5,,,,,,*79"
|
||||||
|
|
||||||
|
static const char *traces[] = { TRACE0, TRACE1, TRACE2, TRACE3, TRACE4 };
|
||||||
|
|
||||||
|
static const char *expected_traces[] = {
|
||||||
|
TRACE1 "\r\n" TRACE2,
|
||||||
|
TRACE3,
|
||||||
|
TRACE4,
|
||||||
|
};
|
||||||
|
|
||||||
|
combined_traces = combine_traces (traces, G_N_ELEMENTS (traces), TRUE);
|
||||||
|
nmea = mm_location_gps_nmea_new_from_string_variant (g_variant_new_string (combined_traces), &error);
|
||||||
|
g_assert_no_error (error);
|
||||||
|
|
||||||
|
for (i = 0; i < G_N_ELEMENTS (expected_traces); i++) {
|
||||||
|
g_autofree gchar *trace_type = get_trace_type (expected_traces[i]);
|
||||||
|
const gchar * trace;
|
||||||
|
|
||||||
|
trace = mm_location_gps_nmea_get_trace (nmea, trace_type);
|
||||||
|
g_assert_cmpstr (trace, ==, expected_traces[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
all_traces = mm_location_gps_nmea_get_traces (nmea);
|
||||||
|
traces_len = g_strv_length (all_traces);
|
||||||
|
g_assert_cmpint (traces_len, ==, G_N_ELEMENTS (expected_traces));
|
||||||
|
|
||||||
|
/* For each expected trace type, assert that trace type exists in the
|
||||||
|
* found traces, and matches the expected trace.
|
||||||
|
*/
|
||||||
|
for (i = 0; i < G_N_ELEMENTS (expected_traces); i++) {
|
||||||
|
g_autofree gchar *expected_type = get_trace_type (expected_traces[i]);
|
||||||
|
gboolean found = FALSE;
|
||||||
|
|
||||||
|
for (j = 0; j < traces_len; j++) {
|
||||||
|
g_autofree gchar *found_type = get_trace_type (all_traces[j]);
|
||||||
|
|
||||||
|
if (!g_strcmp0 (found_type, expected_type)) {
|
||||||
|
/* Found the trace type; compare */
|
||||||
|
g_assert_cmpstr (all_traces[j], ==, expected_traces[i]);
|
||||||
|
found = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
g_assert_true (found);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef TRACE0
|
||||||
|
#undef TRACE1
|
||||||
|
#undef TRACE2
|
||||||
|
#undef TRACE3
|
||||||
|
#undef TRACE4
|
||||||
|
|
||||||
|
/**************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_append_sequence (void)
|
||||||
|
{
|
||||||
|
MMLocationGpsNmea *nmea;
|
||||||
|
GError *error = NULL;
|
||||||
|
g_autofree gchar *combined = NULL;
|
||||||
|
|
||||||
|
#define TRACE0 "$GNGGA,001626.000,,,,,0,00,25.5,,,,,,*79"
|
||||||
|
#define TRACE1 "$GPGSV,3,1,12,01,35,282,,02,68,264,,03,02,243,,08,35,206,,1*68"
|
||||||
|
#define TRACE2 "$GPGSV,3,2,12,10,46,074,,14,16,312,,17,,,,22,16,327,,1*53"
|
||||||
|
#define TRACE3 "$GPGSV,3,3,12,23,07,068,,24,15,030,,27,14,181,,32,51,120,,1*60"
|
||||||
|
#define TRACE4 "$BDGSV,1,1,00,0*74"
|
||||||
|
#define TRACE5 "$GNGGA,001626.000,,,,,0,00,25.6,,,,,,*79"
|
||||||
|
|
||||||
|
#define GPGSV_TYPE "$GPGSV"
|
||||||
|
#define BDGSV_TYPE "$BDGSV"
|
||||||
|
#define GNGGA_TYPE "$GNGGA"
|
||||||
|
|
||||||
|
static const gchar *gpgsvs[] = { TRACE1, TRACE2, TRACE3 };
|
||||||
|
|
||||||
|
nmea = mm_location_gps_nmea_new_from_string_variant (g_variant_new_string (TRACE0), &error);
|
||||||
|
g_assert_no_error (error);
|
||||||
|
|
||||||
|
/* No part of the GPGSV sequence should be found in traces until a new
|
||||||
|
* trace type is added.
|
||||||
|
*/
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE1));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, NULL);
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE2));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, NULL);
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE3));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, NULL);
|
||||||
|
|
||||||
|
/* Add a new type, but it's also a sequence so it won't be found yet */
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE4));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, BDGSV_TYPE), ==, NULL);
|
||||||
|
|
||||||
|
/* New type was just added, now we should find the $GPGSV too */
|
||||||
|
combined = combine_traces (gpgsvs, G_N_ELEMENTS (gpgsvs), FALSE);
|
||||||
|
g_assert (combined);
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, combined);
|
||||||
|
|
||||||
|
/* Add a non-sequence trace */
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE5));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GNGGA_TYPE), ==, TRACE5);
|
||||||
|
|
||||||
|
/* And now we should find the $BDGSV */
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, BDGSV_TYPE), ==, TRACE4);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef TRACE0
|
||||||
|
#undef TRACE1
|
||||||
|
#undef TRACE2
|
||||||
|
#undef TRACE3
|
||||||
|
#undef TRACE4
|
||||||
|
#undef TRACE5
|
||||||
|
|
||||||
|
/**************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_append_sequence_interleaved (void)
|
||||||
|
{
|
||||||
|
MMLocationGpsNmea *nmea;
|
||||||
|
GError *error = NULL;
|
||||||
|
g_autofree gchar *combined_start = NULL;
|
||||||
|
g_autofree gchar *combined_full = NULL;
|
||||||
|
|
||||||
|
#define TRACE0 "$GNGGA,001626.000,,,,,0,00,25.5,,,,,,*79"
|
||||||
|
#define TRACE1 "$GPGSV,3,1,12,01,35,282,,02,68,264,,03,02,243,,08,35,206,,1*68"
|
||||||
|
#define TRACE2 "$GPGSV,3,2,12,10,46,074,,14,16,312,,17,,,,22,16,327,,1*53"
|
||||||
|
#define TRACE3 "$BDGSV,1,1,00,0*74"
|
||||||
|
#define TRACE4 "$GPGSV,3,3,12,23,07,068,,24,15,030,,27,14,181,,32,51,120,,1*60"
|
||||||
|
#define TRACE5 "$GNGGA,001626.000,,,,,0,00,25.6,,,,,,*79"
|
||||||
|
|
||||||
|
#define GPGSV_TYPE "$GPGSV"
|
||||||
|
#define BDGSV_TYPE "$BDGSV"
|
||||||
|
#define GNGGA_TYPE "$GNGGA"
|
||||||
|
|
||||||
|
static const gchar *gpgsvs_start[] = { TRACE1, TRACE2 };
|
||||||
|
static const gchar *gpgsvs_full[] = { TRACE1, TRACE2, TRACE4 };
|
||||||
|
|
||||||
|
nmea = mm_location_gps_nmea_new_from_string_variant (g_variant_new_string (TRACE0), &error);
|
||||||
|
g_assert_no_error (error);
|
||||||
|
|
||||||
|
/* No part of the GPGSV sequence should be found in traces until a new
|
||||||
|
* trace type is added.
|
||||||
|
*/
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE1));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, NULL);
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE2));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, NULL);
|
||||||
|
|
||||||
|
/* Add a new type, but it's also a sequence so it won't be found yet */
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE3));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, BDGSV_TYPE), ==, NULL);
|
||||||
|
|
||||||
|
/* New type was just added, now first part of $GPGSV should be available */
|
||||||
|
combined_start = combine_traces (gpgsvs_start, G_N_ELEMENTS (gpgsvs_start), FALSE);
|
||||||
|
g_assert (combined_start);
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, combined_start);
|
||||||
|
|
||||||
|
/* Add third GPGSV, but it won't be found yet, only previous GPGSV records
|
||||||
|
* But $BDGSV should be found now.
|
||||||
|
*/
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE4));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, combined_start);
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, BDGSV_TYPE), ==, TRACE3);
|
||||||
|
|
||||||
|
/* Add a non-sequence trace */
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE5));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GNGGA_TYPE), ==, TRACE5);
|
||||||
|
|
||||||
|
/* New type was just added, now we should find full $GPGSV sequence */
|
||||||
|
combined_full = combine_traces (gpgsvs_full, G_N_ELEMENTS (gpgsvs_full), FALSE);
|
||||||
|
g_assert (combined_full);
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, combined_full);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef TRACE0
|
||||||
|
#undef TRACE1
|
||||||
|
#undef TRACE2
|
||||||
|
#undef TRACE3
|
||||||
|
#undef TRACE4
|
||||||
|
#undef TRACE5
|
||||||
|
|
||||||
|
/**************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_append_multiple_sequences (void)
|
||||||
|
{
|
||||||
|
MMLocationGpsNmea *nmea;
|
||||||
|
GError *error = NULL;
|
||||||
|
g_autofree gchar *combined1 = NULL;
|
||||||
|
g_autofree gchar *combined2 = NULL;
|
||||||
|
|
||||||
|
#define TRACE0 "$GPGSV,3,1,12,01,35,282,,02,68,264,,03,02,243,,08,35,206,,1*68"
|
||||||
|
#define TRACE1 "$GPGSV,3,2,12,10,46,074,,14,16,312,,17,,,,22,16,327,,1*53"
|
||||||
|
#define TRACE2 "$GPGSV,3,3,12,23,07,068,,24,15,030,,27,14,181,,32,51,120,,1*60"
|
||||||
|
#define TRACE3 "$GPGSV,3,1,12,01,35,282,23,02,68,264,,03,02,243,,08,35,206,,1*69"
|
||||||
|
#define TRACE4 "$GPGSV,3,2,12,10,46,074,28,14,16,312,,17,,,,22,16,327,,1*59"
|
||||||
|
#define TRACE5 "$GPGSV,3,3,12,23,07,068,18,24,15,030,,27,14,181,,32,51,120,,1*69"
|
||||||
|
#define TRACE6 "$GPGSV,3,1,12,01,35,282,25,02,68,264,,03,02,243,,08,35,206,,1*6F"
|
||||||
|
|
||||||
|
#define GPGSV_TYPE "$GPGSV"
|
||||||
|
|
||||||
|
static const gchar *gpgsvs1[] = { TRACE0, TRACE1, TRACE2 };
|
||||||
|
static const gchar *gpgsvs2[] = { TRACE3, TRACE4, TRACE5 };
|
||||||
|
|
||||||
|
/* No part of the GPGSV sequence should be found in traces until a new
|
||||||
|
* trace sequence is added.
|
||||||
|
*/
|
||||||
|
nmea = mm_location_gps_nmea_new_from_string_variant (g_variant_new_string (TRACE0), &error);
|
||||||
|
g_assert_no_error (error);
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, NULL);
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE1));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, NULL);
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE2));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, NULL);
|
||||||
|
|
||||||
|
/* Add first record for next sequence, old sequence should be available */
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE3));
|
||||||
|
combined1 = combine_traces (gpgsvs1, G_N_ELEMENTS (gpgsvs1), FALSE);
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, combined1);
|
||||||
|
|
||||||
|
/* No part of new the GPGSV sequence should be found in traces until a new
|
||||||
|
* trace sequence is added.
|
||||||
|
*/
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE4));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, combined1);
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE5));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, combined1);
|
||||||
|
|
||||||
|
/* Add first record for next sequence, updated sequence should be available */
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE6));
|
||||||
|
combined2 = combine_traces (gpgsvs2, G_N_ELEMENTS (gpgsvs2), FALSE);
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, combined2);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef TRACE0
|
||||||
|
#undef TRACE1
|
||||||
|
#undef TRACE2
|
||||||
|
#undef TRACE3
|
||||||
|
#undef TRACE4
|
||||||
|
#undef TRACE5
|
||||||
|
#undef TRACE6
|
||||||
|
|
||||||
|
/**************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_start_from_incomplete_sequence (void)
|
||||||
|
{
|
||||||
|
MMLocationGpsNmea *nmea;
|
||||||
|
GError *error = NULL;
|
||||||
|
g_autofree gchar *combined = NULL;
|
||||||
|
|
||||||
|
#define TRACE0 "$GPGSV,3,3,12,23,07,068,,24,15,030,,27,14,181,,32,51,120,,1*60"
|
||||||
|
#define TRACE1 "$GNGGA,001626.000,,,,,0,00,25.5,,,,,,*79"
|
||||||
|
#define TRACE2 "$GPGSV,3,1,12,01,35,282,,02,68,264,,03,02,243,,08,35,206,,1*68"
|
||||||
|
#define TRACE3 "$GPGSV,3,2,12,10,46,074,,14,16,312,,17,,,,22,16,327,,1*53"
|
||||||
|
#define TRACE4 "$GPGSV,3,3,12,23,07,068,,24,15,030,,27,14,181,,32,51,120,,1*60"
|
||||||
|
#define TRACE5 "$GNGGA,001626.000,,,,,0,00,25.6,,,,,,*7A"
|
||||||
|
|
||||||
|
#define GPGSV_TYPE "$GPGSV"
|
||||||
|
#define GNGGA_TYPE "$GNGGA"
|
||||||
|
|
||||||
|
static const gchar *gpgsvs[] = { TRACE2, TRACE3, TRACE4 };
|
||||||
|
|
||||||
|
/* Start sequence not from the first record */
|
||||||
|
nmea = mm_location_gps_nmea_new_from_string_variant (g_variant_new_string (TRACE0), &error);
|
||||||
|
g_assert_no_error (error);
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, NULL);
|
||||||
|
|
||||||
|
/* New type was just added, now we should find $GPGSV sequence */
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE1));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GNGGA_TYPE), ==, TRACE1);
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, TRACE0);
|
||||||
|
|
||||||
|
/* Add first record for next sequence, old sequence should be available */
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE2));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, TRACE0);
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE3));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, TRACE0);
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE4));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, TRACE0);
|
||||||
|
|
||||||
|
/* New type was just added, now we should find new full $GPGSV sequence */
|
||||||
|
g_assert (mm_location_gps_nmea_add_trace (nmea, TRACE5));
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GNGGA_TYPE), ==, TRACE5);
|
||||||
|
|
||||||
|
combined = combine_traces (gpgsvs, G_N_ELEMENTS (gpgsvs), FALSE);
|
||||||
|
g_assert_cmpstr (mm_location_gps_nmea_get_trace (nmea, GPGSV_TYPE), ==, combined);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef TRACE0
|
||||||
|
#undef TRACE1
|
||||||
|
#undef TRACE2
|
||||||
|
#undef TRACE3
|
||||||
|
#undef TRACE4
|
||||||
|
#undef TRACE5
|
||||||
|
|
||||||
|
/**************************************************************/
|
||||||
|
|
||||||
|
int main (int argc, char **argv)
|
||||||
|
{
|
||||||
|
g_test_init (&argc, &argv, NULL);
|
||||||
|
|
||||||
|
g_test_add_func ("/MM/Location/GPS/NMEA/round-trip", test_round_trip);
|
||||||
|
g_test_add_func ("/MM/Location/GPS/NMEA/append-sequence", test_append_sequence);
|
||||||
|
g_test_add_func ("/MM/Location/GPS/NMEA/append-sequence-interleaved", test_append_sequence_interleaved);
|
||||||
|
g_test_add_func ("/MM/Location/GPS/NMEA/append-multiple-sequences", test_append_multiple_sequences);
|
||||||
|
g_test_add_func ("/MM/Location/GPS/NMEA/start-from-incomplete-sequence", test_start_from_incomplete_sequence);
|
||||||
|
|
||||||
|
return g_test_run ();
|
||||||
|
}
|
||||||
@@ -672,12 +672,24 @@ qcdm_cmd_pilot_sets_result (const char *buf, size_t len, int *out_error)
|
|||||||
QcdmResult *result = NULL;
|
QcdmResult *result = NULL;
|
||||||
DMCmdPilotSetsRsp *rsp = (DMCmdPilotSetsRsp *) buf;
|
DMCmdPilotSetsRsp *rsp = (DMCmdPilotSetsRsp *) buf;
|
||||||
size_t sets_len;
|
size_t sets_len;
|
||||||
|
size_t total_count;
|
||||||
|
|
||||||
qcdm_return_val_if_fail (buf != NULL, NULL);
|
qcdm_return_val_if_fail (buf != NULL, NULL);
|
||||||
|
|
||||||
if (!check_command (buf, len, DIAG_CMD_PILOT_SETS, sizeof (DMCmdPilotSetsRsp), out_error))
|
if (!check_command (buf, len, DIAG_CMD_PILOT_SETS, sizeof (DMCmdPilotSetsRsp), out_error))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
/* Validate that the modem-supplied counts fit in the fixed sets[] array
|
||||||
|
* and in the actually-received response. */
|
||||||
|
total_count = (size_t) rsp->active_count + rsp->candidate_count + rsp->neighbor_count;
|
||||||
|
if (total_count > (sizeof (rsp->sets) / sizeof (rsp->sets[0])) ||
|
||||||
|
((sizeof (*rsp) - sizeof (rsp->sets)) + total_count * sizeof (DMCmdPilotSetsSet)) > len) {
|
||||||
|
qcdm_err (0, "DM Pilot Sets response counts out of range");
|
||||||
|
if (out_error)
|
||||||
|
*out_error = -QCDM_ERROR_RESPONSE_BAD_LENGTH;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
result = qcdm_result_new ();
|
result = qcdm_result_new ();
|
||||||
|
|
||||||
sets_len = rsp->active_count * sizeof (DMCmdPilotSetsSet);
|
sets_len = rsp->active_count * sizeof (DMCmdPilotSetsSet);
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ qcdm_log_item_evdo_pilot_sets_v2_new (const char *buf, size_t len, int *out_erro
|
|||||||
QcdmResult *result = NULL;
|
QcdmResult *result = NULL;
|
||||||
DMLogItemEvdoPilotSetsV2 *pilot_sets;
|
DMLogItemEvdoPilotSetsV2 *pilot_sets;
|
||||||
DMCmdLog *log_cmd = (DMCmdLog *) buf;
|
DMCmdLog *log_cmd = (DMCmdLog *) buf;
|
||||||
|
size_t avail;
|
||||||
size_t sets_len;
|
size_t sets_len;
|
||||||
|
|
||||||
qcdm_return_val_if_fail (buf != NULL, NULL);
|
qcdm_return_val_if_fail (buf != NULL, NULL);
|
||||||
@@ -97,6 +98,21 @@ qcdm_log_item_evdo_pilot_sets_v2_new (const char *buf, size_t len, int *out_erro
|
|||||||
|
|
||||||
pilot_sets = (DMLogItemEvdoPilotSetsV2 *) log_cmd->data;
|
pilot_sets = (DMLogItemEvdoPilotSetsV2 *) log_cmd->data;
|
||||||
|
|
||||||
|
/* Ensure the flexible sets[] array actually contains as many entries as
|
||||||
|
* the header claims; the modem fully controls these counts. check_log_item()
|
||||||
|
* guarantees len >= sizeof (DMCmdLog) + sizeof (DMLogItemEvdoPilotSetsV2),
|
||||||
|
* so 'avail' cannot underflow.*/
|
||||||
|
avail = len - sizeof (DMCmdLog) - sizeof (DMLogItemEvdoPilotSetsV2);
|
||||||
|
sets_len = ((size_t) pilot_sets->active_count
|
||||||
|
+ (size_t) pilot_sets->candidate_count
|
||||||
|
+ (size_t) pilot_sets->remaining_count)
|
||||||
|
* sizeof (DMLogItemEvdoPilotSetsV2Pilot);
|
||||||
|
if (sets_len > avail) {
|
||||||
|
if (out_error)
|
||||||
|
*out_error = -QCDM_ERROR_RESPONSE_BAD_LENGTH;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
result = qcdm_result_new ();
|
result = qcdm_result_new ();
|
||||||
|
|
||||||
sets_len = pilot_sets->active_count * sizeof (DMLogItemEvdoPilotSetsV2Pilot);
|
sets_len = pilot_sets->active_count * sizeof (DMLogItemEvdoPilotSetsV2Pilot);
|
||||||
|
|||||||
@@ -95,16 +95,16 @@ qcdm_send (int fd, char *buf, size_t len)
|
|||||||
|
|
||||||
while (i < len) {
|
while (i < len) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
status = write (fd, &buf[i], 1);
|
status = write (fd, &buf[i], len - i);
|
||||||
if (status < 0) {
|
if (status <= 0) {
|
||||||
if (errno == EAGAIN) {
|
if (errno == EAGAIN || status == 0) {
|
||||||
eagain_count--;
|
eagain_count--;
|
||||||
if (eagain_count <= 0)
|
if (eagain_count <= 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else
|
} else
|
||||||
assert (errno == 0);
|
assert (errno == 0);
|
||||||
} else
|
} else
|
||||||
i++;
|
i += status;
|
||||||
|
|
||||||
usleep (1000);
|
usleep (1000);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,16 +95,16 @@ qcdm_send (int fd, char *buf, size_t len)
|
|||||||
|
|
||||||
while (i < len) {
|
while (i < len) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
status = write (fd, &buf[i], 1);
|
status = write (fd, &buf[i], len - i);
|
||||||
if (status < 0) {
|
if (status <= 0) {
|
||||||
if (errno == EAGAIN) {
|
if (errno == EAGAIN || status == 0) {
|
||||||
eagain_count--;
|
eagain_count--;
|
||||||
if (eagain_count <= 0)
|
if (eagain_count <= 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else
|
} else
|
||||||
assert (errno == 0);
|
assert (errno == 0);
|
||||||
} else
|
} else
|
||||||
i++;
|
i += status;
|
||||||
|
|
||||||
usleep (1000);
|
usleep (1000);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,16 +96,16 @@ qcdm_send (int fd, char *buf, size_t len)
|
|||||||
|
|
||||||
while (i < len) {
|
while (i < len) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
status = write (fd, &buf[i], 1);
|
status = write (fd, &buf[i], len - i);
|
||||||
if (status < 0) {
|
if (status <= 0) {
|
||||||
if (errno == EAGAIN) {
|
if (errno == EAGAIN || status == 0) {
|
||||||
eagain_count--;
|
eagain_count--;
|
||||||
if (eagain_count <= 0)
|
if (eagain_count <= 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else
|
} else
|
||||||
assert (errno == 0);
|
assert (errno == 0);
|
||||||
} else
|
} else
|
||||||
i++;
|
i += status;
|
||||||
|
|
||||||
usleep (1000);
|
usleep (1000);
|
||||||
}
|
}
|
||||||
|
|||||||
+68
-16
@@ -3,14 +3,14 @@
|
|||||||
|
|
||||||
project(
|
project(
|
||||||
'ModemManager', 'c',
|
'ModemManager', 'c',
|
||||||
version: '1.24.0',
|
version: '1.25.95',
|
||||||
license: 'GPL2',
|
license: 'GPL2',
|
||||||
default_options: [
|
default_options: [
|
||||||
'buildtype=debugoptimized',
|
'buildtype=debugoptimized',
|
||||||
'c_std=gnu89',
|
'c_std=gnu89',
|
||||||
'warning_level=2',
|
'warning_level=2',
|
||||||
],
|
],
|
||||||
meson_version: '>= 0.53.0',
|
meson_version: '>= 0.60.0',
|
||||||
)
|
)
|
||||||
|
|
||||||
meson_version = meson.version()
|
meson_version = meson.version()
|
||||||
@@ -31,11 +31,13 @@ mm_includedir = get_option('includedir')
|
|||||||
mm_libdir = get_option('libdir')
|
mm_libdir = get_option('libdir')
|
||||||
mm_sbindir = get_option('sbindir')
|
mm_sbindir = get_option('sbindir')
|
||||||
mm_sysconfdir = get_option('sysconfdir')
|
mm_sysconfdir = get_option('sysconfdir')
|
||||||
|
mm_sharedstatedir = get_option('sharedstatedir')
|
||||||
|
|
||||||
mm_pkgdatadir = mm_datadir / mm_name
|
mm_pkgdatadir = mm_datadir / mm_name
|
||||||
mm_pkgincludedir = mm_includedir / mm_name
|
mm_pkgincludedir = mm_includedir / mm_name
|
||||||
mm_pkglibdir = mm_libdir / mm_name
|
mm_pkglibdir = mm_libdir / mm_name
|
||||||
mm_pkgsysconfdir = mm_sysconfdir / mm_name
|
mm_pkgsysconfdir = mm_sysconfdir / mm_name
|
||||||
|
mm_pkgsharedstatedir = mm_sharedstatedir / mm_name
|
||||||
|
|
||||||
mm_glib_name = 'libmm-glib'
|
mm_glib_name = 'libmm-glib'
|
||||||
mm_glib_pkgincludedir = mm_includedir / mm_glib_name
|
mm_glib_pkgincludedir = mm_includedir / mm_glib_name
|
||||||
@@ -142,7 +144,24 @@ if get_option('buildtype').contains('debug')
|
|||||||
])
|
])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
add_project_arguments(common_args + cc_args, language: 'c')
|
# Look for existing -DMM_DISABLE_DEPRECATED in CFLAGS
|
||||||
|
pymodule = import('python3')
|
||||||
|
python3 = pymodule.find_python()
|
||||||
|
res = run_command(python3, '-c', 'import os; print(os.environ["CFLAGS"])')
|
||||||
|
cflags_disable_deprecated = false
|
||||||
|
if res.returncode() == 0 and res.stdout().contains('-DMM_DISABLE_DEPRECATED')
|
||||||
|
cflags_disable_deprecated = true
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Handle deprecation enable/disable
|
||||||
|
if get_option('deprecated')
|
||||||
|
cc_args += cc.get_supported_arguments('-Wno-deprecated-declarations')
|
||||||
|
else
|
||||||
|
if cflags_disable_deprecated == false
|
||||||
|
cc_args += '-DMM_DISABLE_DEPRECATED'
|
||||||
|
endif
|
||||||
|
cc_args += cc.get_supported_arguments('-Wdeprecated-declarations')
|
||||||
|
endif
|
||||||
|
|
||||||
glib_version = '2.56'
|
glib_version = '2.56'
|
||||||
|
|
||||||
@@ -168,21 +187,21 @@ glib_deps = declare_dependency(
|
|||||||
|
|
||||||
# DBus system directory
|
# DBus system directory
|
||||||
dbus_dep = dependency('dbus-1')
|
dbus_dep = dependency('dbus-1')
|
||||||
dbus_interfaces_dir = dbus_dep.get_pkgconfig_variable('interfaces_dir', define_variable: ['datadir', mm_datadir])
|
dbus_interfaces_dir = dbus_dep.get_variable(pkgconfig: 'interfaces_dir', pkgconfig_define: ['datadir', mm_datadir])
|
||||||
dbus_system_bus_services_dir = dbus_dep.get_pkgconfig_variable('system_bus_services_dir', define_variable: ['datadir', mm_datadir])
|
dbus_system_bus_services_dir = dbus_dep.get_variable(pkgconfig: 'system_bus_services_dir', pkgconfig_define: ['datadir', mm_datadir])
|
||||||
|
|
||||||
dbus_policy_dir = get_option('dbus_policy_dir')
|
dbus_policy_dir = get_option('dbus_policy_dir')
|
||||||
if dbus_policy_dir == ''
|
if dbus_policy_dir == ''
|
||||||
dbus_policy_dir = dbus_dep.get_pkgconfig_variable('sysconfdir', define_variable: ['sysconfdir', mm_sysconfdir]) / 'dbus-1/system.d'
|
dbus_policy_dir = dbus_dep.get_variable(pkgconfig: 'sysconfdir', pkgconfig_define: ['sysconfdir', mm_sysconfdir]) / 'dbus-1/system.d'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
enable_bash_completion = get_option('bash_completion')
|
enable_bash_completion = get_option('bash_completion')
|
||||||
if enable_bash_completion
|
if enable_bash_completion
|
||||||
bash_completion_dep = dependency('bash-completion')
|
bash_completion_dep = dependency('bash-completion')
|
||||||
bash_completion_completionsdir = bash_completion_dep.get_pkgconfig_variable(
|
bash_completion_completionsdir = bash_completion_dep.get_variable(
|
||||||
'completionsdir',
|
pkgconfig: 'completionsdir',
|
||||||
# bash-completion 2.10 changed the substitutions
|
# bash-completion 2.10 changed the substitutions
|
||||||
define_variable: bash_completion_dep.version().version_compare('>= 2.10') ? ['datadir', mm_datadir] : ['prefix', mm_prefix],
|
pkgconfig_define: bash_completion_dep.version().version_compare('>= 2.10') ? ['datadir', mm_datadir] : ['prefix', mm_prefix],
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -197,7 +216,7 @@ config_h.set('WITH_UDEV', enable_udev)
|
|||||||
udev_udevdir = get_option('udevdir')
|
udev_udevdir = get_option('udevdir')
|
||||||
if udev_udevdir == ''
|
if udev_udevdir == ''
|
||||||
assert(enable_udev, 'udevdir must be explicitly given if udev support is disabled')
|
assert(enable_udev, 'udevdir must be explicitly given if udev support is disabled')
|
||||||
udev_udevdir = dependency('udev').get_pkgconfig_variable('udevdir')
|
udev_udevdir = dependency('udev').get_variable(pkgconfig: 'udevdir')
|
||||||
endif
|
endif
|
||||||
udev_rulesdir = udev_udevdir / 'rules.d'
|
udev_rulesdir = udev_udevdir / 'rules.d'
|
||||||
|
|
||||||
@@ -207,7 +226,7 @@ install_systemdunitdir = (systemd_systemdsystemunitdir != 'no')
|
|||||||
|
|
||||||
if install_systemdunitdir and systemd_systemdsystemunitdir == ''
|
if install_systemdunitdir and systemd_systemdsystemunitdir == ''
|
||||||
systemd_dep = dependency('systemd', not_found_message: 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
|
systemd_dep = dependency('systemd', not_found_message: 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
|
||||||
systemd_systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir', define_variable: ['root_prefix', mm_prefix])
|
systemd_systemdsystemunitdir = systemd_dep.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define: ['root_prefix', mm_prefix])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Suspend/resume support
|
# Suspend/resume support
|
||||||
@@ -240,7 +259,7 @@ enable_polkit = (polkit_opt != 'no')
|
|||||||
if enable_polkit
|
if enable_polkit
|
||||||
polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.97', not_found_message: 'PolicyKit development headers are required')
|
polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.97', not_found_message: 'PolicyKit development headers are required')
|
||||||
|
|
||||||
polkit_gobject_policydir = polkit_gobject_dep.get_pkgconfig_variable('policydir', define_variable: ['prefix', mm_prefix])
|
polkit_gobject_policydir = polkit_gobject_dep.get_variable(pkgconfig: 'policydir', pkgconfig_define: ['prefix', mm_prefix])
|
||||||
|
|
||||||
policy_conf = {'MM_DEFAULT_USER_POLICY': (polkit_opt == 'permissive' ? 'yes' : 'auth_self_keep')}
|
policy_conf = {'MM_DEFAULT_USER_POLICY': (polkit_opt == 'permissive' ? 'yes' : 'auth_self_keep')}
|
||||||
endif
|
endif
|
||||||
@@ -259,14 +278,40 @@ config_h.set('WITH_BUILTIN_PLUGINS', enable_builtin_plugins)
|
|||||||
# MBIM support (enabled by default)
|
# MBIM support (enabled by default)
|
||||||
enable_mbim = get_option('mbim')
|
enable_mbim = get_option('mbim')
|
||||||
if enable_mbim
|
if enable_mbim
|
||||||
mbim_glib_dep = dependency('mbim-glib', version: '>= 1.32.0')
|
mbim_glib_dep = dependency('mbim-glib', version: '>= 1.32.0',
|
||||||
|
required: not get_option('subproject-fallback'))
|
||||||
|
if not mbim_glib_dep.found() and get_option('subproject-fallback')
|
||||||
|
mbim_glib_proj = subproject('libmbim',
|
||||||
|
default_options: ['man=false',
|
||||||
|
'introspection=false',
|
||||||
|
'bash_completion=false',
|
||||||
|
])
|
||||||
|
mbim_glib_dep = mbim_glib_proj.get_variable('libmbim_glib_dep')
|
||||||
|
endif
|
||||||
|
|
||||||
|
# MM should never use deprecated symbols from the libmibm
|
||||||
|
cc_args += '-DMBIM_DISABLE_DEPRECATED'
|
||||||
endif
|
endif
|
||||||
config_h.set('WITH_MBIM', enable_mbim)
|
config_h.set('WITH_MBIM', enable_mbim)
|
||||||
|
|
||||||
# QMI support (enabled by default)
|
# QMI support (enabled by default)
|
||||||
enable_qmi = get_option('qmi')
|
enable_qmi = get_option('qmi')
|
||||||
if enable_qmi
|
if enable_qmi
|
||||||
qmi_glib_dep = dependency('qmi-glib', version: '>= 1.36.0')
|
qmi_glib_dep = dependency('qmi-glib', version: '>= 1.37.95',
|
||||||
|
required: not get_option('subproject-fallback'))
|
||||||
|
|
||||||
|
if not qmi_glib_dep.found() and get_option('subproject-fallback')
|
||||||
|
qmi_glib_proj = subproject('libqmi',
|
||||||
|
default_options: ['man=false',
|
||||||
|
'mbim_qmux=false',
|
||||||
|
'introspection=false',
|
||||||
|
'bash_completion=false',
|
||||||
|
])
|
||||||
|
qmi_glib_dep = qmi_glib_proj.get_variable('libqmi_glib_dep')
|
||||||
|
endif
|
||||||
|
|
||||||
|
# MM should never use deprecated symbols from libqmi
|
||||||
|
cc_args += '-DQMI_DISABLE_DEPRECATED'
|
||||||
endif
|
endif
|
||||||
config_h.set('WITH_QMI', enable_qmi)
|
config_h.set('WITH_QMI', enable_qmi)
|
||||||
|
|
||||||
@@ -274,11 +319,18 @@ config_h.set('WITH_QMI', enable_qmi)
|
|||||||
enable_qrtr = get_option('qrtr')
|
enable_qrtr = get_option('qrtr')
|
||||||
if enable_qrtr
|
if enable_qrtr
|
||||||
assert(enable_qmi, 'QRTR support requires QMI enabled')
|
assert(enable_qmi, 'QRTR support requires QMI enabled')
|
||||||
assert(qmi_glib_dep.get_pkgconfig_variable('qmi_qrtr_supported').to_int().is_odd(), 'Couldn\'t find QRTR support in qmi-glib.')
|
if qmi_glib_dep.type_name() == 'internal'
|
||||||
|
qmi_qrtr_supported = qmi_glib_proj.get_variable('enable_qrtr')
|
||||||
|
else
|
||||||
|
qmi_qrtr_supported = qmi_glib_dep.get_variable(pkgconfig: 'qmi_qrtr_supported')
|
||||||
|
endif
|
||||||
|
assert(qmi_qrtr_supported.to_int().is_odd(), 'Couldn\'t find QRTR support in qmi-glib.')
|
||||||
qrtr_glib_dep = dependency('qrtr-glib', version: '>= 1.0.0')
|
qrtr_glib_dep = dependency('qrtr-glib', version: '>= 1.0.0')
|
||||||
endif
|
endif
|
||||||
config_h.set('WITH_QRTR', enable_qrtr)
|
config_h.set('WITH_QRTR', enable_qrtr)
|
||||||
|
|
||||||
|
add_project_arguments(common_args + cc_args, language: 'c')
|
||||||
|
|
||||||
# Distribution version string
|
# Distribution version string
|
||||||
dist_version = get_option('dist_version')
|
dist_version = get_option('dist_version')
|
||||||
if dist_version != ''
|
if dist_version != ''
|
||||||
@@ -356,7 +408,7 @@ plugins_options_reqs = {
|
|||||||
'pantech': {'available': true, 'shared': []},
|
'pantech': {'available': true, 'shared': []},
|
||||||
'qcom-soc': {'available': enable_qmi, 'shared': []},
|
'qcom-soc': {'available': enable_qmi, 'shared': []},
|
||||||
'quectel': {'available': true, 'shared': ['quectel']},
|
'quectel': {'available': true, 'shared': ['quectel']},
|
||||||
'rolling': {'available': true, 'shared': ['fibocom']},
|
'rolling': {'available': true, 'shared': ['fibocom', 'mtk']},
|
||||||
'samsung': {'available': true, 'shared': ['icera']},
|
'samsung': {'available': true, 'shared': ['icera']},
|
||||||
'sierra-legacy': {'available': true, 'shared': ['icera', 'sierra']},
|
'sierra-legacy': {'available': true, 'shared': ['icera', 'sierra']},
|
||||||
'sierra': {'available': true, 'shared': ['xmm']},
|
'sierra': {'available': true, 'shared': ['xmm']},
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ option('udevdir', type: 'string', value: '', description: 'udev base directory')
|
|||||||
|
|
||||||
option('examples', type: 'boolean', value: true, description: 'install examples')
|
option('examples', type: 'boolean', value: true, description: 'install examples')
|
||||||
option('tests', type: 'boolean', value: true, description: 'enable tests')
|
option('tests', type: 'boolean', value: true, description: 'enable tests')
|
||||||
|
option('subproject-fallback', type: 'boolean', value: false, description: 'allow to use subprojects')
|
||||||
|
|
||||||
option('dbus_policy_dir', type: 'string', value: '', description: 'd-bus system policy directory')
|
option('dbus_policy_dir', type: 'string', value: '', description: 'd-bus system policy directory')
|
||||||
|
|
||||||
@@ -16,6 +17,8 @@ option('systemd_journal', type: 'boolean', value: true, description: 'enable sys
|
|||||||
|
|
||||||
option('polkit', type: 'combo', choices: ['strict', 'permissive', 'no'], value: 'strict', description: 'User auth-polkit configuration option.')
|
option('polkit', type: 'combo', choices: ['strict', 'permissive', 'no'], value: 'strict', description: 'User auth-polkit configuration option.')
|
||||||
|
|
||||||
|
option('deprecated', type: 'boolean', value: true, description: 'build with deprecated symbols')
|
||||||
|
|
||||||
option('at_command_via_dbus', type: 'boolean', value: false, description: 'enable at commands via d-bus')
|
option('at_command_via_dbus', type: 'boolean', value: false, description: 'enable at commands via d-bus')
|
||||||
|
|
||||||
option('builtin_plugins', type: 'boolean', value: false, description: 'integrate all built plugins within the daemon binary')
|
option('builtin_plugins', type: 'boolean', value: false, description: 'integrate all built plugins within the daemon binary')
|
||||||
|
|||||||
+6
-1
@@ -1,5 +1,6 @@
|
|||||||
cs
|
bg
|
||||||
ca
|
ca
|
||||||
|
cs
|
||||||
da
|
da
|
||||||
de
|
de
|
||||||
fi
|
fi
|
||||||
@@ -11,12 +12,16 @@ hu
|
|||||||
id
|
id
|
||||||
it
|
it
|
||||||
ka
|
ka
|
||||||
|
kk
|
||||||
lt
|
lt
|
||||||
nl
|
nl
|
||||||
pl
|
pl
|
||||||
pt_BR
|
pt_BR
|
||||||
ru
|
ru
|
||||||
sk
|
sk
|
||||||
|
sl
|
||||||
|
sr
|
||||||
|
sr@latin
|
||||||
sv
|
sv
|
||||||
tr
|
tr
|
||||||
uk
|
uk
|
||||||
|
|||||||
@@ -0,0 +1,141 @@
|
|||||||
|
# Bulgarian translation for ModemManager.
|
||||||
|
# Copyright (C) 2025 ModemManager's COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the ModemManager package.
|
||||||
|
# twlvnn kraftwerk <kraft_werk@tutanota.com>, 2025, 2026.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: ModemManager main\n"
|
||||||
|
"Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/mobile-broadband/"
|
||||||
|
"ModemManager/issues\n"
|
||||||
|
"POT-Creation-Date: 2025-09-06 03:33+0000\n"
|
||||||
|
"PO-Revision-Date: 2026-02-07 11:28+0100\n"
|
||||||
|
"Last-Translator: \n"
|
||||||
|
"Language-Team: Bulgarian <Bulgarian>\n"
|
||||||
|
"Language: bg\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
"X-Generator: Poedit 3.8\n"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:13
|
||||||
|
msgid "Enable and view Cell Broadcast messages"
|
||||||
|
msgstr "Включвайте и преглеждайте съобщения по мрежата"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:14
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing this device's cell broadcast "
|
||||||
|
"messages."
|
||||||
|
msgstr ""
|
||||||
|
"Системната не позволява включването или преглеждането на съобщенията по "
|
||||||
|
"мрежата на това устройство."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:22
|
||||||
|
msgid "Control the Modem Manager daemon"
|
||||||
|
msgstr "Контролирайте демона на мениджъра на модеми"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:23
|
||||||
|
msgid "System policy prevents controlling the Modem Manager."
|
||||||
|
msgstr "Системата не позволява да се контролира мениджъра на модеми."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:31
|
||||||
|
msgid "Set the primary sim slot of a modem"
|
||||||
|
msgstr "Настройте основния слот за SIM карта на модема"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:32
|
||||||
|
msgid "System policy prevents configuring modem properties."
|
||||||
|
msgstr "Системата не позволява да се настройват свойствата на модеми."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:40
|
||||||
|
msgid "Unlock and control a mobile broadband device"
|
||||||
|
msgstr "Отключвайте и контролирайте устройства за достъп до мобилни мрежи"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:41
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents unlocking or controlling the mobile broadband device."
|
||||||
|
msgstr ""
|
||||||
|
"Системата не позволява да отключвате и контролирате устройства за достъп до "
|
||||||
|
"мобилни мрежи."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:49
|
||||||
|
msgid "Add, modify, and delete mobile broadband contacts"
|
||||||
|
msgstr "Добавяйте, променяйте и изтривайте контакти за достъп до мобилни мрежи"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:50
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents adding, modifying, or deleting this device's contacts."
|
||||||
|
msgstr ""
|
||||||
|
"Системата не позволява добавянето, променянето или изтриването на контактите "
|
||||||
|
"на това устройство."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:58
|
||||||
|
msgid "Send, save, modify, and delete text messages"
|
||||||
|
msgstr "Изпращайте, запазвайте, променяйте и изтривайте текстови съобщения"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:59
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents sending or manipulating this device's text messages."
|
||||||
|
msgstr ""
|
||||||
|
"Системата не позволява изпращането или манипулирането на текстовите "
|
||||||
|
"съобщения на това устройство."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:67
|
||||||
|
msgid "Accept incoming voice calls or start outgoing voice calls."
|
||||||
|
msgstr ""
|
||||||
|
"Приемайте входящи гласови повиквания или стартирайте изходящи гласови "
|
||||||
|
"повиквания."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:68
|
||||||
|
msgid "System policy prevents voice calls."
|
||||||
|
msgstr "Системата не позволява гласови повиквания."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:76
|
||||||
|
msgid "Query network time and timezone information"
|
||||||
|
msgstr "Правете заявки за времето по мрежата и за информация за часовия пояс"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:77
|
||||||
|
msgid "System policy prevents querying network time information."
|
||||||
|
msgstr ""
|
||||||
|
"Системната политика не позволява заявки за информация за времето по мрежата."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:85
|
||||||
|
msgid "Enable and view geographic location and positioning information"
|
||||||
|
msgstr ""
|
||||||
|
"Включвайте и преглеждайте информацията за географското местоположение и "
|
||||||
|
"позициониране"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:86
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing geographic location information."
|
||||||
|
msgstr ""
|
||||||
|
"Системата не позволява включването или преглеждането информация за "
|
||||||
|
"географското местоположение."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:94
|
||||||
|
msgid "Query and utilize network information and services"
|
||||||
|
msgstr "Правете заявки и използвайте информация и услуги за мрежата"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:95
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents querying or utilizing network information and "
|
||||||
|
"services."
|
||||||
|
msgstr ""
|
||||||
|
"Системата не позволява да се правят заявки или да се използват информация и "
|
||||||
|
"услуги за мрежата."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:103
|
||||||
|
msgid "Query and manage firmware on a mobile broadband device"
|
||||||
|
msgstr ""
|
||||||
|
"Правете заявки и управлявайте фърмуер за устройства за достъп до мобилни "
|
||||||
|
"мрежи"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:104
|
||||||
|
msgid "System policy prevents querying or managing this device's firmware."
|
||||||
|
msgstr ""
|
||||||
|
"Системата не позволява да се правят заявки или да се управлява фърмуерът на "
|
||||||
|
"това устройство."
|
||||||
|
|
||||||
|
#: src/mm-sleep-monitor-systemd.c:133
|
||||||
|
msgid "ModemManager needs to reset devices"
|
||||||
|
msgstr "ModemManager трябва да занулира устройства"
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
# Kazakh translation for ModemManager.
|
||||||
|
# Copyright (C) 2026 ModemManager's COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the ModemManager package.
|
||||||
|
# Baurzhan Muftakhidinov <baurthefirst@gmail.com>, 2026.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: ModemManager main\n"
|
||||||
|
"Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/mobile-broadband/"
|
||||||
|
"ModemManager/issues\n"
|
||||||
|
"POT-Creation-Date: 2025-09-05 16:31+0000\n"
|
||||||
|
"PO-Revision-Date: 2026-03-01 12:56+0500\n"
|
||||||
|
"Last-Translator: Baurzhan Muftakhidinov <baurthefirst@gmail.com>\n"
|
||||||
|
"Language-Team: Kazakh <kk_KZ@googlegroups.com>\n"
|
||||||
|
"Language: kk\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
|
"X-Generator: Poedit 3.8\n"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:13
|
||||||
|
msgid "Enable and view Cell Broadcast messages"
|
||||||
|
msgstr "Ұялы хабар тарату хабарламаларын іске қосу және көру"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:14
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing this device's cell broadcast "
|
||||||
|
"messages."
|
||||||
|
msgstr ""
|
||||||
|
"Жүйелік саясат бұл құрылғының ұялы хабар тарату хабарламаларын іске қосуға "
|
||||||
|
"немесе көруге рұқсат бермейді."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:22
|
||||||
|
msgid "Control the Modem Manager daemon"
|
||||||
|
msgstr "Modem Manager қызметін басқару"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:23
|
||||||
|
msgid "System policy prevents controlling the Modem Manager."
|
||||||
|
msgstr "Жүйелік саясат Modem Manager қызметін басқаруға рұқсат бермейді."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:31
|
||||||
|
msgid "Set the primary sim slot of a modem"
|
||||||
|
msgstr "Модемнің негізгі SIM-слотын орнату"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:32
|
||||||
|
msgid "System policy prevents configuring modem properties."
|
||||||
|
msgstr "Жүйелік саясат модем қасиеттерін баптауға рұқсат бермейді."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:40
|
||||||
|
msgid "Unlock and control a mobile broadband device"
|
||||||
|
msgstr "Мобильді кең жолақты құрылғының құлпын ашу және оны басқару"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:41
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents unlocking or controlling the mobile broadband device."
|
||||||
|
msgstr ""
|
||||||
|
"Жүйелік саясат мобильді кең жолақты құрылғының құлпын ашуға немесе оны "
|
||||||
|
"басқаруға рұқсат бермейді."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:49
|
||||||
|
msgid "Add, modify, and delete mobile broadband contacts"
|
||||||
|
msgstr "Мобильді кең жолақты контактілерді қосу, өзгерту және өшіру"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:50
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents adding, modifying, or deleting this device's "
|
||||||
|
"contacts."
|
||||||
|
msgstr ""
|
||||||
|
"Жүйелік саясат бұл құрылғының контактілерін қосуға, өзгертуге немесе "
|
||||||
|
"өшіруге рұқсат бермейді."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:58
|
||||||
|
msgid "Send, save, modify, and delete text messages"
|
||||||
|
msgstr "Мәтіндік хабарламаларды жіберу, сақтау, өзгерту және өшіру"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:59
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents sending or manipulating this device's text messages."
|
||||||
|
msgstr ""
|
||||||
|
"Жүйелік саясат бұл құрылғының мәтіндік хабарламаларын жіберуге немесе "
|
||||||
|
"өңдеуге рұқсат бермейді."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:67
|
||||||
|
msgid "Accept incoming voice calls or start outgoing voice calls."
|
||||||
|
msgstr ""
|
||||||
|
"Кіріс дауыстық қоңырауларды қабылдау немесе шығыс дауыстық қоңырауларды "
|
||||||
|
"бастау."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:68
|
||||||
|
msgid "System policy prevents voice calls."
|
||||||
|
msgstr "Жүйелік саясат дауыстық қоңырауларға рұқсат бермейді."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:76
|
||||||
|
msgid "Query network time and timezone information"
|
||||||
|
msgstr "Желі уақыты мен уақыт белдеуі туралы ақпаратты сұрау"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:77
|
||||||
|
msgid "System policy prevents querying network time information."
|
||||||
|
msgstr "Жүйелік саясат желі уақыты туралы ақпаратты сұрауға рұқсат бермейді."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:85
|
||||||
|
msgid "Enable and view geographic location and positioning information"
|
||||||
|
msgstr "Географиялық орналасу мен позициялау ақпаратын іске қосу және көру"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:86
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing geographic location information."
|
||||||
|
msgstr ""
|
||||||
|
"Жүйелік саясат географиялық орналасу ақпаратын іске қосуға немесе көруге "
|
||||||
|
"рұқсат бермейді."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:94
|
||||||
|
msgid "Query and utilize network information and services"
|
||||||
|
msgstr "Желі ақпаратын және қызметтерін сұрау және пайдалану"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:95
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents querying or utilizing network information and "
|
||||||
|
"services."
|
||||||
|
msgstr ""
|
||||||
|
"Жүйелік саясат желі ақпаратын және қызметтерін сұрауға немесе пайдалануға "
|
||||||
|
"рұқсат бермейді."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:103
|
||||||
|
msgid "Query and manage firmware on a mobile broadband device"
|
||||||
|
msgstr "Мобильді кең жолақты құрылғының микробағдарламасын сұрау және басқару"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:104
|
||||||
|
msgid "System policy prevents querying or managing this device's firmware."
|
||||||
|
msgstr ""
|
||||||
|
"Жүйелік саясат бұл құрылғының микробағдарламасын сұрауға немесе басқаруға "
|
||||||
|
"рұқсат бермейді."
|
||||||
|
|
||||||
|
#: src/mm-sleep-monitor-systemd.c:133
|
||||||
|
msgid "ModemManager needs to reset devices"
|
||||||
|
msgstr "ModemManager-ге құрылғыларды қайта іске қосу қажет"
|
||||||
@@ -9,8 +9,8 @@ msgstr ""
|
|||||||
"Project-Id-Version: ModemManager\n"
|
"Project-Id-Version: ModemManager\n"
|
||||||
"Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/mobile-broadband/"
|
"Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/mobile-broadband/"
|
||||||
"ModemManager/issues\n"
|
"ModemManager/issues\n"
|
||||||
"POT-Creation-Date: 2024-12-02 03:24+0000\n"
|
"POT-Creation-Date: 2025-09-13 03:30+0000\n"
|
||||||
"PO-Revision-Date: 2025-02-09 15:02+0100\n"
|
"PO-Revision-Date: 2025-09-13 11:42+0200\n"
|
||||||
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
|
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
|
||||||
"Language-Team: Polish <community-poland@mozilla.org>\n"
|
"Language-Team: Polish <community-poland@mozilla.org>\n"
|
||||||
"Language: pl\n"
|
"Language: pl\n"
|
||||||
@@ -22,13 +22,15 @@ msgstr ""
|
|||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:13
|
#: data/org.freedesktop.ModemManager1.policy.in.in:13
|
||||||
msgid "Enable and view Cell Broadcast messages"
|
msgid "Enable and view Cell Broadcast messages"
|
||||||
msgstr "Włączenie i wyświetlanie wiadomości SMS"
|
msgstr "Włączenie i wyświetlanie wiadomości nadawania komórkowego"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:14
|
#: data/org.freedesktop.ModemManager1.policy.in.in:14
|
||||||
msgid "System policy prevents enabling or viewing this device's text messages."
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing this device's cell broadcast "
|
||||||
|
"messages."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Ustawienia systemu uniemożliwiają włączanie lub wyświetlanie wiadomości SMS "
|
"Ustawienia systemu uniemożliwiają włączanie lub wyświetlanie wiadomości "
|
||||||
"tego urządzenia."
|
"nadawania komórkowego tego urządzenia."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:22
|
#: data/org.freedesktop.ModemManager1.policy.in.in:22
|
||||||
msgid "Control the Modem Manager daemon"
|
msgid "Control the Modem Manager daemon"
|
||||||
@@ -39,73 +41,81 @@ msgid "System policy prevents controlling the Modem Manager."
|
|||||||
msgstr "Ustawienia systemu uniemożliwiają sterowanie usługą ModemManager."
|
msgstr "Ustawienia systemu uniemożliwiają sterowanie usługą ModemManager."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:31
|
#: data/org.freedesktop.ModemManager1.policy.in.in:31
|
||||||
|
msgid "Set the primary sim slot of a modem"
|
||||||
|
msgstr "Ustawienie głównego gniazda SIM modemu"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:32
|
||||||
|
msgid "System policy prevents configuring modem properties."
|
||||||
|
msgstr "Ustawienia systemu uniemożliwiają konfigurowanie właściwości modemu."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:40
|
||||||
msgid "Unlock and control a mobile broadband device"
|
msgid "Unlock and control a mobile broadband device"
|
||||||
msgstr "Odblokowanie i sterowanie urządzeniem komórkowym"
|
msgstr "Odblokowanie i sterowanie urządzeniem komórkowym"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:32
|
#: data/org.freedesktop.ModemManager1.policy.in.in:41
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents unlocking or controlling the mobile broadband device."
|
"System policy prevents unlocking or controlling the mobile broadband device."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Ustawienia systemu uniemożliwiają odblokowanie lub sterowanie urządzeniem "
|
"Ustawienia systemu uniemożliwiają odblokowanie lub sterowanie urządzeniem "
|
||||||
"komórkowym."
|
"komórkowym."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:40
|
#: data/org.freedesktop.ModemManager1.policy.in.in:49
|
||||||
msgid "Add, modify, and delete mobile broadband contacts"
|
msgid "Add, modify, and delete mobile broadband contacts"
|
||||||
msgstr "Dodawanie, modyfikowanie i usuwanie kontaktów urządzenia komórkowego"
|
msgstr "Dodawanie, modyfikowanie i usuwanie kontaktów urządzenia komórkowego"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:41
|
#: data/org.freedesktop.ModemManager1.policy.in.in:50
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents adding, modifying, or deleting this device's contacts."
|
"System policy prevents adding, modifying, or deleting this device's contacts."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Ustawienia systemu uniemożliwiają dodawanie, modyfikowanie lub usuwanie "
|
"Ustawienia systemu uniemożliwiają dodawanie, modyfikowanie lub usuwanie "
|
||||||
"kontaktów tego urządzenia."
|
"kontaktów tego urządzenia."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:49
|
#: data/org.freedesktop.ModemManager1.policy.in.in:58
|
||||||
msgid "Send, save, modify, and delete text messages"
|
msgid "Send, save, modify, and delete text messages"
|
||||||
msgstr "Wysyłanie, zapisywanie, modyfikowanie i usuwanie wiadomości SMS"
|
msgstr "Wysyłanie, zapisywanie, modyfikowanie i usuwanie wiadomości SMS"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:50
|
#: data/org.freedesktop.ModemManager1.policy.in.in:59
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents sending or manipulating this device's text messages."
|
"System policy prevents sending or manipulating this device's text messages."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Ustawienia systemu uniemożliwiają wysyłanie lub manipulowanie wiadomościami "
|
"Ustawienia systemu uniemożliwiają wysyłanie lub manipulowanie wiadomościami "
|
||||||
"SMS tego urządzenia."
|
"SMS tego urządzenia."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:58
|
#: data/org.freedesktop.ModemManager1.policy.in.in:67
|
||||||
msgid "Accept incoming voice calls or start outgoing voice calls."
|
msgid "Accept incoming voice calls or start outgoing voice calls."
|
||||||
msgstr "Przyjmowanie połączeń przychodzących lub dzwonienie"
|
msgstr "Przyjmowanie połączeń przychodzących lub dzwonienie"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:59
|
#: data/org.freedesktop.ModemManager1.policy.in.in:68
|
||||||
msgid "System policy prevents voice calls."
|
msgid "System policy prevents voice calls."
|
||||||
msgstr "Ustawienia systemu uniemożliwiają dzwonienie."
|
msgstr "Ustawienia systemu uniemożliwiają dzwonienie."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:67
|
#: data/org.freedesktop.ModemManager1.policy.in.in:76
|
||||||
msgid "Query network time and timezone information"
|
msgid "Query network time and timezone information"
|
||||||
msgstr "Odpytywanie informacji o czasie sieciowym i strefie czasowej"
|
msgstr "Odpytywanie informacji o czasie sieciowym i strefie czasowej"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:68
|
#: data/org.freedesktop.ModemManager1.policy.in.in:77
|
||||||
msgid "System policy prevents querying network time information."
|
msgid "System policy prevents querying network time information."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Ustawienia systemu uniemożliwiają odpytywanie informacji o czasie sieciowym."
|
"Ustawienia systemu uniemożliwiają odpytywanie informacji o czasie sieciowym."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:76
|
#: data/org.freedesktop.ModemManager1.policy.in.in:85
|
||||||
msgid "Enable and view geographic location and positioning information"
|
msgid "Enable and view geographic location and positioning information"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Włączanie i wyświetlanie informacji o położeniu geograficznym "
|
"Włączanie i wyświetlanie informacji o położeniu geograficznym "
|
||||||
"i pozycjonowaniu"
|
"i pozycjonowaniu"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:77
|
#: data/org.freedesktop.ModemManager1.policy.in.in:86
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents enabling or viewing geographic location information."
|
"System policy prevents enabling or viewing geographic location information."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Ustawienia systemu uniemożliwiają włączanie lub wyświetlanie informacji "
|
"Ustawienia systemu uniemożliwiają włączanie lub wyświetlanie informacji "
|
||||||
"o położeniu geograficznym."
|
"o położeniu geograficznym."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:85
|
#: data/org.freedesktop.ModemManager1.policy.in.in:94
|
||||||
msgid "Query and utilize network information and services"
|
msgid "Query and utilize network information and services"
|
||||||
msgstr "Odpytywanie i używanie informacji i usług sieciowych"
|
msgstr "Odpytywanie i używanie informacji i usług sieciowych"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:86
|
#: data/org.freedesktop.ModemManager1.policy.in.in:95
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents querying or utilizing network information and "
|
"System policy prevents querying or utilizing network information and "
|
||||||
"services."
|
"services."
|
||||||
@@ -113,17 +123,17 @@ msgstr ""
|
|||||||
"Ustawienia systemu uniemożliwiają odpytywanie lub używanie informacji "
|
"Ustawienia systemu uniemożliwiają odpytywanie lub używanie informacji "
|
||||||
"i usług sieciowych."
|
"i usług sieciowych."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:94
|
#: data/org.freedesktop.ModemManager1.policy.in.in:103
|
||||||
msgid "Query and manage firmware on a mobile broadband device"
|
msgid "Query and manage firmware on a mobile broadband device"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Odpytywanie i zarządzanie oprogramowaniem sprzętowym urządzenia komórkowego"
|
"Odpytywanie i zarządzanie oprogramowaniem sprzętowym urządzenia komórkowego"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:95
|
#: data/org.freedesktop.ModemManager1.policy.in.in:104
|
||||||
msgid "System policy prevents querying or managing this device's firmware."
|
msgid "System policy prevents querying or managing this device's firmware."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Ustawienia systemu uniemożliwiają odpytywanie lub zarządzanie "
|
"Ustawienia systemu uniemożliwiają odpytywanie lub zarządzanie "
|
||||||
"oprogramowaniem sprzętowym tego urządzenia."
|
"oprogramowaniem sprzętowym tego urządzenia."
|
||||||
|
|
||||||
#: src/mm-sleep-monitor-systemd.c:125
|
#: src/mm-sleep-monitor-systemd.c:133
|
||||||
msgid "ModemManager needs to reset devices"
|
msgid "ModemManager needs to reset devices"
|
||||||
msgstr "Usługa ModemManager musi ponownie uruchomić urządzenia"
|
msgstr "Usługa ModemManager musi ponownie uruchomić urządzenia"
|
||||||
|
|||||||
+35
-25
@@ -1,33 +1,35 @@
|
|||||||
# Brazilian Portuguese translation for ModemManager.
|
# Brazilian Portuguese translation for ModemManager.
|
||||||
# Copyright (C) 2025 ModemManager's COPYRIGHT HOLDER
|
# Copyright (C) 2026 ModemManager's COPYRIGHT HOLDER
|
||||||
# This file is distributed under the same license as the ModemManager package.
|
# This file is distributed under the same license as the ModemManager package.
|
||||||
# Rafael Fontenelle <rafaelff@gnome.org>, 2017-2025.
|
# Rafael Fontenelle <rafaelff@gnome.org>, 2017-2026.
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: ModemManager main\n"
|
"Project-Id-Version: ModemManager main\n"
|
||||||
"Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/mobile-broadband/"
|
"Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/mobile-broadband/"
|
||||||
"ModemManager/issues\n"
|
"ModemManager/issues\n"
|
||||||
"POT-Creation-Date: 2024-12-02 03:24+0000\n"
|
"POT-Creation-Date: 2025-09-05 16:31+0000\n"
|
||||||
"PO-Revision-Date: 2025-01-13 22:01-0300\n"
|
"PO-Revision-Date: 2026-06-26 22:30-0300\n"
|
||||||
"Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
|
"Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
|
||||||
"Language-Team: Brazilian Portuguese <https://br.gnome.org/traducao>\n"
|
"Language-Team: Brazilian Portuguese <https://br.gnome.org/traducao>\n"
|
||||||
"Language: pt_BR\n"
|
"Language: pt_BR\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
"X-Generator: Gtranslator 47.1\n"
|
"X-Generator: Gtranslator 50.0\n"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:13
|
#: data/org.freedesktop.ModemManager1.policy.in.in:13
|
||||||
msgid "Enable and view Cell Broadcast messages"
|
msgid "Enable and view Cell Broadcast messages"
|
||||||
msgstr "Habilitar e visualizar mensagens de transmissão celular"
|
msgstr "Habilitar e visualizar mensagens de transmissão celular"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:14
|
#: data/org.freedesktop.ModemManager1.policy.in.in:14
|
||||||
msgid "System policy prevents enabling or viewing this device's text messages."
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing this device's cell broadcast "
|
||||||
|
"messages."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"A política de sistema impede de habilitar ou visualizar as mensagens de "
|
"A política de sistema impede de habilitar ou visualizar as mensagens de "
|
||||||
"texto deste dispositivo."
|
"transmissão celular deste dispositivo."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:22
|
#: data/org.freedesktop.ModemManager1.policy.in.in:22
|
||||||
msgid "Control the Modem Manager daemon"
|
msgid "Control the Modem Manager daemon"
|
||||||
@@ -38,71 +40,79 @@ msgid "System policy prevents controlling the Modem Manager."
|
|||||||
msgstr "A política de sistema impede de controlar o ModemManager."
|
msgstr "A política de sistema impede de controlar o ModemManager."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:31
|
#: data/org.freedesktop.ModemManager1.policy.in.in:31
|
||||||
|
msgid "Set the primary sim slot of a modem"
|
||||||
|
msgstr "Configurar o slot principal do cartão SIM de um modem"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:32
|
||||||
|
msgid "System policy prevents configuring modem properties."
|
||||||
|
msgstr "A política de sistema impede a configuração das propriedades do modem."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:40
|
||||||
msgid "Unlock and control a mobile broadband device"
|
msgid "Unlock and control a mobile broadband device"
|
||||||
msgstr "Desbloquear e controlar um dispositivo de banda larga móvel"
|
msgstr "Desbloquear e controlar um dispositivo de banda larga móvel"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:32
|
#: data/org.freedesktop.ModemManager1.policy.in.in:41
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents unlocking or controlling the mobile broadband device."
|
"System policy prevents unlocking or controlling the mobile broadband device."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"A política de sistema impede de desbloquear ou controlar o dispositivo de "
|
"A política de sistema impede de desbloquear ou controlar o dispositivo de "
|
||||||
"banda larga móvel."
|
"banda larga móvel."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:40
|
#: data/org.freedesktop.ModemManager1.policy.in.in:49
|
||||||
msgid "Add, modify, and delete mobile broadband contacts"
|
msgid "Add, modify, and delete mobile broadband contacts"
|
||||||
msgstr "Adicionar, modificar e excluir contatos de banda larga móvel"
|
msgstr "Adicionar, modificar e excluir contatos de banda larga móvel"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:41
|
#: data/org.freedesktop.ModemManager1.policy.in.in:50
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents adding, modifying, or deleting this device's contacts."
|
"System policy prevents adding, modifying, or deleting this device's contacts."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"A política de sistema impede de adicionar, modificar ou excluir os contatos "
|
"A política de sistema impede de adicionar, modificar ou excluir os contatos "
|
||||||
"deste dispositivo."
|
"deste dispositivo."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:49
|
#: data/org.freedesktop.ModemManager1.policy.in.in:58
|
||||||
msgid "Send, save, modify, and delete text messages"
|
msgid "Send, save, modify, and delete text messages"
|
||||||
msgstr "Enviar, salvar, modificar e excluir mensagens de texto"
|
msgstr "Enviar, salvar, modificar e excluir mensagens de texto"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:50
|
#: data/org.freedesktop.ModemManager1.policy.in.in:59
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents sending or manipulating this device's text messages."
|
"System policy prevents sending or manipulating this device's text messages."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"A política de sistema impede de enviar ou manipular as mensagens de texto "
|
"A política de sistema impede de enviar ou manipular as mensagens de texto "
|
||||||
"deste dispositivo."
|
"deste dispositivo."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:58
|
#: data/org.freedesktop.ModemManager1.policy.in.in:67
|
||||||
msgid "Accept incoming voice calls or start outgoing voice calls."
|
msgid "Accept incoming voice calls or start outgoing voice calls."
|
||||||
msgstr "Aceitar chamadas de voz recebidas ou iniciar chamadas de voz de saída."
|
msgstr "Aceitar chamadas de voz recebidas ou iniciar chamadas de voz de saída."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:59
|
#: data/org.freedesktop.ModemManager1.policy.in.in:68
|
||||||
msgid "System policy prevents voice calls."
|
msgid "System policy prevents voice calls."
|
||||||
msgstr "A política de sistema impede chamadas de voz."
|
msgstr "A política de sistema impede chamadas de voz."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:67
|
#: data/org.freedesktop.ModemManager1.policy.in.in:76
|
||||||
msgid "Query network time and timezone information"
|
msgid "Query network time and timezone information"
|
||||||
msgstr "Consultar informações de hora e fuso horário da rede"
|
msgstr "Consultar informações de hora e fuso horário da rede"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:68
|
#: data/org.freedesktop.ModemManager1.policy.in.in:77
|
||||||
msgid "System policy prevents querying network time information."
|
msgid "System policy prevents querying network time information."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"A política de sistema impede de consultar informações de horário da rede."
|
"A política de sistema impede de consultar informações de horário da rede."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:76
|
#: data/org.freedesktop.ModemManager1.policy.in.in:85
|
||||||
msgid "Enable and view geographic location and positioning information"
|
msgid "Enable and view geographic location and positioning information"
|
||||||
msgstr "Habilitar e ver informações de posicionamento e localização geográfica"
|
msgstr "Habilitar e ver informações de posicionamento e localização geográfica"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:77
|
#: data/org.freedesktop.ModemManager1.policy.in.in:86
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents enabling or viewing geographic location information."
|
"System policy prevents enabling or viewing geographic location information."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"A política de sistema impede de habilitar ou ver informações de localização "
|
"A política de sistema impede de habilitar ou ver informações de localização "
|
||||||
"geográfica."
|
"geográfica."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:85
|
#: data/org.freedesktop.ModemManager1.policy.in.in:94
|
||||||
msgid "Query and utilize network information and services"
|
msgid "Query and utilize network information and services"
|
||||||
msgstr "Consultar ou utilizar serviços e informações de rede."
|
msgstr "Consultar ou utilizar serviços e informações de rede"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:86
|
#: data/org.freedesktop.ModemManager1.policy.in.in:95
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents querying or utilizing network information and "
|
"System policy prevents querying or utilizing network information and "
|
||||||
"services."
|
"services."
|
||||||
@@ -110,16 +120,16 @@ msgstr ""
|
|||||||
"A política de sistema impede de consultar ou utilizar serviços e informações "
|
"A política de sistema impede de consultar ou utilizar serviços e informações "
|
||||||
"de rede."
|
"de rede."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:94
|
#: data/org.freedesktop.ModemManager1.policy.in.in:103
|
||||||
msgid "Query and manage firmware on a mobile broadband device"
|
msgid "Query and manage firmware on a mobile broadband device"
|
||||||
msgstr "Consultar e gerenciar firmware em um dispositivo de banda larga móvel"
|
msgstr "Consultar e gerenciar firmware em um dispositivo de banda larga móvel"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:95
|
#: data/org.freedesktop.ModemManager1.policy.in.in:104
|
||||||
msgid "System policy prevents querying or managing this device's firmware."
|
msgid "System policy prevents querying or managing this device's firmware."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"A política de sistema impede de consultar ou gerenciar o firmware do "
|
"A política de sistema impede de consultar ou gerenciar o firmware do "
|
||||||
"dispositivo."
|
"dispositivo."
|
||||||
|
|
||||||
#: src/mm-sleep-monitor-systemd.c:125
|
#: src/mm-sleep-monitor-systemd.c:133
|
||||||
msgid "ModemManager needs to reset devices"
|
msgid "ModemManager needs to reset devices"
|
||||||
msgstr "O ModemManager precisa reiniciar os dispositivos"
|
msgstr "O ModemManager precisa reiniciar os dispositivos"
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
# Slovenian translation for ModemManager.
|
||||||
|
# Copyright (C) 2024 ModemManager's COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the ModemManager package.
|
||||||
|
#
|
||||||
|
# Martin Srebotnjak <miles@filmsi.net>, 2024, 2025.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: ModemManager main\n"
|
||||||
|
"Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/mobile-broadband/"
|
||||||
|
"ModemManager/issues\n"
|
||||||
|
"POT-Creation-Date: 2025-09-11 03:31+0000\n"
|
||||||
|
"PO-Revision-Date: 2025-09-11 11:33+0200\n"
|
||||||
|
"Last-Translator: Martin Srebotnjak <miles@filmsi.net>\n"
|
||||||
|
"Language-Team: Slovenian GNOME Translation Team <gnome-si@googlegroups.com>\n"
|
||||||
|
"Language: sl\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || "
|
||||||
|
"n%100==4 ? 3 : 0);\n"
|
||||||
|
"X-Generator: Poedit 2.2.1\n"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:13
|
||||||
|
msgid "Enable and view Cell Broadcast messages"
|
||||||
|
msgstr "Omogoči in pokaži oddajna sporočila telefona"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:14
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing this device's cell broadcast "
|
||||||
|
"messages."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila preprečujejo omogočanje ali ogledovanje oddajnih "
|
||||||
|
"telefonskih sporočil te naprave."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:22
|
||||||
|
msgid "Control the Modem Manager daemon"
|
||||||
|
msgstr "Upravljajte prikriti proces upravitelja modema"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:23
|
||||||
|
msgid "System policy prevents controlling the Modem Manager."
|
||||||
|
msgstr "Sistemska pravila preprečujejo nadzor upravitelja modemov."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:31
|
||||||
|
msgid "Set the primary sim slot of a modem"
|
||||||
|
msgstr "Nastavite primarno režo za kartico SIM modema"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:32
|
||||||
|
msgid "System policy prevents configuring modem properties."
|
||||||
|
msgstr "Sistemska pravila preprečujejo nastavljanje lastnosti modema."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:40
|
||||||
|
msgid "Unlock and control a mobile broadband device"
|
||||||
|
msgstr "Odklenite in nadzorujte naprave za mobilno širokopasovno povezavo"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:41
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents unlocking or controlling the mobile broadband device."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila preprečujejo odklepanje ali nadzor mobilne širokopasovne "
|
||||||
|
"naprave."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:49
|
||||||
|
msgid "Add, modify, and delete mobile broadband contacts"
|
||||||
|
msgstr ""
|
||||||
|
"Dodajte, spreminjajte in brišite stike za mobilno širokopasovno povezavo"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:50
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents adding, modifying, or deleting this device's contacts."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila preprečujejo dodajanje, spreminjanje ali brisanje stikov v "
|
||||||
|
"tej napravi."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:58
|
||||||
|
msgid "Send, save, modify, and delete text messages"
|
||||||
|
msgstr "Pošiljajte, shranjujte, spreminjajte in brišite besedilna sporočila"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:59
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents sending or manipulating this device's text messages."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila preprečujejo pošiljanje besedilnih sporočil te naprave ali "
|
||||||
|
"manipulacijo z njimi."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:67
|
||||||
|
msgid "Accept incoming voice calls or start outgoing voice calls."
|
||||||
|
msgstr "Sprejmite dohodne glasovne klice ali začnite odhodne glasovne klice."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:68
|
||||||
|
msgid "System policy prevents voice calls."
|
||||||
|
msgstr "Sistemska pravila preprečujejo glasovne klice."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:76
|
||||||
|
msgid "Query network time and timezone information"
|
||||||
|
msgstr "Poizvedujte po omrežnem času in časovnem pasu"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:77
|
||||||
|
msgid "System policy prevents querying network time information."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravilna preprečujejo poizvedovanje po podatkih o omrežnem času."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:85
|
||||||
|
msgid "Enable and view geographic location and positioning information"
|
||||||
|
msgstr "Omogočite in oglejte si informacije o zemljepisni lokaciji in položaju"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:86
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing geographic location information."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila preprečujejo omogočanje ali ogled informacij o zemljepisni "
|
||||||
|
"lokaciji."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:94
|
||||||
|
msgid "Query and utilize network information and services"
|
||||||
|
msgstr "Poizvedujte in uporabljajte omrežne informacije in storitve"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:95
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents querying or utilizing network information and "
|
||||||
|
"services."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila preprečujejo poizvedovanje ali uporabo omrežnih informacij "
|
||||||
|
"in storitev."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:103
|
||||||
|
msgid "Query and manage firmware on a mobile broadband device"
|
||||||
|
msgstr ""
|
||||||
|
"Poizvedujte in upravljajte vdelano programsko opremo v mobilni širokopasovni "
|
||||||
|
"napravi"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:104
|
||||||
|
msgid "System policy prevents querying or managing this device's firmware."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila preprečujejo poizvedovanje ali upravljanje vdelane "
|
||||||
|
"programske opreme te naprave."
|
||||||
|
|
||||||
|
#: src/mm-sleep-monitor-systemd.c:133
|
||||||
|
msgid "ModemManager needs to reset devices"
|
||||||
|
msgstr "ModemManager mora ponastaviti naprave"
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
# Serbian translation for ModemManager.
|
||||||
|
# Copyright (C) 2026 ModemManager's COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the ModemManager package.
|
||||||
|
# Марко Костић <marko.m.kostic@gmail.com>, 2026.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: ModemManager main\n"
|
||||||
|
"Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/mobile-broadband/"
|
||||||
|
"ModemManager/issues\n"
|
||||||
|
"POT-Creation-Date: 2025-09-05 16:31+0000\n"
|
||||||
|
"PO-Revision-Date: 2026-04-11 14:54+0200\n"
|
||||||
|
"Last-Translator: Марко Костић <marko.m.kostic@gmail.com>\n"
|
||||||
|
"Language-Team: Serbian <Serbian>\n"
|
||||||
|
"Language: sr\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=4; plural=n==1? 3 : n%10==1 && n%100!=11 ? 0 : "
|
||||||
|
"n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||||
|
"X-Generator: Poedit 3.9\n"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:13
|
||||||
|
msgid "Enable and view Cell Broadcast messages"
|
||||||
|
msgstr "Омогућите и прегледајте поруке емитовања ћелије"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:14
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing this device's cell broadcast "
|
||||||
|
"messages."
|
||||||
|
msgstr ""
|
||||||
|
"Системска правила спречавају омогућавање или преглед порука емитовања у "
|
||||||
|
"ћелији овог уређаја."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:22
|
||||||
|
msgid "Control the Modem Manager daemon"
|
||||||
|
msgstr "Управљајте демоном управника модема"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:23
|
||||||
|
msgid "System policy prevents controlling the Modem Manager."
|
||||||
|
msgstr "Системска правила спречавају управљање управником модема."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:31
|
||||||
|
msgid "Set the primary sim slot of a modem"
|
||||||
|
msgstr "Поставите примарни СИМ слот модема"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:32
|
||||||
|
msgid "System policy prevents configuring modem properties."
|
||||||
|
msgstr "Системска правила спречавају подешавање својстава модема."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:40
|
||||||
|
msgid "Unlock and control a mobile broadband device"
|
||||||
|
msgstr "Откључајте и управљајте мобилним широкопојасним уређајем"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:41
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents unlocking or controlling the mobile broadband device."
|
||||||
|
msgstr ""
|
||||||
|
"Системска правила спречавају откључавање или управљање мобилним "
|
||||||
|
"широкопојасним уређајем."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:49
|
||||||
|
msgid "Add, modify, and delete mobile broadband contacts"
|
||||||
|
msgstr "Додајте, мењајте и бришите контакте мобилне широкопојасне мреже"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:50
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents adding, modifying, or deleting this device's contacts."
|
||||||
|
msgstr ""
|
||||||
|
"Системска правила спречавају додавање, мењање или брисање контаката овог "
|
||||||
|
"уређаја."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:58
|
||||||
|
msgid "Send, save, modify, and delete text messages"
|
||||||
|
msgstr "Шаљите, чувајте, мењајте и бришите текстуалне поруке"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:59
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents sending or manipulating this device's text messages."
|
||||||
|
msgstr ""
|
||||||
|
"Системска правила спречавају слање или управљање текстуалним порукама овог "
|
||||||
|
"уређаја."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:67
|
||||||
|
msgid "Accept incoming voice calls or start outgoing voice calls."
|
||||||
|
msgstr ""
|
||||||
|
"Прихватите долазне говорне позиве или започните одлазне говорне позиве."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:68
|
||||||
|
msgid "System policy prevents voice calls."
|
||||||
|
msgstr "Системска правила спречавају говорне позиве."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:76
|
||||||
|
msgid "Query network time and timezone information"
|
||||||
|
msgstr "Упитајте време мреже и податке о временској зони"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:77
|
||||||
|
msgid "System policy prevents querying network time information."
|
||||||
|
msgstr "Системска правила спречавају упитивање података о времену мреже."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:85
|
||||||
|
msgid "Enable and view geographic location and positioning information"
|
||||||
|
msgstr "Омогућите и прегледајте податке о географском положају и позиционирању"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:86
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing geographic location information."
|
||||||
|
msgstr ""
|
||||||
|
"Системска правила спречавају омогућавање или преглед података о географском "
|
||||||
|
"положају."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:94
|
||||||
|
msgid "Query and utilize network information and services"
|
||||||
|
msgstr "Упитајте и користите мрежне податке и услуге"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:95
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents querying or utilizing network information and "
|
||||||
|
"services."
|
||||||
|
msgstr ""
|
||||||
|
"Системска правила спречавају упитивање или коришћење мрежних података и "
|
||||||
|
"услуга."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:103
|
||||||
|
msgid "Query and manage firmware on a mobile broadband device"
|
||||||
|
msgstr "Упит и управљање фирмвером на мобилном широкопојасном уређају"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:104
|
||||||
|
msgid "System policy prevents querying or managing this device's firmware."
|
||||||
|
msgstr "Системска политика спречава упит или управљање фирмвером овог уређаја."
|
||||||
|
|
||||||
|
#: src/mm-sleep-monitor-systemd.c:133
|
||||||
|
msgid "ModemManager needs to reset devices"
|
||||||
|
msgstr "Управник модема мора да поново покрене уређаје"
|
||||||
+136
@@ -0,0 +1,136 @@
|
|||||||
|
# Serbian translation for ModemManager.
|
||||||
|
# Copyright (C) 2026 ModemManager's COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the ModemManager package.
|
||||||
|
# Marko Kostić <marko.m.kostic@gmail.com>, 2026.
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: ModemManager main\n"
|
||||||
|
"Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/mobile-broadband/"
|
||||||
|
"ModemManager/issues\n"
|
||||||
|
"POT-Creation-Date: 2025-09-05 16:31+0000\n"
|
||||||
|
"PO-Revision-Date: 2026-04-11 14:54+0200\n"
|
||||||
|
"Last-Translator: Marko Kostić <marko.m.kostic@gmail.com>\n"
|
||||||
|
"Language-Team: Serbian <Serbian>\n"
|
||||||
|
"Language: sr\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=4; plural=n==1? 3 : n%10==1 && n%100!=11 ? 0 : "
|
||||||
|
"n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||||
|
"X-Generator: Poedit 3.9\n"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:13
|
||||||
|
msgid "Enable and view Cell Broadcast messages"
|
||||||
|
msgstr "Omogućite i pregledajte poruke emitovanja ćelije"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:14
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing this device's cell broadcast "
|
||||||
|
"messages."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila sprečavaju omogućavanje ili pregled poruka emitovanja u "
|
||||||
|
"ćeliji ovog uređaja."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:22
|
||||||
|
msgid "Control the Modem Manager daemon"
|
||||||
|
msgstr "Upravljajte demonom upravnika modema"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:23
|
||||||
|
msgid "System policy prevents controlling the Modem Manager."
|
||||||
|
msgstr "Sistemska pravila sprečavaju upravljanje upravnikom modema."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:31
|
||||||
|
msgid "Set the primary sim slot of a modem"
|
||||||
|
msgstr "Postavite primarni SIM slot modema"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:32
|
||||||
|
msgid "System policy prevents configuring modem properties."
|
||||||
|
msgstr "Sistemska pravila sprečavaju podešavanje svojstava modema."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:40
|
||||||
|
msgid "Unlock and control a mobile broadband device"
|
||||||
|
msgstr "Otključajte i upravljajte mobilnim širokopojasnim uređajem"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:41
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents unlocking or controlling the mobile broadband device."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila sprečavaju otključavanje ili upravljanje mobilnim "
|
||||||
|
"širokopojasnim uređajem."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:49
|
||||||
|
msgid "Add, modify, and delete mobile broadband contacts"
|
||||||
|
msgstr "Dodajte, menjajte i brišite kontakte mobilne širokopojasne mreže"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:50
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents adding, modifying, or deleting this device's contacts."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila sprečavaju dodavanje, menjanje ili brisanje kontakata ovog "
|
||||||
|
"uređaja."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:58
|
||||||
|
msgid "Send, save, modify, and delete text messages"
|
||||||
|
msgstr "Šaljite, čuvajte, menjajte i brišite tekstualne poruke"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:59
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents sending or manipulating this device's text messages."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila sprečavaju slanje ili upravljanje tekstualnim porukama "
|
||||||
|
"ovog uređaja."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:67
|
||||||
|
msgid "Accept incoming voice calls or start outgoing voice calls."
|
||||||
|
msgstr ""
|
||||||
|
"Prihvatite dolazne govorne pozive ili započnite odlazne govorne pozive."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:68
|
||||||
|
msgid "System policy prevents voice calls."
|
||||||
|
msgstr "Sistemska pravila sprečavaju govorne pozive."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:76
|
||||||
|
msgid "Query network time and timezone information"
|
||||||
|
msgstr "Upitajte vreme mreže i podatke o vremenskoj zoni"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:77
|
||||||
|
msgid "System policy prevents querying network time information."
|
||||||
|
msgstr "Sistemska pravila sprečavaju upitivanje podataka o vremenu mreže."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:85
|
||||||
|
msgid "Enable and view geographic location and positioning information"
|
||||||
|
msgstr ""
|
||||||
|
"Omogućite i pregledajte podatke o geografskom položaju i pozicioniranju"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:86
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing geographic location information."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila sprečavaju omogućavanje ili pregled podataka o geografskom "
|
||||||
|
"položaju."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:94
|
||||||
|
msgid "Query and utilize network information and services"
|
||||||
|
msgstr "Upitajte i koristite mrežne podatke i usluge"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:95
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents querying or utilizing network information and "
|
||||||
|
"services."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska pravila sprečavaju upitivanje ili korišćenje mrežnih podataka i "
|
||||||
|
"usluga."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:103
|
||||||
|
msgid "Query and manage firmware on a mobile broadband device"
|
||||||
|
msgstr "Upit i upravljanje firmverom na mobilnom širokopojasnom uređaju"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:104
|
||||||
|
msgid "System policy prevents querying or managing this device's firmware."
|
||||||
|
msgstr ""
|
||||||
|
"Sistemska politika sprečava upit ili upravljanje firmverom ovog uređaja."
|
||||||
|
|
||||||
|
#: src/mm-sleep-monitor-systemd.c:133
|
||||||
|
msgid "ModemManager needs to reset devices"
|
||||||
|
msgstr "Upravnik modema mora da ponovo pokrene uređaje"
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
# Swedish translation for ModemManager.
|
# Swedish translation for ModemManager.
|
||||||
# Copyright (C) 2017, 2020 ModemManager's COPYRIGHT HOLDER
|
# Copyright © 2017, 2020, 2024, 2025 ModemManager's COPYRIGHT HOLDER
|
||||||
# This file is distributed under the same license as the ModemManager package.
|
# This file is distributed under the same license as the ModemManager package.
|
||||||
# Josef Andersson <l10nl18nsweja@gmail.com>, 2017.
|
# Josef Andersson <l10nl18nsweja@gmail.com>, 2017.
|
||||||
# Anders Jonsson <anders.jonsson@norsjovallen.se>, 2020.
|
# Anders Jonsson <anders.jonsson@norsjovallen.se>, 2020, 2024, 2025.
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: ModemManager main\n"
|
"Project-Id-Version: ModemManager main\n"
|
||||||
"Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/mobile-broadband/"
|
"Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/mobile-broadband/"
|
||||||
"ModemManager/issues\n"
|
"ModemManager/issues\n"
|
||||||
"POT-Creation-Date: 2022-07-16 14:32+0200\n"
|
"POT-Creation-Date: 2025-09-07 15:30+0000\n"
|
||||||
"PO-Revision-Date: 2020-09-18 23:56+0200\n"
|
"PO-Revision-Date: 2025-09-07 22:14+0200\n"
|
||||||
"Last-Translator: Anders Jonsson <anders.jonsson@norsjovallen.se>\n"
|
"Last-Translator: Anders Jonsson <anders.jonsson@norsjovallen.se>\n"
|
||||||
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
|
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
|
||||||
"Language: sv\n"
|
"Language: sv\n"
|
||||||
@@ -18,81 +18,102 @@ msgstr ""
|
|||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
"X-Generator: Poedit 2.4.1\n"
|
"X-Generator: Poedit 3.7\n"
|
||||||
|
|
||||||
|
# https://it-ord.computersweden.se/ord/cell-broadcast/
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:13
|
#: data/org.freedesktop.ModemManager1.policy.in.in:13
|
||||||
|
msgid "Enable and view Cell Broadcast messages"
|
||||||
|
msgstr "Aktivera och visa Cell Broadcast-meddelanden"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:14
|
||||||
|
msgid ""
|
||||||
|
"System policy prevents enabling or viewing this device's cell broadcast "
|
||||||
|
"messages."
|
||||||
|
msgstr ""
|
||||||
|
"En systempolicy förhindrar att aktivera eller visa denna enhets Cell "
|
||||||
|
"Broadcast-meddelanden."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:22
|
||||||
msgid "Control the Modem Manager daemon"
|
msgid "Control the Modem Manager daemon"
|
||||||
msgstr "Kontrollera demonen för Modem Manager"
|
msgstr "Kontrollera demonen för Modem Manager"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:14
|
#: data/org.freedesktop.ModemManager1.policy.in.in:23
|
||||||
msgid "System policy prevents controlling the Modem Manager."
|
msgid "System policy prevents controlling the Modem Manager."
|
||||||
msgstr "En systempolicy förhindrar kontroll av Modem Manager."
|
msgstr "En systempolicy förhindrar kontroll av Modem Manager."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:22
|
#: data/org.freedesktop.ModemManager1.policy.in.in:31
|
||||||
|
msgid "Set the primary sim slot of a modem"
|
||||||
|
msgstr "Ställ in primärt SIM-fack för ett modem"
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:32
|
||||||
|
msgid "System policy prevents configuring modem properties."
|
||||||
|
msgstr "En systempolicy förhindrar konfiguration av modemegenskaper."
|
||||||
|
|
||||||
|
#: data/org.freedesktop.ModemManager1.policy.in.in:40
|
||||||
msgid "Unlock and control a mobile broadband device"
|
msgid "Unlock and control a mobile broadband device"
|
||||||
msgstr "Lås upp och kontrollera en mobil bredbandsenhet"
|
msgstr "Lås upp och kontrollera en mobil bredbandsenhet"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:23
|
#: data/org.freedesktop.ModemManager1.policy.in.in:41
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents unlocking or controlling the mobile broadband device."
|
"System policy prevents unlocking or controlling the mobile broadband device."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"En systempolicy hindrar upplåsning eller kontroll över den mobila "
|
"En systempolicy hindrar upplåsning eller kontroll över den mobila "
|
||||||
"bredbandsenheten."
|
"bredbandsenheten."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:31
|
#: data/org.freedesktop.ModemManager1.policy.in.in:49
|
||||||
msgid "Add, modify, and delete mobile broadband contacts"
|
msgid "Add, modify, and delete mobile broadband contacts"
|
||||||
msgstr "Lägg till, ändra och ta bort mobila bredbandskontakter"
|
msgstr "Lägg till, ändra och ta bort mobila bredbandskontakter"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:32
|
#: data/org.freedesktop.ModemManager1.policy.in.in:50
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents adding, modifying, or deleting this device's contacts."
|
"System policy prevents adding, modifying, or deleting this device's contacts."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"En systempolicy förhindrar att lägga till, ändra och ta bort denna enhets "
|
"En systempolicy förhindrar att lägga till, ändra och ta bort denna enhets "
|
||||||
"kontakter."
|
"kontakter."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:40
|
#: data/org.freedesktop.ModemManager1.policy.in.in:58
|
||||||
msgid "Send, save, modify, and delete text messages"
|
msgid "Send, save, modify, and delete text messages"
|
||||||
msgstr "Skicka, spara, ändra och ta bort meddelanden"
|
msgstr "Skicka, spara, ändra och ta bort meddelanden"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:41
|
#: data/org.freedesktop.ModemManager1.policy.in.in:59
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents sending or manipulating this device's text messages."
|
"System policy prevents sending or manipulating this device's text messages."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"En systempolicy förhindrar att skicka eller ändra denna enhets "
|
"En systempolicy förhindrar att skicka eller ändra denna enhets "
|
||||||
"textmeddelanden."
|
"textmeddelanden."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:49
|
#: data/org.freedesktop.ModemManager1.policy.in.in:67
|
||||||
msgid "Accept incoming voice calls or start outgoing voice calls."
|
msgid "Accept incoming voice calls or start outgoing voice calls."
|
||||||
msgstr "Acceptera inkommande röstsamtal eller påbörja utgående röstsamtal."
|
msgstr "Acceptera inkommande röstsamtal eller påbörja utgående röstsamtal."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:50
|
#: data/org.freedesktop.ModemManager1.policy.in.in:68
|
||||||
msgid "System policy prevents voice calls."
|
msgid "System policy prevents voice calls."
|
||||||
msgstr "En systempolicy förhindrar röstsamtal."
|
msgstr "En systempolicy förhindrar röstsamtal."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:58
|
#: data/org.freedesktop.ModemManager1.policy.in.in:76
|
||||||
msgid "Query network time and timezone information"
|
msgid "Query network time and timezone information"
|
||||||
msgstr "Fråga efter nätverkstid och tidzonsinformation"
|
msgstr "Fråga efter nätverkstid och tidzonsinformation"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:59
|
#: data/org.freedesktop.ModemManager1.policy.in.in:77
|
||||||
msgid "System policy prevents querying network time information."
|
msgid "System policy prevents querying network time information."
|
||||||
msgstr "En systempolicy förhindrar frågande av nätverkstidsinformation."
|
msgstr "En systempolicy förhindrar frågande av nätverkstidsinformation."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:67
|
#: data/org.freedesktop.ModemManager1.policy.in.in:85
|
||||||
msgid "Enable and view geographic location and positioning information"
|
msgid "Enable and view geographic location and positioning information"
|
||||||
msgstr "Aktivera och visa geografisk plats samt positioneringsinformation"
|
msgstr "Aktivera och visa geografisk plats samt positioneringsinformation"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:68
|
#: data/org.freedesktop.ModemManager1.policy.in.in:86
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents enabling or viewing geographic location information."
|
"System policy prevents enabling or viewing geographic location information."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"En systempolicy förhindrar aktivering eller visning av geografisk "
|
"En systempolicy förhindrar aktivering eller visning av geografisk "
|
||||||
"platsinformation."
|
"platsinformation."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:76
|
#: data/org.freedesktop.ModemManager1.policy.in.in:94
|
||||||
msgid "Query and utilize network information and services"
|
msgid "Query and utilize network information and services"
|
||||||
msgstr "Fråga efter och nyttja nätverksinformation och tjänster"
|
msgstr "Fråga efter och nyttja nätverksinformation och tjänster"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:77
|
#: data/org.freedesktop.ModemManager1.policy.in.in:95
|
||||||
msgid ""
|
msgid ""
|
||||||
"System policy prevents querying or utilizing network information and "
|
"System policy prevents querying or utilizing network information and "
|
||||||
"services."
|
"services."
|
||||||
@@ -100,16 +121,16 @@ msgstr ""
|
|||||||
"En systempolicy förhindrar frågande och nyttjande av nätverksinformation och "
|
"En systempolicy förhindrar frågande och nyttjande av nätverksinformation och "
|
||||||
"tjänster."
|
"tjänster."
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:85
|
#: data/org.freedesktop.ModemManager1.policy.in.in:103
|
||||||
msgid "Query and manage firmware on a mobile broadband device"
|
msgid "Query and manage firmware on a mobile broadband device"
|
||||||
msgstr "Fråga efter och hantera fast programvara för en mobil bredbandsenhet"
|
msgstr "Fråga efter och hantera fast programvara för en mobil bredbandsenhet"
|
||||||
|
|
||||||
#: data/org.freedesktop.ModemManager1.policy.in.in:86
|
#: data/org.freedesktop.ModemManager1.policy.in.in:104
|
||||||
msgid "System policy prevents querying or managing this device's firmware."
|
msgid "System policy prevents querying or managing this device's firmware."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"En systempolicy förhindrar att fråga och hantera denna enhets fasta "
|
"En systempolicy förhindrar att fråga och hantera denna enhets fasta "
|
||||||
"programvara."
|
"programvara."
|
||||||
|
|
||||||
#: src/mm-sleep-monitor-systemd.c:125
|
#: src/mm-sleep-monitor-systemd.c:133
|
||||||
msgid "ModemManager needs to reset devices"
|
msgid "ModemManager needs to reset devices"
|
||||||
msgstr "ModemManager behöver starta om enheter"
|
msgstr "ModemManager behöver starta om enheter"
|
||||||
|
|||||||
+46
-15
@@ -59,14 +59,19 @@ quit_cb (gpointer user_data)
|
|||||||
#if defined WITH_SUSPEND_RESUME
|
#if defined WITH_SUSPEND_RESUME
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sleeping_cb (MMSleepMonitor *sleep_monitor)
|
sleeping_cb (MMSleepMonitor *sleep_monitor,
|
||||||
|
MMSleepContext *ctx)
|
||||||
{
|
{
|
||||||
if (mm_context_get_test_low_power_suspend_resume ()) {
|
if (mm_context_get_test_low_power_suspend_resume ()) {
|
||||||
mm_dbg ("removing devices and setting them in low power mode... (sleeping)");
|
mm_dbg ("removing devices and setting them in low power mode... (sleeping)");
|
||||||
mm_base_manager_shutdown (manager, TRUE, TRUE, TRUE);
|
mm_base_manager_cleanup (manager,
|
||||||
|
MM_BASE_MANAGER_CLEANUP_DISABLE |
|
||||||
|
MM_BASE_MANAGER_CLEANUP_LOW_POWER |
|
||||||
|
MM_BASE_MANAGER_CLEANUP_REMOVE,
|
||||||
|
ctx);
|
||||||
} else {
|
} else {
|
||||||
mm_dbg ("removing devices... (sleeping)");
|
mm_dbg ("removing devices... (sleeping)");
|
||||||
mm_base_manager_shutdown (manager, FALSE, FALSE, TRUE);
|
mm_base_manager_cleanup (manager, MM_BASE_MANAGER_CLEANUP_REMOVE, ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,11 +83,20 @@ resuming_cb (MMSleepMonitor *sleep_monitor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sleeping_quick_cb (MMSleepMonitor *sleep_monitor)
|
sleeping_quick_cb (MMSleepMonitor *sleep_monitor,
|
||||||
|
MMSleepContext *ctx)
|
||||||
{
|
{
|
||||||
if (mm_context_get_test_low_power_suspend_resume ()) {
|
if (mm_context_get_test_low_power_suspend_resume ()) {
|
||||||
mm_dbg ("setting modem in low power mode... (sleeping)");
|
mm_dbg ("setting modem in low power mode... (sleeping)");
|
||||||
mm_base_manager_shutdown (manager, TRUE, TRUE, FALSE);
|
mm_base_manager_cleanup (manager,
|
||||||
|
MM_BASE_MANAGER_CLEANUP_DISABLE |
|
||||||
|
MM_BASE_MANAGER_CLEANUP_LOW_POWER,
|
||||||
|
ctx);
|
||||||
|
} else {
|
||||||
|
mm_dbg ("setting modem in terse mode... (only send important signals (call/text))");
|
||||||
|
mm_base_manager_cleanup (manager,
|
||||||
|
MM_BASE_MANAGER_CLEANUP_TERSE,
|
||||||
|
ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,6 +182,18 @@ register_dbus_errors (void)
|
|||||||
g_dbus_error_register_error (G_IO_ERROR, G_IO_ERROR_CANCELLED, MM_CORE_ERROR_DBUS_PREFIX ".Cancelled");
|
g_dbus_error_register_error (G_IO_ERROR, G_IO_ERROR_CANCELLED, MM_CORE_ERROR_DBUS_PREFIX ".Cancelled");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
shutdown_done (MMSleepContext *sleep_ctx,
|
||||||
|
GError *error,
|
||||||
|
GMainLoop *quit_loop)
|
||||||
|
{
|
||||||
|
if (error)
|
||||||
|
mm_warn ("shutdown failed: %s", error->message);
|
||||||
|
else
|
||||||
|
mm_msg ("shutdown complete");
|
||||||
|
g_main_loop_quit (quit_loop);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -241,28 +267,33 @@ main (int argc, char *argv[])
|
|||||||
loop = NULL;
|
loop = NULL;
|
||||||
|
|
||||||
if (manager) {
|
if (manager) {
|
||||||
GTimer *timer;
|
MMSleepContext *ctx;
|
||||||
|
guint sleep_done_id;
|
||||||
|
|
||||||
mm_base_manager_shutdown (manager, TRUE, FALSE, TRUE);
|
ctx = mm_sleep_context_new (MAX_SHUTDOWN_TIME_SECS);
|
||||||
|
sleep_done_id = g_signal_connect (ctx,
|
||||||
|
MM_SLEEP_CONTEXT_DONE,
|
||||||
|
(GCallback)shutdown_done,
|
||||||
|
inner);
|
||||||
|
|
||||||
|
mm_base_manager_cleanup (manager,
|
||||||
|
MM_BASE_MANAGER_CLEANUP_DISABLE | MM_BASE_MANAGER_CLEANUP_REMOVE,
|
||||||
|
ctx);
|
||||||
|
|
||||||
/* Wait for all modems to be disabled and removed, but don't wait
|
/* Wait for all modems to be disabled and removed, but don't wait
|
||||||
* forever: if disabling the modems takes longer than 20s, just
|
* forever: if disabling the modems takes longer than 20s, just
|
||||||
* shutdown anyway. */
|
* shutdown anyway. */
|
||||||
timer = g_timer_new ();
|
while (mm_base_manager_num_modems (manager))
|
||||||
while (mm_base_manager_num_modems (manager) &&
|
g_main_loop_run (inner);
|
||||||
g_timer_elapsed (timer, NULL) < (gdouble)MAX_SHUTDOWN_TIME_SECS) {
|
|
||||||
GMainContext *ctx = g_main_loop_get_context (inner);
|
|
||||||
|
|
||||||
g_main_context_iteration (ctx, FALSE);
|
g_signal_handler_disconnect (ctx, sleep_done_id);
|
||||||
g_usleep (50);
|
g_object_unref (ctx);
|
||||||
}
|
|
||||||
|
|
||||||
if (mm_base_manager_num_modems (manager))
|
if (mm_base_manager_num_modems (manager))
|
||||||
mm_warn ("disabling modems took too long, shutting down with %u modems around",
|
mm_warn ("disabling modems took too long, shutting down with %u modems around",
|
||||||
mm_base_manager_num_modems (manager));
|
mm_base_manager_num_modems (manager));
|
||||||
|
|
||||||
g_object_unref (manager);
|
g_object_unref (manager);
|
||||||
g_timer_destroy (timer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_main_loop_unref (inner);
|
g_main_loop_unref (inner);
|
||||||
|
|||||||
+138
-15
@@ -46,6 +46,7 @@ sources = files(
|
|||||||
'mm-cbm-part.c',
|
'mm-cbm-part.c',
|
||||||
'mm-charsets.c',
|
'mm-charsets.c',
|
||||||
'mm-error-helpers.c',
|
'mm-error-helpers.c',
|
||||||
|
'mm-location-cache.c',
|
||||||
'mm-log.c',
|
'mm-log.c',
|
||||||
'mm-log-object.c',
|
'mm-log-object.c',
|
||||||
'mm-modem-helpers.c',
|
'mm-modem-helpers.c',
|
||||||
@@ -80,11 +81,16 @@ if enable_systemd_journal
|
|||||||
private_deps += libsystemd_dep
|
private_deps += libsystemd_dep
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
c_args = [
|
||||||
|
'-DPKGSTATEDIR="@0@"'.format(mm_pkgsharedstatedir),
|
||||||
|
]
|
||||||
|
|
||||||
libhelpers = static_library(
|
libhelpers = static_library(
|
||||||
'helpers',
|
'helpers',
|
||||||
sources: sources + enums_sources,
|
sources: sources + enums_sources,
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: deps + private_deps,
|
dependencies: deps + private_deps,
|
||||||
|
c_args: c_args,
|
||||||
)
|
)
|
||||||
|
|
||||||
libhelpers_dep = declare_dependency(
|
libhelpers_dep = declare_dependency(
|
||||||
@@ -134,6 +140,8 @@ headers = files(
|
|||||||
'mm-iface-port-at.h',
|
'mm-iface-port-at.h',
|
||||||
'mm-port.h',
|
'mm-port.h',
|
||||||
'mm-port-serial-at.h',
|
'mm-port-serial-at.h',
|
||||||
|
'mm-port-scheduler.h',
|
||||||
|
'mm-port-scheduler-rr.h',
|
||||||
)
|
)
|
||||||
|
|
||||||
sources = files(
|
sources = files(
|
||||||
@@ -146,6 +154,8 @@ sources = files(
|
|||||||
'mm-port-serial-gps.c',
|
'mm-port-serial-gps.c',
|
||||||
'mm-port-serial-qcdm.c',
|
'mm-port-serial-qcdm.c',
|
||||||
'mm-serial-parsers.c',
|
'mm-serial-parsers.c',
|
||||||
|
'mm-port-scheduler.c',
|
||||||
|
'mm-port-scheduler-rr.c',
|
||||||
)
|
)
|
||||||
|
|
||||||
deps = [libkerneldevice_dep]
|
deps = [libkerneldevice_dep]
|
||||||
@@ -206,10 +216,71 @@ libport_dep = declare_dependency(
|
|||||||
link_with: libport,
|
link_with: libport,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# auth provider library
|
||||||
|
sources = files(
|
||||||
|
'mm-auth-provider.c',
|
||||||
|
'mm-context.c',
|
||||||
|
'mm-bind.c',
|
||||||
|
)
|
||||||
|
|
||||||
|
incs = [
|
||||||
|
top_inc,
|
||||||
|
kerneldevice_inc,
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [libmm_glib_dep, libhelpers_dep]
|
||||||
|
|
||||||
|
if enable_polkit
|
||||||
|
deps += polkit_gobject_dep
|
||||||
|
endif
|
||||||
|
|
||||||
|
private_deps = []
|
||||||
|
|
||||||
|
libauth = static_library(
|
||||||
|
'auth',
|
||||||
|
sources: sources,
|
||||||
|
include_directories: incs,
|
||||||
|
dependencies: deps,
|
||||||
|
c_args: '-DPLUGINDIR="@0@"'.format(mm_prefix / mm_pkglibdir),
|
||||||
|
)
|
||||||
|
|
||||||
|
libauth_dep = declare_dependency(
|
||||||
|
include_directories: ['.', kerneldevice_inc],
|
||||||
|
dependencies: deps,
|
||||||
|
link_with: libauth,
|
||||||
|
)
|
||||||
|
|
||||||
|
# SMS library
|
||||||
|
sources = files(
|
||||||
|
'mm-sms-list.c',
|
||||||
|
'mm-base-sms.c',
|
||||||
|
)
|
||||||
|
|
||||||
|
incs = [
|
||||||
|
top_inc,
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [libmm_glib_dep, libhelpers_dep, libauth_dep]
|
||||||
|
|
||||||
|
private_deps = []
|
||||||
|
|
||||||
|
libsms = static_library(
|
||||||
|
'sms',
|
||||||
|
sources: sources,
|
||||||
|
include_directories: incs,
|
||||||
|
dependencies: deps,
|
||||||
|
)
|
||||||
|
|
||||||
|
libsms_dep = declare_dependency(
|
||||||
|
include_directories: ['.'],
|
||||||
|
dependencies: deps,
|
||||||
|
link_with: libsms,
|
||||||
|
)
|
||||||
|
|
||||||
# Daemon enums, required by plugins
|
# Daemon enums, required by plugins
|
||||||
headers = files(
|
headers = files(
|
||||||
'mm-base-bearer.h',
|
'mm-base-bearer.h',
|
||||||
'mm-base-modem.h',
|
'mm-iface-op-lock.h',
|
||||||
'mm-filter.h',
|
'mm-filter.h',
|
||||||
'mm-port-probe.h',
|
'mm-port-probe.h',
|
||||||
)
|
)
|
||||||
@@ -250,33 +321,25 @@ daemon_enums_types_dep = declare_dependency(
|
|||||||
include_directories: '.',
|
include_directories: '.',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Additional vendor plugins
|
base_sources = files(
|
||||||
subdir('plugins')
|
|
||||||
|
|
||||||
# ModemManager daemon
|
|
||||||
sources = files(
|
|
||||||
'main.c',
|
|
||||||
'mm-auth-provider.c',
|
|
||||||
'mm-base-bearer.c',
|
'mm-base-bearer.c',
|
||||||
'mm-base-call.c',
|
'mm-base-call.c',
|
||||||
|
'mm-call-at.c',
|
||||||
'mm-base-cbm.c',
|
'mm-base-cbm.c',
|
||||||
'mm-base-manager.c',
|
|
||||||
'mm-base-modem-at.c',
|
'mm-base-modem-at.c',
|
||||||
'mm-base-modem.c',
|
'mm-base-modem.c',
|
||||||
'mm-base-sim.c',
|
'mm-base-sim.c',
|
||||||
'mm-base-sms.c',
|
'mm-sms-at.c',
|
||||||
'mm-bearer-list.c',
|
'mm-bearer-list.c',
|
||||||
'mm-broadband-bearer.c',
|
'mm-broadband-bearer.c',
|
||||||
'mm-broadband-modem.c',
|
'mm-broadband-modem.c',
|
||||||
'mm-call-list.c',
|
'mm-call-list.c',
|
||||||
'mm-cbm-list.c',
|
'mm-cbm-list.c',
|
||||||
'mm-context.c',
|
|
||||||
'mm-device.c',
|
'mm-device.c',
|
||||||
'mm-dispatcher.c',
|
'mm-dispatcher.c',
|
||||||
'mm-dispatcher-connection.c',
|
'mm-dispatcher-connection.c',
|
||||||
'mm-dispatcher-fcc-unlock.c',
|
'mm-dispatcher-fcc-unlock.c',
|
||||||
'mm-dispatcher-modem-setup.c',
|
'mm-dispatcher-modem-setup.c',
|
||||||
'mm-filter.c',
|
|
||||||
'mm-iface-modem-3gpp.c',
|
'mm-iface-modem-3gpp.c',
|
||||||
'mm-iface-modem-3gpp-profile-manager.c',
|
'mm-iface-modem-3gpp-profile-manager.c',
|
||||||
'mm-iface-modem-3gpp-ussd.c',
|
'mm-iface-modem-3gpp-ussd.c',
|
||||||
@@ -292,21 +355,77 @@ sources = files(
|
|||||||
'mm-iface-modem-simple.c',
|
'mm-iface-modem-simple.c',
|
||||||
'mm-iface-modem-time.c',
|
'mm-iface-modem-time.c',
|
||||||
'mm-iface-modem-voice.c',
|
'mm-iface-modem-voice.c',
|
||||||
|
'mm-iface-op-lock.c',
|
||||||
'mm-log-helpers.c',
|
'mm-log-helpers.c',
|
||||||
|
'mm-private-boxed-types.c',
|
||||||
|
'mm-sleep-context.c',
|
||||||
|
)
|
||||||
|
|
||||||
|
# MM base library (used by MM and tests)
|
||||||
|
incs = [
|
||||||
|
top_inc,
|
||||||
|
kerneldevice_inc,
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
libmm_glib_dep,
|
||||||
|
libhelpers_dep,
|
||||||
|
libauth_dep,
|
||||||
|
libport_dep,
|
||||||
|
libqcdm_dep,
|
||||||
|
daemon_enums_types_dep,
|
||||||
|
]
|
||||||
|
|
||||||
|
private_deps = []
|
||||||
|
|
||||||
|
c_args = [
|
||||||
|
'-DMM_COMPILATION',
|
||||||
|
'-DPLUGINDIR="@0@"'.format(mm_prefix / mm_pkglibdir),
|
||||||
|
'-DMODEMSETUPDIRPACKAGE="@0@"'.format(mm_prefix / mm_pkglibdir / 'modem-setup.d'),
|
||||||
|
'-DMODEMSETUPDIRUSER="@0@"'.format(mm_prefix / mm_pkgsysconfdir / 'modem-setup.d'),
|
||||||
|
'-DFCCUNLOCKDIRPACKAGE="@0@"'.format(mm_prefix / mm_pkglibdir / 'fcc-unlock.d'),
|
||||||
|
'-DFCCUNLOCKDIRUSER="@0@"'.format(mm_prefix / mm_pkgsysconfdir / 'fcc-unlock.d'),
|
||||||
|
'-DCONNECTIONDIRPACKAGE="@0@"'.format(mm_prefix / mm_pkglibdir / 'connection.d'),
|
||||||
|
'-DCONNECTIONDIRUSER="@0@"'.format(mm_prefix / mm_pkgsysconfdir / 'connection.d'),
|
||||||
|
]
|
||||||
|
|
||||||
|
libmmbase = static_library(
|
||||||
|
'mmbase',
|
||||||
|
sources: base_sources + daemon_enums_sources,
|
||||||
|
include_directories: incs,
|
||||||
|
dependencies: deps,
|
||||||
|
c_args: c_args,
|
||||||
|
)
|
||||||
|
|
||||||
|
libmmbase_dep = declare_dependency(
|
||||||
|
include_directories: ['.', kerneldevice_inc],
|
||||||
|
dependencies: deps,
|
||||||
|
link_with: libmmbase,
|
||||||
|
)
|
||||||
|
|
||||||
|
# Additional vendor plugins
|
||||||
|
subdir('plugins')
|
||||||
|
|
||||||
|
# ModemManager daemon
|
||||||
|
sources = files(
|
||||||
|
'main.c',
|
||||||
|
'mm-base-manager.c',
|
||||||
|
'mm-filter.c',
|
||||||
'mm-plugin.c',
|
'mm-plugin.c',
|
||||||
'mm-plugin-manager.c',
|
'mm-plugin-manager.c',
|
||||||
'mm-port-probe.c',
|
'mm-port-probe.c',
|
||||||
'mm-port-probe-at.c',
|
'mm-port-probe-at.c',
|
||||||
'mm-private-boxed-types.c',
|
|
||||||
'mm-sms-list.c',
|
|
||||||
)
|
)
|
||||||
|
|
||||||
sources += daemon_enums_sources
|
sources += daemon_enums_sources
|
||||||
|
sources += base_sources
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
gmodule_dep,
|
gmodule_dep,
|
||||||
libport_dep,
|
libport_dep,
|
||||||
libqcdm_dep,
|
libqcdm_dep,
|
||||||
|
libsms_dep,
|
||||||
|
libauth_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
if enable_tests
|
if enable_tests
|
||||||
@@ -315,7 +434,6 @@ endif
|
|||||||
|
|
||||||
c_args = [
|
c_args = [
|
||||||
'-DMM_COMPILATION',
|
'-DMM_COMPILATION',
|
||||||
'-DPLUGINDIR="@0@"'.format(mm_prefix / mm_pkglibdir),
|
|
||||||
'-DMODEMSETUPDIRPACKAGE="@0@"'.format(mm_prefix / mm_pkglibdir / 'modem-setup.d'),
|
'-DMODEMSETUPDIRPACKAGE="@0@"'.format(mm_prefix / mm_pkglibdir / 'modem-setup.d'),
|
||||||
'-DMODEMSETUPDIRUSER="@0@"'.format(mm_prefix / mm_pkgsysconfdir / 'modem-setup.d'),
|
'-DMODEMSETUPDIRUSER="@0@"'.format(mm_prefix / mm_pkgsysconfdir / 'modem-setup.d'),
|
||||||
'-DFCCUNLOCKDIRPACKAGE="@0@"'.format(mm_prefix / mm_pkglibdir / 'fcc-unlock.d'),
|
'-DFCCUNLOCKDIRPACKAGE="@0@"'.format(mm_prefix / mm_pkglibdir / 'fcc-unlock.d'),
|
||||||
@@ -394,6 +512,11 @@ install_data(
|
|||||||
install_dir: udev_rulesdir,
|
install_dir: udev_rulesdir,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# empty directory for cached position
|
||||||
|
install_emptydir(
|
||||||
|
mm_pkgsharedstatedir,
|
||||||
|
)
|
||||||
|
|
||||||
if enable_tests
|
if enable_tests
|
||||||
subdir('tests')
|
subdir('tests')
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "mm-log-object.h"
|
#include "mm-log-object.h"
|
||||||
#include "mm-utils.h"
|
#include "mm-utils.h"
|
||||||
#include "mm-auth-provider.h"
|
#include "mm-auth-provider.h"
|
||||||
|
#include "mm-context.h"
|
||||||
|
|
||||||
#if defined WITH_POLKIT
|
#if defined WITH_POLKIT
|
||||||
# include <polkit/polkit.h>
|
# include <polkit/polkit.h>
|
||||||
@@ -128,6 +129,13 @@ mm_auth_provider_authorize (MMAuthProvider *self,
|
|||||||
|
|
||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
|
|
||||||
|
/* When running in the session bus for tests, default to always allow */
|
||||||
|
if (mm_context_get_test_session ()) {
|
||||||
|
g_task_return_boolean (task, TRUE);
|
||||||
|
g_object_unref (task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined WITH_POLKIT
|
#if defined WITH_POLKIT
|
||||||
{
|
{
|
||||||
AuthorizeContext *ctx;
|
AuthorizeContext *ctx;
|
||||||
@@ -218,3 +226,40 @@ mm_auth_provider_class_init (MMAuthProviderClass *class)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MM_DEFINE_SINGLETON_GETTER (MMAuthProvider, mm_auth_provider_get, MM_TYPE_AUTH_PROVIDER)
|
MM_DEFINE_SINGLETON_GETTER (MMAuthProvider, mm_auth_provider_get, MM_TYPE_AUTH_PROVIDER)
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Auth interface */
|
||||||
|
|
||||||
|
G_DEFINE_INTERFACE (MMIfaceAuth, mm_iface_auth, G_TYPE_OBJECT)
|
||||||
|
|
||||||
|
void
|
||||||
|
mm_iface_auth_authorize (MMIfaceAuth *self,
|
||||||
|
GDBusMethodInvocation *invocation,
|
||||||
|
const gchar *authorization,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
g_assert (MM_IFACE_AUTH_GET_IFACE (self)->authorize != NULL);
|
||||||
|
|
||||||
|
MM_IFACE_AUTH_GET_IFACE (self)->authorize (self,
|
||||||
|
invocation,
|
||||||
|
authorization,
|
||||||
|
callback,
|
||||||
|
user_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
mm_iface_auth_authorize_finish (MMIfaceAuth *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
g_assert (MM_IFACE_AUTH_GET_IFACE (self)->authorize_finish != NULL);
|
||||||
|
|
||||||
|
return MM_IFACE_AUTH_GET_IFACE (self)->authorize_finish (self, res, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
mm_iface_auth_default_init (MMIfaceAuthInterface *iface)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,4 +56,39 @@ gboolean mm_auth_provider_authorize_finish (MMAuthProvider *self,
|
|||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Auth interface
|
||||||
|
*
|
||||||
|
* Implemented by objects (mainly MMBaseModem) that provide authorization
|
||||||
|
* capability to other interfaces (MMIfaceModem) since GLib interfaces don't
|
||||||
|
* have private data to store the singletone.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define MM_TYPE_IFACE_AUTH mm_iface_auth_get_type ()
|
||||||
|
G_DECLARE_INTERFACE (MMIfaceAuth, mm_iface_auth, MM, IFACE_AUTH, GObject)
|
||||||
|
|
||||||
|
struct _MMIfaceAuthInterface {
|
||||||
|
GTypeInterface g_iface;
|
||||||
|
|
||||||
|
void (* authorize) (MMIfaceAuth *self,
|
||||||
|
GDBusMethodInvocation *invocation,
|
||||||
|
const gchar *authorization,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
|
||||||
|
gboolean (* authorize_finish) (MMIfaceAuth *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
};
|
||||||
|
|
||||||
|
void mm_iface_auth_authorize (MMIfaceAuth *self,
|
||||||
|
GDBusMethodInvocation *invocation,
|
||||||
|
const gchar *authorization,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
|
||||||
|
gboolean mm_iface_auth_authorize_finish (MMIfaceAuth *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
#endif /* MM_AUTH_PROVIDER_H */
|
#endif /* MM_AUTH_PROVIDER_H */
|
||||||
|
|||||||
+61
-39
@@ -34,13 +34,14 @@
|
|||||||
#include "mm-iface-modem-3gpp-profile-manager.h"
|
#include "mm-iface-modem-3gpp-profile-manager.h"
|
||||||
#include "mm-iface-modem-cdma.h"
|
#include "mm-iface-modem-cdma.h"
|
||||||
#include "mm-base-bearer.h"
|
#include "mm-base-bearer.h"
|
||||||
#include "mm-base-modem-at.h"
|
|
||||||
#include "mm-base-modem.h"
|
#include "mm-base-modem.h"
|
||||||
#include "mm-log-object.h"
|
#include "mm-log-object.h"
|
||||||
#include "mm-modem-helpers.h"
|
#include "mm-modem-helpers.h"
|
||||||
#include "mm-error-helpers.h"
|
#include "mm-error-helpers.h"
|
||||||
#include "mm-bearer-stats.h"
|
#include "mm-bearer-stats.h"
|
||||||
#include "mm-dispatcher-connection.h"
|
#include "mm-dispatcher-connection.h"
|
||||||
|
#include "mm-auth-provider.h"
|
||||||
|
#include "mm-bind.h"
|
||||||
|
|
||||||
/* We require up to 20s to get a proper IP when using PPP */
|
/* We require up to 20s to get a proper IP when using PPP */
|
||||||
#define BEARER_IP_TIMEOUT_DEFAULT 20
|
#define BEARER_IP_TIMEOUT_DEFAULT 20
|
||||||
@@ -54,9 +55,11 @@
|
|||||||
#define BEARER_CONNECTION_MONITOR_TIMEOUT 5
|
#define BEARER_CONNECTION_MONITOR_TIMEOUT 5
|
||||||
|
|
||||||
static void log_object_iface_init (MMLogObjectInterface *iface);
|
static void log_object_iface_init (MMLogObjectInterface *iface);
|
||||||
|
static void bind_iface_init (MMBindInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_EXTENDED (MMBaseBearer, mm_base_bearer, MM_GDBUS_TYPE_BEARER_SKELETON, 0,
|
G_DEFINE_TYPE_EXTENDED (MMBaseBearer, mm_base_bearer, MM_GDBUS_TYPE_BEARER_SKELETON, 0,
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init))
|
G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init)
|
||||||
|
G_IMPLEMENT_INTERFACE (MM_TYPE_BIND, bind_iface_init))
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CONNECTION_FORBIDDEN_REASON_NONE,
|
CONNECTION_FORBIDDEN_REASON_NONE,
|
||||||
@@ -70,6 +73,7 @@ enum {
|
|||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_PATH,
|
PROP_PATH,
|
||||||
PROP_CONNECTION,
|
PROP_CONNECTION,
|
||||||
|
PROP_BIND_TO,
|
||||||
PROP_MODEM,
|
PROP_MODEM,
|
||||||
PROP_STATUS,
|
PROP_STATUS,
|
||||||
PROP_CONFIG,
|
PROP_CONFIG,
|
||||||
@@ -83,6 +87,13 @@ struct _MMBaseBearerPrivate {
|
|||||||
GDBusConnection *connection;
|
GDBusConnection *connection;
|
||||||
guint dbus_id;
|
guint dbus_id;
|
||||||
|
|
||||||
|
/* The authorization provider */
|
||||||
|
MMAuthProvider *authp;
|
||||||
|
GCancellable *authp_cancellable;
|
||||||
|
|
||||||
|
/* The object this bearer is bound to */
|
||||||
|
GObject *bind_to;
|
||||||
|
|
||||||
/* The modem which owns this BEARER */
|
/* The modem which owns this BEARER */
|
||||||
MMBaseModem *modem;
|
MMBaseModem *modem;
|
||||||
/* The path where the BEARER object is exported */
|
/* The path where the BEARER object is exported */
|
||||||
@@ -461,7 +472,7 @@ dispatcher_connection_run_ready (MMDispatcherConnection *dispatcher,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
bearer_run_dispatcher_scripts (MMBaseBearer *self,
|
bearer_run_dispatcher_scripts (MMBaseBearer *self,
|
||||||
gboolean connected)
|
MMDispatcherConnectionEvent event)
|
||||||
{
|
{
|
||||||
MMDispatcherConnection *dispatcher;
|
MMDispatcherConnection *dispatcher;
|
||||||
const gchar *interface;
|
const gchar *interface;
|
||||||
@@ -475,7 +486,7 @@ bearer_run_dispatcher_scripts (MMBaseBearer *self,
|
|||||||
g_dbus_object_get_object_path (G_DBUS_OBJECT (self->priv->modem)),
|
g_dbus_object_get_object_path (G_DBUS_OBJECT (self->priv->modem)),
|
||||||
self->priv->path,
|
self->priv->path,
|
||||||
interface,
|
interface,
|
||||||
connected,
|
event,
|
||||||
NULL, /* cancellable */
|
NULL, /* cancellable */
|
||||||
(GAsyncReadyCallback)dispatcher_connection_run_ready,
|
(GAsyncReadyCallback)dispatcher_connection_run_ready,
|
||||||
g_object_ref (self));
|
g_object_ref (self));
|
||||||
@@ -489,6 +500,7 @@ bearer_reset_interface_status (MMBaseBearer *self)
|
|||||||
mm_gdbus_bearer_set_profile_id (MM_GDBUS_BEARER (self), MM_3GPP_PROFILE_ID_UNKNOWN);
|
mm_gdbus_bearer_set_profile_id (MM_GDBUS_BEARER (self), MM_3GPP_PROFILE_ID_UNKNOWN);
|
||||||
mm_gdbus_bearer_set_multiplexed (MM_GDBUS_BEARER (self), FALSE);
|
mm_gdbus_bearer_set_multiplexed (MM_GDBUS_BEARER (self), FALSE);
|
||||||
mm_gdbus_bearer_set_connected (MM_GDBUS_BEARER (self), FALSE);
|
mm_gdbus_bearer_set_connected (MM_GDBUS_BEARER (self), FALSE);
|
||||||
|
mm_gdbus_bearer_set_disconnect_request (MM_GDBUS_BEARER (self), FALSE);
|
||||||
mm_gdbus_bearer_set_suspended (MM_GDBUS_BEARER (self), FALSE);
|
mm_gdbus_bearer_set_suspended (MM_GDBUS_BEARER (self), FALSE);
|
||||||
mm_gdbus_bearer_set_interface (MM_GDBUS_BEARER (self), NULL);
|
mm_gdbus_bearer_set_interface (MM_GDBUS_BEARER (self), NULL);
|
||||||
mm_gdbus_bearer_set_ip4_config (
|
mm_gdbus_bearer_set_ip4_config (
|
||||||
@@ -520,7 +532,7 @@ bearer_update_status (MMBaseBearer *self,
|
|||||||
g_autoptr(GString) report = NULL;
|
g_autoptr(GString) report = NULL;
|
||||||
|
|
||||||
/* Report disconnection via dispatcher scripts, before resetting the interface */
|
/* Report disconnection via dispatcher scripts, before resetting the interface */
|
||||||
bearer_run_dispatcher_scripts (self, FALSE);
|
bearer_run_dispatcher_scripts (self, MM_DISPATCHER_CONNECTION_EVENT_DISCONNECTED);
|
||||||
|
|
||||||
bearer_reset_interface_status (self);
|
bearer_reset_interface_status (self);
|
||||||
/* Cleanup flag to ignore disconnection reports */
|
/* Cleanup flag to ignore disconnection reports */
|
||||||
@@ -588,7 +600,7 @@ bearer_update_status_connected (MMBaseBearer *self,
|
|||||||
connection_monitor_start (self);
|
connection_monitor_start (self);
|
||||||
|
|
||||||
/* Run dispatcher scripts */
|
/* Run dispatcher scripts */
|
||||||
bearer_run_dispatcher_scripts (self, TRUE);
|
bearer_run_dispatcher_scripts (self, MM_DISPATCHER_CONNECTION_EVENT_CONNECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -1118,7 +1130,6 @@ mm_base_bearer_connect (MMBaseBearer *self,
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
MMBaseBearer *self;
|
MMBaseBearer *self;
|
||||||
MMBaseModem *modem;
|
|
||||||
GDBusMethodInvocation *invocation;
|
GDBusMethodInvocation *invocation;
|
||||||
} HandleConnectContext;
|
} HandleConnectContext;
|
||||||
|
|
||||||
@@ -1126,7 +1137,6 @@ static void
|
|||||||
handle_connect_context_free (HandleConnectContext *ctx)
|
handle_connect_context_free (HandleConnectContext *ctx)
|
||||||
{
|
{
|
||||||
g_object_unref (ctx->invocation);
|
g_object_unref (ctx->invocation);
|
||||||
g_object_unref (ctx->modem);
|
|
||||||
g_object_unref (ctx->self);
|
g_object_unref (ctx->self);
|
||||||
g_free (ctx);
|
g_free (ctx);
|
||||||
}
|
}
|
||||||
@@ -1147,13 +1157,13 @@ handle_connect_ready (MMBaseBearer *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_connect_auth_ready (MMBaseModem *modem,
|
handle_connect_auth_ready (MMAuthProvider *authp,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleConnectContext *ctx)
|
HandleConnectContext *ctx)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (!mm_base_modem_authorize_finish (modem, res, &error)) {
|
if (!mm_auth_provider_authorize_finish (authp, res, &error)) {
|
||||||
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||||
handle_connect_context_free (ctx);
|
handle_connect_context_free (ctx);
|
||||||
return;
|
return;
|
||||||
@@ -1174,15 +1184,13 @@ handle_connect (MMBaseBearer *self,
|
|||||||
ctx = g_new0 (HandleConnectContext, 1);
|
ctx = g_new0 (HandleConnectContext, 1);
|
||||||
ctx->self = g_object_ref (self);
|
ctx->self = g_object_ref (self);
|
||||||
ctx->invocation = g_object_ref (invocation);
|
ctx->invocation = g_object_ref (invocation);
|
||||||
g_object_get (self,
|
|
||||||
MM_BASE_BEARER_MODEM, &ctx->modem,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
mm_base_modem_authorize (ctx->modem,
|
mm_auth_provider_authorize (self->priv->authp,
|
||||||
invocation,
|
invocation,
|
||||||
MM_AUTHORIZATION_DEVICE_CONTROL,
|
MM_AUTHORIZATION_DEVICE_CONTROL,
|
||||||
(GAsyncReadyCallback)handle_connect_auth_ready,
|
self->priv->authp_cancellable,
|
||||||
ctx);
|
(GAsyncReadyCallback)handle_connect_auth_ready,
|
||||||
|
ctx);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1307,7 +1315,6 @@ mm_base_bearer_disconnect (MMBaseBearer *self,
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
MMBaseBearer *self;
|
MMBaseBearer *self;
|
||||||
MMBaseModem *modem;
|
|
||||||
GDBusMethodInvocation *invocation;
|
GDBusMethodInvocation *invocation;
|
||||||
} HandleDisconnectContext;
|
} HandleDisconnectContext;
|
||||||
|
|
||||||
@@ -1315,7 +1322,6 @@ static void
|
|||||||
handle_disconnect_context_free (HandleDisconnectContext *ctx)
|
handle_disconnect_context_free (HandleDisconnectContext *ctx)
|
||||||
{
|
{
|
||||||
g_object_unref (ctx->invocation);
|
g_object_unref (ctx->invocation);
|
||||||
g_object_unref (ctx->modem);
|
|
||||||
g_object_unref (ctx->self);
|
g_object_unref (ctx->self);
|
||||||
g_free (ctx);
|
g_free (ctx);
|
||||||
}
|
}
|
||||||
@@ -1336,13 +1342,13 @@ handle_disconnect_ready (MMBaseBearer *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_disconnect_auth_ready (MMBaseModem *modem,
|
handle_disconnect_auth_ready (MMAuthProvider *authp,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleDisconnectContext *ctx)
|
HandleDisconnectContext *ctx)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (!mm_base_modem_authorize_finish (modem, res, &error)) {
|
if (!mm_auth_provider_authorize_finish (authp, res, &error)) {
|
||||||
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||||
handle_disconnect_context_free (ctx);
|
handle_disconnect_context_free (ctx);
|
||||||
return;
|
return;
|
||||||
@@ -1363,15 +1369,13 @@ handle_disconnect (MMBaseBearer *self,
|
|||||||
ctx = g_new0 (HandleDisconnectContext, 1);
|
ctx = g_new0 (HandleDisconnectContext, 1);
|
||||||
ctx->self = g_object_ref (self);
|
ctx->self = g_object_ref (self);
|
||||||
ctx->invocation = g_object_ref (invocation);
|
ctx->invocation = g_object_ref (invocation);
|
||||||
g_object_get (self,
|
|
||||||
MM_BASE_BEARER_MODEM, &ctx->modem,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
mm_base_modem_authorize (ctx->modem,
|
mm_auth_provider_authorize (self->priv->authp,
|
||||||
invocation,
|
invocation,
|
||||||
MM_AUTHORIZATION_DEVICE_CONTROL,
|
MM_AUTHORIZATION_DEVICE_CONTROL,
|
||||||
(GAsyncReadyCallback)handle_disconnect_auth_ready,
|
self->priv->authp_cancellable,
|
||||||
ctx);
|
(GAsyncReadyCallback)handle_disconnect_auth_ready,
|
||||||
|
ctx);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1488,11 +1492,14 @@ mm_base_bearer_disconnect_force (MMBaseBearer *self)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (self->priv->ignore_disconnection_reports) {
|
if (self->priv->ignore_disconnection_reports) {
|
||||||
mm_obj_dbg (self, "disconnection should be forced but it's explicitly ignored");
|
mm_obj_msg (self, "disconnection should be forced, but we can't. Request disconnection instead.");
|
||||||
|
mm_gdbus_bearer_set_disconnect_request (MM_GDBUS_BEARER(self), TRUE);
|
||||||
|
bearer_run_dispatcher_scripts (self,
|
||||||
|
MM_DISPATCHER_CONNECTION_EVENT_DISCONNECT_REQUEST);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mm_obj_dbg (self, "forcing disconnection");
|
mm_obj_msg (self, "forcing disconnection");
|
||||||
|
|
||||||
/* If currently connecting, try to cancel that operation. */
|
/* If currently connecting, try to cancel that operation. */
|
||||||
if (self->priv->status == MM_BEARER_STATUS_CONNECTING) {
|
if (self->priv->status == MM_BEARER_STATUS_CONNECTING) {
|
||||||
@@ -1747,17 +1754,15 @@ set_property (GObject *object,
|
|||||||
else if (self->priv->path)
|
else if (self->priv->path)
|
||||||
base_bearer_dbus_export (self);
|
base_bearer_dbus_export (self);
|
||||||
break;
|
break;
|
||||||
|
case PROP_BIND_TO:
|
||||||
|
g_clear_object (&self->priv->bind_to);
|
||||||
|
self->priv->bind_to = g_value_dup_object (value);
|
||||||
|
mm_bind_to (MM_BIND (self), MM_BASE_BEARER_CONNECTION, self->priv->bind_to);
|
||||||
|
break;
|
||||||
case PROP_MODEM:
|
case PROP_MODEM:
|
||||||
g_clear_object (&self->priv->modem);
|
g_clear_object (&self->priv->modem);
|
||||||
self->priv->modem = g_value_dup_object (value);
|
self->priv->modem = g_value_dup_object (value);
|
||||||
if (self->priv->modem) {
|
if (self->priv->modem) {
|
||||||
/* Set owner ID */
|
|
||||||
mm_log_object_set_owner_id (MM_LOG_OBJECT (self), mm_log_object_get_id (MM_LOG_OBJECT (self->priv->modem)));
|
|
||||||
/* Bind the modem's connection (which is set when it is exported,
|
|
||||||
* and unset when unexported) to the BEARER's connection */
|
|
||||||
g_object_bind_property (self->priv->modem, MM_BASE_MODEM_CONNECTION,
|
|
||||||
self, MM_BASE_BEARER_CONNECTION,
|
|
||||||
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
|
||||||
if (self->priv->config) {
|
if (self->priv->config) {
|
||||||
/* Listen to 3GPP/CDMA registration state changes. We need both
|
/* Listen to 3GPP/CDMA registration state changes. We need both
|
||||||
* 'config' and 'modem' set. */
|
* 'config' and 'modem' set. */
|
||||||
@@ -1807,6 +1812,9 @@ get_property (GObject *object,
|
|||||||
case PROP_CONNECTION:
|
case PROP_CONNECTION:
|
||||||
g_value_set_object (value, self->priv->connection);
|
g_value_set_object (value, self->priv->connection);
|
||||||
break;
|
break;
|
||||||
|
case PROP_BIND_TO:
|
||||||
|
g_value_set_object (value, self->priv->bind_to);
|
||||||
|
break;
|
||||||
case PROP_MODEM:
|
case PROP_MODEM:
|
||||||
g_value_set_object (value, self->priv->modem);
|
g_value_set_object (value, self->priv->modem);
|
||||||
break;
|
break;
|
||||||
@@ -1835,6 +1843,10 @@ mm_base_bearer_init (MMBaseBearer *self)
|
|||||||
/* Each bearer is given a unique id to build its own DBus path */
|
/* Each bearer is given a unique id to build its own DBus path */
|
||||||
self->priv->dbus_id = id++;
|
self->priv->dbus_id = id++;
|
||||||
|
|
||||||
|
/* Setup authorization provider */
|
||||||
|
self->priv->authp = mm_auth_provider_get ();
|
||||||
|
self->priv->authp_cancellable = g_cancellable_new ();
|
||||||
|
|
||||||
self->priv->status = MM_BEARER_STATUS_DISCONNECTED;
|
self->priv->status = MM_BEARER_STATUS_DISCONNECTED;
|
||||||
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_NONE;
|
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_NONE;
|
||||||
self->priv->reason_cdma = CONNECTION_FORBIDDEN_REASON_NONE;
|
self->priv->reason_cdma = CONNECTION_FORBIDDEN_REASON_NONE;
|
||||||
@@ -1885,7 +1897,10 @@ dispose (GObject *object)
|
|||||||
reset_deferred_unregistration (self);
|
reset_deferred_unregistration (self);
|
||||||
|
|
||||||
g_clear_object (&self->priv->modem);
|
g_clear_object (&self->priv->modem);
|
||||||
|
g_clear_object (&self->priv->bind_to);
|
||||||
g_clear_object (&self->priv->config);
|
g_clear_object (&self->priv->config);
|
||||||
|
g_cancellable_cancel (self->priv->authp_cancellable);
|
||||||
|
g_clear_object (&self->priv->authp_cancellable);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_base_bearer_parent_class)->dispose (object);
|
G_OBJECT_CLASS (mm_base_bearer_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
@@ -1896,6 +1911,11 @@ log_object_iface_init (MMLogObjectInterface *iface)
|
|||||||
iface->build_id = log_object_build_id;
|
iface->build_id = log_object_build_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
bind_iface_init (MMBindInterface *iface)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mm_base_bearer_class_init (MMBaseBearerClass *klass)
|
mm_base_bearer_class_init (MMBaseBearerClass *klass)
|
||||||
{
|
{
|
||||||
@@ -1927,6 +1947,8 @@ mm_base_bearer_class_init (MMBaseBearerClass *klass)
|
|||||||
G_PARAM_READWRITE);
|
G_PARAM_READWRITE);
|
||||||
g_object_class_install_property (object_class, PROP_PATH, properties[PROP_PATH]);
|
g_object_class_install_property (object_class, PROP_PATH, properties[PROP_PATH]);
|
||||||
|
|
||||||
|
g_object_class_override_property (object_class, PROP_BIND_TO, MM_BIND_TO);
|
||||||
|
|
||||||
properties[PROP_MODEM] =
|
properties[PROP_MODEM] =
|
||||||
g_param_spec_object (MM_BASE_BEARER_MODEM,
|
g_param_spec_object (MM_BASE_BEARER_MODEM,
|
||||||
"Modem",
|
"Modem",
|
||||||
|
|||||||
+450
-460
File diff suppressed because it is too large
Load Diff
+28
-18
@@ -23,8 +23,8 @@
|
|||||||
#define _LIBMM_INSIDE_MM
|
#define _LIBMM_INSIDE_MM
|
||||||
#include <libmm-glib.h>
|
#include <libmm-glib.h>
|
||||||
|
|
||||||
#include "mm-base-modem.h"
|
|
||||||
#include "mm-call-audio-format.h"
|
#include "mm-call-audio-format.h"
|
||||||
|
#include "mm-port.h"
|
||||||
|
|
||||||
#define MM_TYPE_BASE_CALL (mm_base_call_get_type ())
|
#define MM_TYPE_BASE_CALL (mm_base_call_get_type ())
|
||||||
#define MM_BASE_CALL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BASE_CALL, MMBaseCall))
|
#define MM_BASE_CALL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BASE_CALL, MMBaseCall))
|
||||||
@@ -37,9 +37,13 @@ typedef struct _MMBaseCall MMBaseCall;
|
|||||||
typedef struct _MMBaseCallClass MMBaseCallClass;
|
typedef struct _MMBaseCallClass MMBaseCallClass;
|
||||||
typedef struct _MMBaseCallPrivate MMBaseCallPrivate;
|
typedef struct _MMBaseCallPrivate MMBaseCallPrivate;
|
||||||
|
|
||||||
|
#define MM_CALL_DIRECTION "direction"
|
||||||
|
#define MM_CALL_NUMBER "number"
|
||||||
|
#define MM_CALL_DTMF_TONE_DURATION "dtmf-tone-duration"
|
||||||
|
|
||||||
#define MM_BASE_CALL_PATH "call-path"
|
#define MM_BASE_CALL_PATH "call-path"
|
||||||
#define MM_BASE_CALL_CONNECTION "call-connection"
|
#define MM_BASE_CALL_CONNECTION "call-connection"
|
||||||
#define MM_BASE_CALL_MODEM "call-modem"
|
#define MM_BASE_CALL_IFACE_MODEM_VOICE "call-iface-modem-voice"
|
||||||
#define MM_BASE_CALL_SKIP_INCOMING_TIMEOUT "call-skip-incoming-timeout"
|
#define MM_BASE_CALL_SKIP_INCOMING_TIMEOUT "call-skip-incoming-timeout"
|
||||||
#define MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING "call-supports-dialing-to-ringing"
|
#define MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING "call-supports-dialing-to-ringing"
|
||||||
#define MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE "call-supports-ringing-to-active"
|
#define MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE "call-supports-ringing-to-active"
|
||||||
@@ -86,27 +90,28 @@ struct _MMBaseCallClass {
|
|||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
/* Send a DTMF tone */
|
/* DTMF tone handling */
|
||||||
void (* send_dtmf) (MMBaseCall *self,
|
void (* send_dtmf) (MMBaseCall *self,
|
||||||
const gchar *dtmf,
|
const gchar *dtmf,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
gboolean (* send_dtmf_finish) (MMBaseCall *self,
|
/* Returns the number of DTMF characters sent, or < 1 on error */
|
||||||
GAsyncResult *res,
|
gssize (* send_dtmf_finish) (MMBaseCall *self,
|
||||||
GError **error);
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
void (* stop_dtmf) (MMBaseCall *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean (* stop_dtmf_finish) (MMBaseCall *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
GType mm_base_call_get_type (void);
|
GType mm_base_call_get_type (void);
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseCall, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseCall, g_object_unref)
|
||||||
|
|
||||||
/* This one can be overridden by plugins */
|
|
||||||
MMBaseCall *mm_base_call_new (MMBaseModem *modem,
|
|
||||||
MMCallDirection direction,
|
|
||||||
const gchar *number,
|
|
||||||
gboolean skip_incoming_timeout,
|
|
||||||
gboolean supports_dialing_to_ringing,
|
|
||||||
gboolean supports_ringing_to_active);
|
|
||||||
|
|
||||||
void mm_base_call_export (MMBaseCall *self);
|
void mm_base_call_export (MMBaseCall *self);
|
||||||
void mm_base_call_unexport (MMBaseCall *self);
|
void mm_base_call_unexport (MMBaseCall *self);
|
||||||
|
|
||||||
@@ -137,4 +142,9 @@ void mm_base_call_received_dtmf (MMBaseCall *self,
|
|||||||
|
|
||||||
void mm_base_call_incoming_refresh (MMBaseCall *self);
|
void mm_base_call_incoming_refresh (MMBaseCall *self);
|
||||||
|
|
||||||
|
guint mm_base_call_get_dtmf_tone_duration (MMBaseCall *self);
|
||||||
|
|
||||||
|
void mm_base_call_set_dtmf_tone_duration (MMBaseCall *self,
|
||||||
|
guint duration_ms);
|
||||||
|
|
||||||
#endif /* MM_BASE_CALL_H */
|
#endif /* MM_BASE_CALL_H */
|
||||||
|
|||||||
+30
-38
@@ -25,26 +25,24 @@
|
|||||||
#include <libmm-glib.h>
|
#include <libmm-glib.h>
|
||||||
|
|
||||||
#include "mm-base-cbm.h"
|
#include "mm-base-cbm.h"
|
||||||
#include "mm-broadband-modem.h"
|
|
||||||
#include "mm-iface-modem.h"
|
|
||||||
#include "mm-iface-modem-cell-broadcast.h"
|
|
||||||
#include "mm-cbm-part.h"
|
#include "mm-cbm-part.h"
|
||||||
#include "mm-base-modem-at.h"
|
|
||||||
#include "mm-base-modem.h"
|
|
||||||
#include "mm-log-object.h"
|
#include "mm-log-object.h"
|
||||||
#include "mm-modem-helpers.h"
|
#include "mm-modem-helpers.h"
|
||||||
#include "mm-error-helpers.h"
|
#include "mm-error-helpers.h"
|
||||||
|
#include "mm-bind.h"
|
||||||
|
|
||||||
static void log_object_iface_init (MMLogObjectInterface *iface);
|
static void log_object_iface_init (MMLogObjectInterface *iface);
|
||||||
|
static void bind_iface_init (MMBindInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_EXTENDED (MMBaseCbm, mm_base_cbm, MM_GDBUS_TYPE_CBM_SKELETON, 0,
|
G_DEFINE_TYPE_EXTENDED (MMBaseCbm, mm_base_cbm, MM_GDBUS_TYPE_CBM_SKELETON, 0,
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init))
|
G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init)
|
||||||
|
G_IMPLEMENT_INTERFACE (MM_TYPE_BIND, bind_iface_init))
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_PATH,
|
PROP_PATH,
|
||||||
PROP_CONNECTION,
|
PROP_CONNECTION,
|
||||||
PROP_MODEM,
|
PROP_BIND_TO,
|
||||||
PROP_MAX_PARTS,
|
PROP_MAX_PARTS,
|
||||||
PROP_SERIAL,
|
PROP_SERIAL,
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
@@ -57,8 +55,9 @@ struct _MMBaseCbmPrivate {
|
|||||||
GDBusConnection *connection;
|
GDBusConnection *connection;
|
||||||
guint dbus_id;
|
guint dbus_id;
|
||||||
|
|
||||||
/* The modem which owns this CBM */
|
/* The object this CBM is bound to */
|
||||||
MMBaseModem *modem;
|
GObject *bind_to;
|
||||||
|
|
||||||
/* The path where the CBM object is exported */
|
/* The path where the CBM object is exported */
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
|
||||||
@@ -174,6 +173,7 @@ initialize_cbm (MMBaseCbm *self)
|
|||||||
"channel", mm_cbm_part_get_channel (part),
|
"channel", mm_cbm_part_get_channel (part),
|
||||||
"update", CBM_SERIAL_MESSAGE_CODE_UPDATE (serial),
|
"update", CBM_SERIAL_MESSAGE_CODE_UPDATE (serial),
|
||||||
"message-code", CBM_SERIAL_MESSAGE_CODE (serial),
|
"message-code", CBM_SERIAL_MESSAGE_CODE (serial),
|
||||||
|
"language", mm_cbm_part_get_language (part),
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,15 +323,15 @@ mm_base_cbm_take_part (MMBaseCbm *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MMBaseCbm *
|
MMBaseCbm *
|
||||||
mm_base_cbm_new (MMBaseModem *modem)
|
mm_base_cbm_new (GObject *bind_to)
|
||||||
{
|
{
|
||||||
return MM_BASE_CBM (g_object_new (MM_TYPE_BASE_CBM,
|
return MM_BASE_CBM (g_object_new (MM_TYPE_BASE_CBM,
|
||||||
MM_BASE_CBM_MODEM, modem,
|
MM_BIND_TO, bind_to,
|
||||||
NULL));
|
NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
MMBaseCbm *
|
MMBaseCbm *
|
||||||
mm_base_cbm_new_with_part (MMBaseModem *modem,
|
mm_base_cbm_new_with_part (GObject *bind_to,
|
||||||
MMCbmState state,
|
MMCbmState state,
|
||||||
guint max_parts,
|
guint max_parts,
|
||||||
MMCbmPart *first_part,
|
MMCbmPart *first_part,
|
||||||
@@ -339,13 +339,11 @@ mm_base_cbm_new_with_part (MMBaseModem *modem,
|
|||||||
{
|
{
|
||||||
MMBaseCbm *self;
|
MMBaseCbm *self;
|
||||||
|
|
||||||
g_assert (MM_IS_IFACE_MODEM_CELL_BROADCAST (modem));
|
|
||||||
|
|
||||||
if (state == MM_CBM_STATE_RECEIVED)
|
if (state == MM_CBM_STATE_RECEIVED)
|
||||||
state = MM_CBM_STATE_RECEIVING;
|
state = MM_CBM_STATE_RECEIVING;
|
||||||
|
|
||||||
/* Create a CBM object as defined by the interface */
|
/* Create a CBM object as defined by the interface */
|
||||||
self = mm_iface_modem_cell_broadcast_create_cbm (MM_IFACE_MODEM_CELL_BROADCAST (modem));
|
self = mm_base_cbm_new (bind_to);
|
||||||
g_object_set (self,
|
g_object_set (self,
|
||||||
MM_BASE_CBM_MAX_PARTS, max_parts,
|
MM_BASE_CBM_MAX_PARTS, max_parts,
|
||||||
"state", state,
|
"state", state,
|
||||||
@@ -405,18 +403,10 @@ set_property (GObject *object,
|
|||||||
else if (self->priv->path)
|
else if (self->priv->path)
|
||||||
cbm_dbus_export (self);
|
cbm_dbus_export (self);
|
||||||
break;
|
break;
|
||||||
case PROP_MODEM:
|
case PROP_BIND_TO:
|
||||||
g_clear_object (&self->priv->modem);
|
g_clear_object (&self->priv->bind_to);
|
||||||
self->priv->modem = g_value_dup_object (value);
|
self->priv->bind_to = g_value_dup_object (value);
|
||||||
if (self->priv->modem) {
|
mm_bind_to (MM_BIND (self), MM_BASE_CBM_CONNECTION, self->priv->bind_to);
|
||||||
/* Set owner ID */
|
|
||||||
mm_log_object_set_owner_id (MM_LOG_OBJECT (self), mm_log_object_get_id (MM_LOG_OBJECT (self->priv->modem)));
|
|
||||||
/* Bind the modem's connection (which is set when it is exported,
|
|
||||||
* and unset when unexported) to the CBM's connection */
|
|
||||||
g_object_bind_property (self->priv->modem, MM_BASE_MODEM_CONNECTION,
|
|
||||||
self, MM_BASE_CBM_CONNECTION,
|
|
||||||
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case PROP_MAX_PARTS:
|
case PROP_MAX_PARTS:
|
||||||
self->priv->max_parts = g_value_get_uint (value);
|
self->priv->max_parts = g_value_get_uint (value);
|
||||||
@@ -445,8 +435,8 @@ get_property (GObject *object,
|
|||||||
case PROP_CONNECTION:
|
case PROP_CONNECTION:
|
||||||
g_value_set_object (value, self->priv->connection);
|
g_value_set_object (value, self->priv->connection);
|
||||||
break;
|
break;
|
||||||
case PROP_MODEM:
|
case PROP_BIND_TO:
|
||||||
g_value_set_object (value, self->priv->modem);
|
g_value_set_object (value, self->priv->bind_to);
|
||||||
break;
|
break;
|
||||||
case PROP_MAX_PARTS:
|
case PROP_MAX_PARTS:
|
||||||
g_value_set_uint (value, self->priv->max_parts);
|
g_value_set_uint (value, self->priv->max_parts);
|
||||||
@@ -496,7 +486,7 @@ dispose (GObject *object)
|
|||||||
g_clear_object (&self->priv->connection);
|
g_clear_object (&self->priv->connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_clear_object (&self->priv->modem);
|
g_clear_object (&self->priv->bind_to);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_base_cbm_parent_class)->dispose (object);
|
G_OBJECT_CLASS (mm_base_cbm_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
@@ -507,6 +497,11 @@ log_object_iface_init (MMLogObjectInterface *iface)
|
|||||||
iface->build_id = log_object_build_id;
|
iface->build_id = log_object_build_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
bind_iface_init (MMBindInterface *iface)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mm_base_cbm_class_init (MMBaseCbmClass *klass)
|
mm_base_cbm_class_init (MMBaseCbmClass *klass)
|
||||||
{
|
{
|
||||||
@@ -526,6 +521,7 @@ mm_base_cbm_class_init (MMBaseCbmClass *klass)
|
|||||||
"GDBus connection to the system bus.",
|
"GDBus connection to the system bus.",
|
||||||
G_TYPE_DBUS_CONNECTION,
|
G_TYPE_DBUS_CONNECTION,
|
||||||
G_PARAM_READWRITE);
|
G_PARAM_READWRITE);
|
||||||
|
g_object_class_install_property (object_class, PROP_CONNECTION, properties[PROP_CONNECTION]);
|
||||||
|
|
||||||
properties[PROP_PATH] =
|
properties[PROP_PATH] =
|
||||||
g_param_spec_string (MM_BASE_CBM_PATH,
|
g_param_spec_string (MM_BASE_CBM_PATH,
|
||||||
@@ -533,13 +529,9 @@ mm_base_cbm_class_init (MMBaseCbmClass *klass)
|
|||||||
"DBus path of the CBM",
|
"DBus path of the CBM",
|
||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE);
|
G_PARAM_READWRITE);
|
||||||
|
g_object_class_install_property (object_class, PROP_PATH, properties[PROP_PATH]);
|
||||||
|
|
||||||
properties[PROP_MODEM] =
|
g_object_class_override_property (object_class, PROP_BIND_TO, MM_BIND_TO);
|
||||||
g_param_spec_object (MM_BASE_CBM_MODEM,
|
|
||||||
"Modem",
|
|
||||||
"The Modem which owns this CBM",
|
|
||||||
MM_TYPE_BASE_MODEM,
|
|
||||||
G_PARAM_READWRITE);
|
|
||||||
|
|
||||||
properties[PROP_MAX_PARTS] =
|
properties[PROP_MAX_PARTS] =
|
||||||
g_param_spec_uint (MM_BASE_CBM_MAX_PARTS,
|
g_param_spec_uint (MM_BASE_CBM_MAX_PARTS,
|
||||||
@@ -547,6 +539,7 @@ mm_base_cbm_class_init (MMBaseCbmClass *klass)
|
|||||||
"Maximum number of parts composing this CBM",
|
"Maximum number of parts composing this CBM",
|
||||||
1, 255, 1,
|
1, 255, 1,
|
||||||
G_PARAM_READWRITE);
|
G_PARAM_READWRITE);
|
||||||
|
g_object_class_install_property (object_class, PROP_MAX_PARTS, properties[PROP_MAX_PARTS]);
|
||||||
|
|
||||||
properties[PROP_SERIAL] =
|
properties[PROP_SERIAL] =
|
||||||
g_param_spec_uint (MM_BASE_CBM_SERIAL,
|
g_param_spec_uint (MM_BASE_CBM_SERIAL,
|
||||||
@@ -554,8 +547,7 @@ mm_base_cbm_class_init (MMBaseCbmClass *klass)
|
|||||||
"The serial of this CBM",
|
"The serial of this CBM",
|
||||||
0, G_MAXUINT16, 0,
|
0, G_MAXUINT16, 0,
|
||||||
G_PARAM_READWRITE);
|
G_PARAM_READWRITE);
|
||||||
|
g_object_class_install_property (object_class, PROP_SERIAL, properties[PROP_SERIAL]);
|
||||||
g_object_class_install_properties (object_class, PROP_LAST, properties);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
guint16
|
guint16
|
||||||
|
|||||||
+2
-4
@@ -23,7 +23,6 @@
|
|||||||
#include <libmm-glib.h>
|
#include <libmm-glib.h>
|
||||||
|
|
||||||
#include "mm-cbm-part.h"
|
#include "mm-cbm-part.h"
|
||||||
#include "mm-base-modem.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
@@ -40,7 +39,6 @@ typedef struct _MMBaseCbmPrivate MMBaseCbmPrivate;
|
|||||||
|
|
||||||
#define MM_BASE_CBM_PATH "cbm-path"
|
#define MM_BASE_CBM_PATH "cbm-path"
|
||||||
#define MM_BASE_CBM_CONNECTION "cbm-connection"
|
#define MM_BASE_CBM_CONNECTION "cbm-connection"
|
||||||
#define MM_BASE_CBM_MODEM "cbm-modem"
|
|
||||||
#define MM_BASE_CBM_MAX_PARTS "cbm-max-parts"
|
#define MM_BASE_CBM_MAX_PARTS "cbm-max-parts"
|
||||||
#define MM_BASE_CBM_SERIAL "cbm-serial"
|
#define MM_BASE_CBM_SERIAL "cbm-serial"
|
||||||
|
|
||||||
@@ -56,11 +54,11 @@ struct _MMBaseCbmClass {
|
|||||||
GType mm_base_cbm_get_type (void);
|
GType mm_base_cbm_get_type (void);
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseCbm, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseCbm, g_object_unref)
|
||||||
|
|
||||||
MMBaseCbm *mm_base_cbm_new (MMBaseModem *modem);
|
MMBaseCbm *mm_base_cbm_new (GObject *bind_to);
|
||||||
gboolean mm_base_cbm_take_part (MMBaseCbm *self,
|
gboolean mm_base_cbm_take_part (MMBaseCbm *self,
|
||||||
MMCbmPart *part,
|
MMCbmPart *part,
|
||||||
GError **error);
|
GError **error);
|
||||||
MMBaseCbm *mm_base_cbm_new_with_part (MMBaseModem *modem,
|
MMBaseCbm *mm_base_cbm_new_with_part (GObject *bind_to,
|
||||||
MMCbmState state,
|
MMCbmState state,
|
||||||
guint max_parts,
|
guint max_parts,
|
||||||
MMCbmPart *first_part,
|
MMCbmPart *first_part,
|
||||||
|
|||||||
+333
-117
@@ -17,6 +17,8 @@
|
|||||||
* Copyright (C) 2011 - 2016 Aleksander Morgado <aleksander@aleksander.es>
|
* Copyright (C) 2011 - 2016 Aleksander Morgado <aleksander@aleksander.es>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "gio/gio.h"
|
||||||
|
#include "glib.h"
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -129,23 +131,6 @@ struct _MMBaseManagerPrivate {
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static MMDevice *
|
|
||||||
find_device_by_modem (MMBaseManager *manager,
|
|
||||||
MMBaseModem *modem)
|
|
||||||
{
|
|
||||||
GHashTableIter iter;
|
|
||||||
gpointer key, value;
|
|
||||||
|
|
||||||
g_hash_table_iter_init (&iter, manager->priv->devices);
|
|
||||||
while (g_hash_table_iter_next (&iter, &key, &value)) {
|
|
||||||
MMDevice *candidate = MM_DEVICE (value);
|
|
||||||
|
|
||||||
if (modem == mm_device_peek_modem (candidate))
|
|
||||||
return candidate;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static MMDevice *
|
static MMDevice *
|
||||||
find_device_by_port (MMBaseManager *manager,
|
find_device_by_port (MMBaseManager *manager,
|
||||||
MMKernelDevice *port)
|
MMKernelDevice *port)
|
||||||
@@ -367,7 +352,7 @@ device_removed (MMBaseManager *self,
|
|||||||
|
|
||||||
/* The device may have already been removed from the tracking HT, we
|
/* The device may have already been removed from the tracking HT, we
|
||||||
* just try to remove it and if it fails, we ignore it */
|
* just try to remove it and if it fails, we ignore it */
|
||||||
mm_device_remove_modem (device);
|
mm_device_remove_modem_quick (device);
|
||||||
g_hash_table_remove (self->priv->devices, mm_device_get_uid (device));
|
g_hash_table_remove (self->priv->devices, mm_device_get_uid (device));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -455,6 +440,19 @@ existing_port (MMBaseManager *self,
|
|||||||
device_support_check_add_single_port (self, device, port);
|
device_support_check_add_single_port (self, device, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
additional_port_modem_remove_ready (MMDevice *device,
|
||||||
|
GAsyncResult *res,
|
||||||
|
MMBaseManager *self)
|
||||||
|
{
|
||||||
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
|
if (!mm_device_remove_modem_finish (device, res, &error))
|
||||||
|
mm_obj_warn (device, "removing modem failed: %s", error->message);
|
||||||
|
device_support_check_add_all_ports (self, device);
|
||||||
|
g_object_unref (self);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
additional_port (MMBaseManager *self,
|
additional_port (MMBaseManager *self,
|
||||||
MMDevice *device,
|
MMDevice *device,
|
||||||
@@ -500,9 +498,9 @@ additional_port (MMBaseManager *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
mm_obj_info (self, "last modem object creation in device '%s' succeeded, but we have a new port addition, will retry", uid);
|
mm_obj_info (self, "last modem object creation in device '%s' succeeded, but we have a new port addition, will retry", uid);
|
||||||
g_cancellable_cancel (mm_base_modem_peek_cancellable (modem));
|
mm_device_remove_modem (device,
|
||||||
mm_device_remove_modem (device);
|
(GAsyncReadyCallback)additional_port_modem_remove_ready,
|
||||||
device_support_check_add_all_ports (self, device);
|
g_object_ref (self));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -873,146 +871,364 @@ mm_base_manager_start (MMBaseManager *self,
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
DEVICE_CLEANUP_STEP_FIRST = 0,
|
||||||
|
DEVICE_CLEANUP_STEP_DISABLE,
|
||||||
|
DEVICE_CLEANUP_STEP_LOW_POWER,
|
||||||
|
DEVICE_CLEANUP_STEP_REMOVE,
|
||||||
|
DEVICE_CLEANUP_STEP_TERSE,
|
||||||
|
DEVICE_CLEANUP_STEP_LAST,
|
||||||
|
} DeviceCleanupStep;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
MMBaseManager *self;
|
MMBaseModem *modem;
|
||||||
gboolean low_power;
|
MMBaseManagerCleanupFlags flags;
|
||||||
gboolean remove;
|
DeviceCleanupStep step;
|
||||||
} DisableContext;
|
} DeviceCleanupContext;
|
||||||
|
|
||||||
static void
|
static void device_cleanup_step (GTask *task);
|
||||||
disable_context_free (DisableContext *ctx)
|
|
||||||
|
static DeviceCleanupContext *
|
||||||
|
device_cleanup_context_new (MMBaseModem *modem,
|
||||||
|
MMBaseManagerCleanupFlags flags)
|
||||||
{
|
{
|
||||||
g_object_unref (ctx->self);
|
DeviceCleanupContext *ctx;
|
||||||
g_slice_free (DisableContext, ctx);
|
|
||||||
|
ctx = g_slice_new0 (DeviceCleanupContext);
|
||||||
|
if (modem)
|
||||||
|
ctx->modem = g_object_ref (modem);
|
||||||
|
ctx->step = DEVICE_CLEANUP_STEP_FIRST;
|
||||||
|
ctx->flags = flags;
|
||||||
|
|
||||||
|
return ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
remove_device_after_disable (MMBaseModem *modem,
|
device_cleanup_context_free (DeviceCleanupContext *ctx)
|
||||||
DisableContext *ctx)
|
|
||||||
{
|
{
|
||||||
MMDevice *device;
|
g_clear_object (&ctx->modem);
|
||||||
|
g_slice_free (DeviceCleanupContext, ctx);
|
||||||
device = find_device_by_modem (ctx->self, modem);
|
|
||||||
if (device) {
|
|
||||||
g_cancellable_cancel (mm_base_modem_peek_cancellable (modem));
|
|
||||||
mm_device_remove_modem (device);
|
|
||||||
g_hash_table_remove (ctx->self->priv->devices, mm_device_get_uid (device));
|
|
||||||
}
|
|
||||||
|
|
||||||
disable_context_free (ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
shutdown_low_power_ready (MMIfaceModem *modem,
|
modem_remove_ready (MMDevice *device,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
DisableContext *ctx)
|
GTask *task)
|
||||||
{
|
{
|
||||||
g_autoptr(GError) error = NULL;
|
DeviceCleanupContext *ctx;
|
||||||
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
|
ctx = g_task_get_task_data (task);
|
||||||
|
|
||||||
|
if (!mm_device_remove_modem_finish (device, res, &error))
|
||||||
|
mm_obj_warn (device, "removing modem failed: %s", error->message);
|
||||||
|
|
||||||
|
ctx->step++;
|
||||||
|
device_cleanup_step (task);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
cleanup_low_power_ready (MMIfaceModem *modem,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GTask *task)
|
||||||
|
{
|
||||||
|
DeviceCleanupContext *ctx;
|
||||||
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
|
ctx = g_task_get_task_data (task);
|
||||||
|
|
||||||
if (!mm_iface_modem_set_power_state_finish (modem, res, NULL, &error))
|
if (!mm_iface_modem_set_power_state_finish (modem, res, NULL, &error))
|
||||||
mm_obj_info (ctx->self, "changing to low power state failed: %s", error->message);
|
mm_obj_info (modem, "changing to low power state failed: %s", error->message);
|
||||||
|
|
||||||
if (ctx->remove)
|
ctx->step++;
|
||||||
remove_device_after_disable (MM_BASE_MODEM (modem), ctx);
|
device_cleanup_step (task);
|
||||||
else
|
|
||||||
disable_context_free (ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
shutdown_disable_ready (MMBaseModem *modem,
|
cleanup_disable_ready (MMBaseModem *modem,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
DisableContext *ctx)
|
GTask *task)
|
||||||
{
|
{
|
||||||
g_autoptr(GError) error = NULL;
|
DeviceCleanupContext *ctx;
|
||||||
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
/* We don't care about errors disabling at this point */
|
ctx = g_task_get_task_data (task);
|
||||||
if (!mm_base_modem_disable_finish (modem, res, &error)) {
|
|
||||||
mm_obj_info (ctx->self, "disabling modem failed: %s", error->message);
|
if (mm_base_modem_disable_finish (modem, res, &error)) {
|
||||||
}
|
ctx->step++;
|
||||||
/* Bring the modem to low power mode if requested */
|
} else {
|
||||||
else if (ctx->low_power) {
|
mm_obj_info (modem, "disabling modem failed: %s", error->message);
|
||||||
mm_iface_modem_set_power_state (MM_IFACE_MODEM (modem),
|
|
||||||
MM_MODEM_POWER_STATE_LOW,
|
/* If disabling failed there's no point in trying to low-power the
|
||||||
(GAsyncReadyCallback)shutdown_low_power_ready,
|
* modem; just remove it.
|
||||||
ctx);
|
*/
|
||||||
return;
|
ctx->step = DEVICE_CLEANUP_STEP_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->remove)
|
device_cleanup_step (task);
|
||||||
remove_device_after_disable (modem, ctx);
|
|
||||||
else
|
|
||||||
disable_context_free (ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined WITH_SUSPEND_RESUME
|
||||||
static void
|
static void
|
||||||
foreach_disable (gpointer key,
|
cleanup_terse_ready (MMBaseModem *modem,
|
||||||
MMDevice *device,
|
GAsyncResult *res,
|
||||||
DisableContext *foreach_ctx)
|
GTask *task)
|
||||||
{
|
{
|
||||||
MMBaseModem *modem;
|
DeviceCleanupContext *ctx;
|
||||||
DisableContext *ctx;
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
modem = mm_device_peek_modem (device);
|
ctx = g_task_get_task_data (task);
|
||||||
if (!modem)
|
if (!mm_base_modem_terse_finish (modem, res, &error))
|
||||||
return;
|
mm_obj_info (modem, "setting terse failed: %s", error->message);
|
||||||
|
|
||||||
ctx = g_slice_new0 (DisableContext);
|
ctx->step++;
|
||||||
ctx->self = g_object_ref (foreach_ctx->self);
|
|
||||||
ctx->low_power = foreach_ctx->low_power;
|
|
||||||
ctx->remove = foreach_ctx->remove;
|
|
||||||
|
|
||||||
mm_base_modem_disable (modem,
|
device_cleanup_step (task);
|
||||||
MM_BASE_MODEM_OPERATION_LOCK_REQUIRED,
|
|
||||||
MM_BASE_MODEM_OPERATION_PRIORITY_OVERRIDE,
|
|
||||||
(GAsyncReadyCallback)shutdown_disable_ready,
|
|
||||||
ctx);
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
foreach_remove (gpointer key,
|
has_cleanup_flag (MMBaseManagerCleanupFlags flags,
|
||||||
MMDevice *device,
|
MMBaseManagerCleanupFlags expected)
|
||||||
MMBaseManager *self)
|
|
||||||
{
|
{
|
||||||
MMBaseModem *modem;
|
return flags & expected;
|
||||||
|
}
|
||||||
|
|
||||||
modem = mm_device_peek_modem (device);
|
static void
|
||||||
if (modem)
|
device_cleanup_step (GTask *task)
|
||||||
g_cancellable_cancel (mm_base_modem_peek_cancellable (modem));
|
{
|
||||||
mm_device_remove_modem (device);
|
DeviceCleanupContext *ctx;
|
||||||
return TRUE;
|
MMDevice *device;
|
||||||
|
|
||||||
|
ctx = g_task_get_task_data (task);
|
||||||
|
device = g_task_get_source_object (task);
|
||||||
|
|
||||||
|
switch (ctx->step) {
|
||||||
|
case DEVICE_CLEANUP_STEP_FIRST:
|
||||||
|
ctx->step++;
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
|
case DEVICE_CLEANUP_STEP_DISABLE:
|
||||||
|
if (ctx->modem && has_cleanup_flag (ctx->flags, MM_BASE_MANAGER_CLEANUP_DISABLE)) {
|
||||||
|
mm_obj_dbg (device,
|
||||||
|
"disabling modem%d",
|
||||||
|
mm_base_modem_get_dbus_id (ctx->modem));
|
||||||
|
mm_base_modem_disable (ctx->modem,
|
||||||
|
MM_OPERATION_LOCK_REQUIRED,
|
||||||
|
MM_OPERATION_PRIORITY_OVERRIDE,
|
||||||
|
(GAsyncReadyCallback)cleanup_disable_ready,
|
||||||
|
task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ctx->step++;
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
|
case DEVICE_CLEANUP_STEP_LOW_POWER:
|
||||||
|
if (ctx->modem && has_cleanup_flag (ctx->flags, MM_BASE_MANAGER_CLEANUP_LOW_POWER)) {
|
||||||
|
mm_obj_dbg (device,
|
||||||
|
"setting modem%d to low-power state",
|
||||||
|
mm_base_modem_get_dbus_id (ctx->modem));
|
||||||
|
mm_iface_modem_set_power_state (MM_IFACE_MODEM (ctx->modem),
|
||||||
|
MM_MODEM_POWER_STATE_LOW,
|
||||||
|
(GAsyncReadyCallback)cleanup_low_power_ready,
|
||||||
|
task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ctx->step++;
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
|
case DEVICE_CLEANUP_STEP_REMOVE:
|
||||||
|
if (ctx->modem && has_cleanup_flag (ctx->flags, MM_BASE_MANAGER_CLEANUP_REMOVE)) {
|
||||||
|
mm_obj_dbg (device,
|
||||||
|
"removing modem%d",
|
||||||
|
mm_base_modem_get_dbus_id (ctx->modem));
|
||||||
|
mm_device_remove_modem (device,
|
||||||
|
(GAsyncReadyCallback)modem_remove_ready,
|
||||||
|
task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ctx->step++;
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
|
case DEVICE_CLEANUP_STEP_TERSE:
|
||||||
|
|
||||||
|
#if defined WITH_SUSPEND_RESUME
|
||||||
|
if (ctx->modem && has_cleanup_flag (ctx->flags, MM_BASE_MANAGER_CLEANUP_TERSE)) {
|
||||||
|
mm_obj_dbg(device,
|
||||||
|
"settting terse on modem%d",
|
||||||
|
mm_base_modem_get_dbus_id (ctx->modem));
|
||||||
|
mm_base_modem_terse (ctx->modem,
|
||||||
|
MM_OPERATION_LOCK_REQUIRED,
|
||||||
|
(GAsyncReadyCallback)cleanup_terse_ready,
|
||||||
|
task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ctx->step++;
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
|
case DEVICE_CLEANUP_STEP_LAST:
|
||||||
|
mm_obj_dbg (device, "device cleanup complete");
|
||||||
|
g_task_return_boolean (task, TRUE);
|
||||||
|
g_object_unref (task);
|
||||||
|
return;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_assert_not_reached ();
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
MMBaseManager *self;
|
||||||
|
GSList *tasks;
|
||||||
|
GSList *devices_to_remove;
|
||||||
|
MMSleepContext *sleep_ctx;
|
||||||
|
} ManagerCleanupContext;
|
||||||
|
|
||||||
|
static ManagerCleanupContext *
|
||||||
|
manager_cleanup_context_new (MMBaseManager *self,
|
||||||
|
MMSleepContext *sleep_ctx)
|
||||||
|
{
|
||||||
|
ManagerCleanupContext *ctx;
|
||||||
|
|
||||||
|
ctx = g_slice_new0 (ManagerCleanupContext);
|
||||||
|
ctx->self = g_object_ref (self);
|
||||||
|
ctx->sleep_ctx = g_object_ref (sleep_ctx);
|
||||||
|
return ctx;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
manager_cleanup_context_maybe_complete (ManagerCleanupContext *ctx,
|
||||||
|
GTask *task,
|
||||||
|
MMDevice *device,
|
||||||
|
gboolean remove)
|
||||||
|
{
|
||||||
|
if (task)
|
||||||
|
ctx->tasks = g_slist_remove (ctx->tasks, task);
|
||||||
|
|
||||||
|
if (remove) {
|
||||||
|
g_assert (device);
|
||||||
|
ctx->devices_to_remove = g_slist_append (ctx->devices_to_remove, device);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ctx->tasks == NULL) {
|
||||||
|
GSList *iter;
|
||||||
|
|
||||||
|
/* Remove devices at the end to avoid modifying the hash table
|
||||||
|
* during iteration, in case a device has no modem and the steps
|
||||||
|
* all fall through.
|
||||||
|
*/
|
||||||
|
for (iter = ctx->devices_to_remove; iter; iter = iter->next)
|
||||||
|
g_hash_table_remove (ctx->self->priv->devices, mm_device_get_uid (device));
|
||||||
|
g_slist_free (ctx->devices_to_remove);
|
||||||
|
|
||||||
|
mm_obj_dbg (ctx->self, "cleanup complete");
|
||||||
|
mm_sleep_context_complete (ctx->sleep_ctx, NULL);
|
||||||
|
|
||||||
|
g_object_unref (ctx->sleep_ctx);
|
||||||
|
g_object_unref (ctx->self);
|
||||||
|
g_slice_free (ManagerCleanupContext, ctx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
device_cleanup_ready (MMDevice *device,
|
||||||
|
GAsyncResult *res,
|
||||||
|
ManagerCleanupContext *ctx)
|
||||||
|
{
|
||||||
|
GTask *task;
|
||||||
|
DeviceCleanupContext *dctx;
|
||||||
|
g_autoptr(GError) error = NULL;
|
||||||
|
gboolean remove;
|
||||||
|
|
||||||
|
task = G_TASK (res);
|
||||||
|
|
||||||
|
if (!g_task_propagate_boolean (task, &error)) {
|
||||||
|
mm_obj_info (ctx->self,
|
||||||
|
"failed to cleanup device %s: %s",
|
||||||
|
mm_device_get_uid (device),
|
||||||
|
error->message);
|
||||||
|
}
|
||||||
|
|
||||||
|
dctx = g_task_get_task_data (task);
|
||||||
|
remove = has_cleanup_flag (dctx->flags, MM_BASE_MANAGER_CLEANUP_REMOVE);
|
||||||
|
manager_cleanup_context_maybe_complete (ctx, task, device, remove);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mm_base_manager_shutdown (MMBaseManager *self,
|
mm_base_manager_cleanup (MMBaseManager *self,
|
||||||
gboolean disable,
|
MMBaseManagerCleanupFlags flags,
|
||||||
gboolean low_power,
|
MMSleepContext *sleep_ctx)
|
||||||
gboolean remove)
|
|
||||||
{
|
{
|
||||||
|
ManagerCleanupContext *ctx;
|
||||||
|
GHashTableIter iter;
|
||||||
|
MMDevice *device;
|
||||||
|
gboolean disable, remove, low_power, terse;
|
||||||
|
guint active_bearers = 0;
|
||||||
|
|
||||||
g_return_if_fail (self != NULL);
|
g_return_if_fail (self != NULL);
|
||||||
g_return_if_fail (MM_IS_BASE_MANAGER (self));
|
g_return_if_fail (MM_IS_BASE_MANAGER (self));
|
||||||
|
|
||||||
/* Cancel all ongoing auth requests */
|
/* Cancel all ongoing auth requests */
|
||||||
g_cancellable_cancel (self->priv->authp_cancellable);
|
g_cancellable_cancel (self->priv->authp_cancellable);
|
||||||
|
|
||||||
if (disable) {
|
disable = has_cleanup_flag (flags, MM_BASE_MANAGER_CLEANUP_DISABLE);
|
||||||
DisableContext foreach_ctx = {
|
low_power = has_cleanup_flag (flags, MM_BASE_MANAGER_CLEANUP_LOW_POWER);
|
||||||
.self = self,
|
remove = has_cleanup_flag (flags, MM_BASE_MANAGER_CLEANUP_REMOVE);
|
||||||
.low_power = low_power,
|
terse = has_cleanup_flag (flags, MM_BASE_MANAGER_CLEANUP_TERSE);
|
||||||
.remove = remove,
|
mm_obj_dbg (self,
|
||||||
};
|
"manager shutting down... (%s%s%s%s%s%s%s)",
|
||||||
g_hash_table_foreach (self->priv->devices, (GHFunc)foreach_disable, &foreach_ctx);
|
disable ? "disable" : "",
|
||||||
|
disable && (low_power || remove || terse) ? "," : "",
|
||||||
|
low_power ? "low-power" : "",
|
||||||
|
low_power && (remove || terse) ? "," : "",
|
||||||
|
remove ? "remove" : "",
|
||||||
|
(remove && terse) ? "," : "",
|
||||||
|
terse ? "terse" : "");
|
||||||
|
|
||||||
/* Disabling may take a few iterations of the mainloop, so the caller
|
ctx = manager_cleanup_context_new (self, sleep_ctx);
|
||||||
* has to iterate the mainloop until all devices have been disabled and
|
|
||||||
* removed.
|
g_hash_table_iter_init (&iter, self->priv->devices);
|
||||||
*/
|
while (g_hash_table_iter_next (&iter, NULL, (gpointer) &device)) {
|
||||||
return;
|
DeviceCleanupContext *dctx;
|
||||||
|
GTask *task;
|
||||||
|
MMBaseModem *modem;
|
||||||
|
|
||||||
|
modem = mm_device_peek_modem (device);
|
||||||
|
if (modem) {
|
||||||
|
guint count = 0;
|
||||||
|
|
||||||
|
mm_iface_modem_count_bearers (MM_IFACE_MODEM (modem),
|
||||||
|
MM_IFACE_MODEM_COUNT_BEARERS_FLAG_ACTIVE,
|
||||||
|
&count,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
active_bearers += count;
|
||||||
|
}
|
||||||
|
|
||||||
|
task = g_task_new (device,
|
||||||
|
NULL,
|
||||||
|
(GAsyncReadyCallback)device_cleanup_ready,
|
||||||
|
ctx);
|
||||||
|
ctx->tasks = g_slist_append (ctx->tasks, task);
|
||||||
|
|
||||||
|
dctx = device_cleanup_context_new (modem, flags);
|
||||||
|
g_task_set_task_data (task, dctx, (GDestroyNotify)device_cleanup_context_free);
|
||||||
|
|
||||||
|
device_cleanup_step (task);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (remove) {
|
/* Increase cleanup timeout for each connected bearer; disconnecting a
|
||||||
/* Otherwise, just remove directly */
|
* bearer can take many seconds.
|
||||||
g_hash_table_foreach_remove (self->priv->devices, (GHRFunc)foreach_remove, self);
|
*/
|
||||||
}
|
if (active_bearers)
|
||||||
|
mm_sleep_context_timeout_backoff (sleep_ctx, active_bearers * 20);
|
||||||
|
|
||||||
|
/* Complete cleanup if there were no devices */
|
||||||
|
manager_cleanup_context_maybe_complete (ctx, NULL, NULL, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
@@ -1073,7 +1289,7 @@ mm_base_manager_sync (MMBaseManager *self)
|
|||||||
/* We just want to start the synchronization, we don't need the result */
|
/* We just want to start the synchronization, we don't need the result */
|
||||||
if (modem) {
|
if (modem) {
|
||||||
mm_base_modem_sync (modem,
|
mm_base_modem_sync (modem,
|
||||||
MM_BASE_MODEM_OPERATION_LOCK_REQUIRED,
|
MM_OPERATION_LOCK_REQUIRED,
|
||||||
(GAsyncReadyCallback)base_modem_sync_ready,
|
(GAsyncReadyCallback)base_modem_sync_ready,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
@@ -1713,7 +1929,7 @@ handle_set_profile (MmGdbusTest *skeleton,
|
|||||||
out:
|
out:
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
mm_device_remove_modem (device);
|
mm_device_remove_modem_quick (device);
|
||||||
g_hash_table_remove (self->priv->devices, mm_device_get_uid (device));
|
g_hash_table_remove (self->priv->devices, mm_device_get_uid (device));
|
||||||
mm_dbus_method_invocation_return_gerror (invocation, error);
|
mm_dbus_method_invocation_return_gerror (invocation, error);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|||||||
+12
-4
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "mm-filter.h"
|
#include "mm-filter.h"
|
||||||
#include "mm-gdbus-manager.h"
|
#include "mm-gdbus-manager.h"
|
||||||
|
#include "mm-sleep-context.h"
|
||||||
|
|
||||||
#define MM_TYPE_BASE_MANAGER (mm_base_manager_get_type ())
|
#define MM_TYPE_BASE_MANAGER (mm_base_manager_get_type ())
|
||||||
#define MM_BASE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BASE_MANAGER, MMBaseManager))
|
#define MM_BASE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BASE_MANAGER, MMBaseManager))
|
||||||
@@ -71,10 +72,17 @@ MMBaseManager *mm_base_manager_new (GDBusConnection *bus,
|
|||||||
void mm_base_manager_start (MMBaseManager *manager,
|
void mm_base_manager_start (MMBaseManager *manager,
|
||||||
gboolean manual_scan);
|
gboolean manual_scan);
|
||||||
|
|
||||||
void mm_base_manager_shutdown (MMBaseManager *manager,
|
typedef enum {
|
||||||
gboolean disable,
|
MM_BASE_MANAGER_CLEANUP_NONE = 0x0,
|
||||||
gboolean power_low,
|
MM_BASE_MANAGER_CLEANUP_DISABLE = 0x1,
|
||||||
gboolean remove);
|
MM_BASE_MANAGER_CLEANUP_LOW_POWER = 0x2,
|
||||||
|
MM_BASE_MANAGER_CLEANUP_REMOVE = 0x4,
|
||||||
|
MM_BASE_MANAGER_CLEANUP_TERSE = 0x8,
|
||||||
|
} MMBaseManagerCleanupFlags;
|
||||||
|
|
||||||
|
void mm_base_manager_cleanup (MMBaseManager *manager,
|
||||||
|
MMBaseManagerCleanupFlags flags,
|
||||||
|
MMSleepContext *ctx);
|
||||||
|
|
||||||
#if defined WITH_SUSPEND_RESUME
|
#if defined WITH_SUSPEND_RESUME
|
||||||
void mm_base_manager_sync (MMBaseManager *manager);
|
void mm_base_manager_sync (MMBaseManager *manager);
|
||||||
|
|||||||
+379
-123
@@ -39,11 +39,16 @@
|
|||||||
#include "mm-daemon-enums-types.h"
|
#include "mm-daemon-enums-types.h"
|
||||||
#include "mm-serial-parsers.h"
|
#include "mm-serial-parsers.h"
|
||||||
#include "mm-modem-helpers.h"
|
#include "mm-modem-helpers.h"
|
||||||
|
#include "mm-bind.h"
|
||||||
|
|
||||||
static void log_object_iface_init (MMLogObjectInterface *iface);
|
static void log_object_iface_init (MMLogObjectInterface *iface);
|
||||||
|
static void auth_iface_init (MMIfaceAuthInterface *iface);
|
||||||
|
static void op_lock_iface_init (MMIfaceOpLockInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MMBaseModem, mm_base_modem, MM_GDBUS_TYPE_OBJECT_SKELETON,
|
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MMBaseModem, mm_base_modem, MM_GDBUS_TYPE_OBJECT_SKELETON,
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init))
|
G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init)
|
||||||
|
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_AUTH, auth_iface_init)
|
||||||
|
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_OP_LOCK, op_lock_iface_init))
|
||||||
|
|
||||||
/* If we get 10 consecutive timeouts in a serial port, we consider the modem
|
/* If we get 10 consecutive timeouts in a serial port, we consider the modem
|
||||||
* invalid and we request re-probing. */
|
* invalid and we request re-probing. */
|
||||||
@@ -87,6 +92,7 @@ struct _MMBaseModemPrivate {
|
|||||||
* should be done by the modem. */
|
* should be done by the modem. */
|
||||||
GCancellable *cancellable;
|
GCancellable *cancellable;
|
||||||
gulong invalid_if_cancelled;
|
gulong invalid_if_cancelled;
|
||||||
|
guint invalid_from_idle;
|
||||||
|
|
||||||
gchar *device;
|
gchar *device;
|
||||||
gchar *physdev;
|
gchar *physdev;
|
||||||
@@ -101,6 +107,7 @@ struct _MMBaseModemPrivate {
|
|||||||
gboolean hotplugged;
|
gboolean hotplugged;
|
||||||
gboolean valid;
|
gboolean valid;
|
||||||
gboolean reprobe;
|
gboolean reprobe;
|
||||||
|
gboolean torn_down;
|
||||||
|
|
||||||
guint max_timeouts;
|
guint max_timeouts;
|
||||||
|
|
||||||
@@ -148,6 +155,16 @@ struct _MMBaseModemPrivate {
|
|||||||
gboolean scheduled_operations_forbidden_forever;
|
gboolean scheduled_operations_forbidden_forever;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void mm_base_modem_operation_lock (MMBaseModem *self,
|
||||||
|
MMOperationPriority priority,
|
||||||
|
const gchar *description,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
static gssize mm_base_modem_operation_lock_finish (MMBaseModem *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
|
||||||
guint
|
guint
|
||||||
mm_base_modem_get_dbus_id (MMBaseModem *self)
|
mm_base_modem_get_dbus_id (MMBaseModem *self)
|
||||||
{
|
{
|
||||||
@@ -190,11 +207,13 @@ port_timed_out_cb (MMPort *port,
|
|||||||
|
|
||||||
static MMPort *
|
static MMPort *
|
||||||
base_modem_create_ignored_port (MMBaseModem *self,
|
base_modem_create_ignored_port (MMBaseModem *self,
|
||||||
|
MMPortType ptype,
|
||||||
const gchar *name)
|
const gchar *name)
|
||||||
{
|
{
|
||||||
return MM_PORT (g_object_new (MM_TYPE_PORT,
|
return MM_PORT (g_object_new (MM_TYPE_PORT,
|
||||||
MM_PORT_DEVICE, name,
|
MM_PORT_DEVICE, name,
|
||||||
MM_PORT_TYPE, MM_PORT_TYPE_IGNORED,
|
MM_PORT_GROUP, MM_PORT_GROUP_IGNORED,
|
||||||
|
MM_PORT_TYPE, ptype,
|
||||||
NULL));
|
NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,6 +345,7 @@ base_modem_create_wwan_port (MMBaseModem *self,
|
|||||||
return MM_PORT (g_object_new (MM_TYPE_PORT,
|
return MM_PORT (g_object_new (MM_TYPE_PORT,
|
||||||
MM_PORT_DEVICE, name,
|
MM_PORT_DEVICE, name,
|
||||||
MM_PORT_SUBSYS, MM_PORT_SUBSYS_WWAN,
|
MM_PORT_SUBSYS, MM_PORT_SUBSYS_WWAN,
|
||||||
|
MM_PORT_GROUP, MM_PORT_GROUP_USED,
|
||||||
MM_PORT_TYPE, MM_PORT_TYPE_XMMRPC,
|
MM_PORT_TYPE, MM_PORT_TYPE_XMMRPC,
|
||||||
NULL));
|
NULL));
|
||||||
|
|
||||||
@@ -343,6 +363,7 @@ static MMPort *
|
|||||||
base_modem_internal_grab_port (MMBaseModem *self,
|
base_modem_internal_grab_port (MMBaseModem *self,
|
||||||
MMKernelDevice *kernel_device,
|
MMKernelDevice *kernel_device,
|
||||||
gboolean link_port,
|
gboolean link_port,
|
||||||
|
MMPortGroup pgroup,
|
||||||
MMPortType ptype,
|
MMPortType ptype,
|
||||||
MMPortSerialAtFlag at_pflags,
|
MMPortSerialAtFlag at_pflags,
|
||||||
GError **error)
|
GError **error)
|
||||||
@@ -377,8 +398,8 @@ base_modem_internal_grab_port (MMBaseModem *self,
|
|||||||
|
|
||||||
/* Explicitly ignored ports, grab them but explicitly flag them as ignored
|
/* Explicitly ignored ports, grab them but explicitly flag them as ignored
|
||||||
* right away, all the same way (i.e. regardless of subsystem). */
|
* right away, all the same way (i.e. regardless of subsystem). */
|
||||||
if (ptype == MM_PORT_TYPE_IGNORED)
|
if (pgroup == MM_PORT_GROUP_IGNORED)
|
||||||
port = base_modem_create_ignored_port (self, name);
|
port = base_modem_create_ignored_port (self, ptype, name);
|
||||||
else if (g_str_equal (subsys, "net"))
|
else if (g_str_equal (subsys, "net"))
|
||||||
port = base_modem_create_net_port (self, name);
|
port = base_modem_create_net_port (self, name);
|
||||||
else if (g_str_equal (subsys, "tty"))
|
else if (g_str_equal (subsys, "tty"))
|
||||||
@@ -403,25 +424,38 @@ base_modem_internal_grab_port (MMBaseModem *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Setup consecutive ports and removal watchers in all control ports */
|
/* Setup consecutive ports and removal watchers in all control ports */
|
||||||
if (MM_IS_PORT_SERIAL_AT (port)) {
|
if (pgroup == MM_PORT_GROUP_USED) {
|
||||||
mm_obj_dbg (port, "port monitoring enabled in AT port");
|
if (MM_IS_PORT_SERIAL_AT (port)) {
|
||||||
port_monitoring = TRUE;
|
mm_obj_dbg (port, "port monitoring enabled in AT port");
|
||||||
} else if (MM_IS_PORT_SERIAL_QCDM (port)) {
|
port_monitoring = TRUE;
|
||||||
mm_obj_dbg (port, "port monitoring enabled in QCDM port");
|
} else if (MM_IS_PORT_SERIAL_QCDM (port)) {
|
||||||
port_monitoring = TRUE;
|
mm_obj_dbg (port, "port monitoring enabled in QCDM port");
|
||||||
}
|
port_monitoring = TRUE;
|
||||||
|
}
|
||||||
#if defined WITH_QMI
|
#if defined WITH_QMI
|
||||||
else if (MM_IS_PORT_QMI (port)) {
|
else if (MM_IS_PORT_QMI (port)) {
|
||||||
mm_obj_dbg (port, "port monitoring enabled in QMI port");
|
mm_obj_dbg (port, "port monitoring enabled in QMI port");
|
||||||
port_monitoring = TRUE;
|
port_monitoring = TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined WITH_MBIM
|
#if defined WITH_MBIM
|
||||||
else if (MM_IS_PORT_MBIM (port)) {
|
else if (MM_IS_PORT_MBIM (port)) {
|
||||||
mm_obj_dbg (port, "port monitoring enabled in MBIM port");
|
mm_obj_dbg (port, "port monitoring enabled in MBIM port");
|
||||||
port_monitoring = TRUE;
|
port_monitoring = TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check if a custom max timeouts value is set via udev */
|
||||||
|
if (mm_kernel_device_has_global_property (kernel_device, ID_MM_MAX_TIMEOUTS)) {
|
||||||
|
guint max_timeouts;
|
||||||
|
|
||||||
|
max_timeouts = mm_kernel_device_get_global_property_as_int (kernel_device, ID_MM_MAX_TIMEOUTS);
|
||||||
|
if (max_timeouts != self->priv->max_timeouts) {
|
||||||
|
mm_obj_dbg (self, "max timeouts overridden via udev: %u", max_timeouts);
|
||||||
|
self->priv->max_timeouts = max_timeouts;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (port_monitoring) {
|
if (port_monitoring) {
|
||||||
if (self->priv->max_timeouts > 0)
|
if (self->priv->max_timeouts > 0)
|
||||||
@@ -445,6 +479,7 @@ base_modem_internal_grab_port (MMBaseModem *self,
|
|||||||
if (MM_IS_PORT_SERIAL_AT (port)) {
|
if (MM_IS_PORT_SERIAL_AT (port)) {
|
||||||
mm_port_serial_at_set_response_parser (MM_PORT_SERIAL_AT (port),
|
mm_port_serial_at_set_response_parser (MM_PORT_SERIAL_AT (port),
|
||||||
mm_serial_parser_v1_parse,
|
mm_serial_parser_v1_parse,
|
||||||
|
mm_serial_parser_v1_remove_echo,
|
||||||
mm_serial_parser_v1_new (),
|
mm_serial_parser_v1_new (),
|
||||||
mm_serial_parser_v1_destroy);
|
mm_serial_parser_v1_destroy);
|
||||||
/* Prefer plugin-provided flags to the generic ones */
|
/* Prefer plugin-provided flags to the generic ones */
|
||||||
@@ -487,13 +522,14 @@ base_modem_internal_grab_port (MMBaseModem *self,
|
|||||||
gboolean
|
gboolean
|
||||||
mm_base_modem_grab_port (MMBaseModem *self,
|
mm_base_modem_grab_port (MMBaseModem *self,
|
||||||
MMKernelDevice *kernel_device,
|
MMKernelDevice *kernel_device,
|
||||||
|
MMPortGroup pgroup,
|
||||||
MMPortType ptype,
|
MMPortType ptype,
|
||||||
MMPortSerialAtFlag at_pflags,
|
MMPortSerialAtFlag at_pflags,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
g_autoptr(GError) inner_error = NULL;
|
g_autoptr(GError) inner_error = NULL;
|
||||||
|
|
||||||
if (!base_modem_internal_grab_port (self, kernel_device, FALSE, ptype, at_pflags, &inner_error)) {
|
if (!base_modem_internal_grab_port (self, kernel_device, FALSE, pgroup, ptype, at_pflags, &inner_error)) {
|
||||||
/* If the port was REQUIRED via udev tags and we failed to grab it, we will report
|
/* If the port was REQUIRED via udev tags and we failed to grab it, we will report
|
||||||
* a fatal error. */
|
* a fatal error. */
|
||||||
if (mm_kernel_device_get_property_as_boolean (kernel_device, ID_MM_REQUIRED)) {
|
if (mm_kernel_device_get_property_as_boolean (kernel_device, ID_MM_REQUIRED)) {
|
||||||
@@ -540,6 +576,7 @@ mm_base_modem_grab_link_port (MMBaseModem *self,
|
|||||||
port = base_modem_internal_grab_port (self,
|
port = base_modem_internal_grab_port (self,
|
||||||
kernel_device,
|
kernel_device,
|
||||||
TRUE,
|
TRUE,
|
||||||
|
MM_PORT_GROUP_USED,
|
||||||
MM_PORT_TYPE_NET,
|
MM_PORT_TYPE_NET,
|
||||||
MM_PORT_SERIAL_AT_FLAG_NONE,
|
MM_PORT_SERIAL_AT_FLAG_NONE,
|
||||||
error);
|
error);
|
||||||
@@ -728,6 +765,7 @@ typedef enum {
|
|||||||
STATE_OPERATION_TYPE_DISABLE,
|
STATE_OPERATION_TYPE_DISABLE,
|
||||||
#if defined WITH_SUSPEND_RESUME
|
#if defined WITH_SUSPEND_RESUME
|
||||||
STATE_OPERATION_TYPE_SYNC,
|
STATE_OPERATION_TYPE_SYNC,
|
||||||
|
STATE_OPERATION_TYPE_TERSE,
|
||||||
#endif
|
#endif
|
||||||
} StateOperationType;
|
} StateOperationType;
|
||||||
|
|
||||||
@@ -764,7 +802,7 @@ state_operation_ready (MMBaseModem *self,
|
|||||||
ctx = g_task_get_task_data (task);
|
ctx = g_task_get_task_data (task);
|
||||||
|
|
||||||
if (ctx->operation_id >= 0) {
|
if (ctx->operation_id >= 0) {
|
||||||
mm_base_modem_operation_unlock (self, ctx->operation_id);
|
mm_iface_op_lock_unlock (MM_IFACE_OP_LOCK (self), ctx->operation_id);
|
||||||
ctx->operation_id = (gssize) -1;
|
ctx->operation_id = (gssize) -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -811,12 +849,12 @@ lock_before_state_operation_ready (MMBaseModem *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
state_operation (MMBaseModem *self,
|
state_operation (MMBaseModem *self,
|
||||||
StateOperationType operation_type,
|
StateOperationType operation_type,
|
||||||
MMBaseModemOperationLock operation_lock,
|
MMOperationLock operation_lock,
|
||||||
MMBaseModemOperationPriority operation_priority,
|
MMOperationPriority operation_priority,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GTask *task;
|
GTask *task;
|
||||||
StateOperationContext *ctx;
|
StateOperationContext *ctx;
|
||||||
@@ -853,6 +891,12 @@ state_operation (MMBaseModem *self,
|
|||||||
ctx->operation = MM_BASE_MODEM_GET_CLASS (self)->sync;
|
ctx->operation = MM_BASE_MODEM_GET_CLASS (self)->sync;
|
||||||
ctx->operation_finish = MM_BASE_MODEM_GET_CLASS (self)->sync_finish;
|
ctx->operation_finish = MM_BASE_MODEM_GET_CLASS (self)->sync_finish;
|
||||||
break;
|
break;
|
||||||
|
case STATE_OPERATION_TYPE_TERSE:
|
||||||
|
operation_description = "terse";
|
||||||
|
optional = TRUE;
|
||||||
|
ctx->operation = MM_BASE_MODEM_GET_CLASS (self)->terse;
|
||||||
|
ctx->operation_finish = MM_BASE_MODEM_GET_CLASS (self)->terse_finish;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
@@ -868,12 +912,12 @@ state_operation (MMBaseModem *self,
|
|||||||
}
|
}
|
||||||
g_assert (ctx->operation && ctx->operation_finish);
|
g_assert (ctx->operation && ctx->operation_finish);
|
||||||
|
|
||||||
if (operation_lock == MM_BASE_MODEM_OPERATION_LOCK_ALREADY_ACQUIRED) {
|
if (operation_lock == MM_OPERATION_LOCK_ALREADY_ACQUIRED) {
|
||||||
state_operation_run (task);
|
state_operation_run (task);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_assert (operation_lock == MM_BASE_MODEM_OPERATION_LOCK_REQUIRED);
|
g_assert (operation_lock == MM_OPERATION_LOCK_REQUIRED);
|
||||||
mm_base_modem_operation_lock (self,
|
mm_base_modem_operation_lock (self,
|
||||||
operation_priority,
|
operation_priority,
|
||||||
operation_description,
|
operation_description,
|
||||||
@@ -895,14 +939,36 @@ mm_base_modem_sync_finish (MMBaseModem *self,
|
|||||||
|
|
||||||
void
|
void
|
||||||
mm_base_modem_sync (MMBaseModem *self,
|
mm_base_modem_sync (MMBaseModem *self,
|
||||||
MMBaseModemOperationLock operation_lock,
|
MMOperationLock operation_lock,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
state_operation (self,
|
state_operation (self,
|
||||||
STATE_OPERATION_TYPE_SYNC,
|
STATE_OPERATION_TYPE_SYNC,
|
||||||
operation_lock,
|
operation_lock,
|
||||||
MM_BASE_MODEM_OPERATION_PRIORITY_DEFAULT,
|
MM_OPERATION_PRIORITY_DEFAULT,
|
||||||
|
callback,
|
||||||
|
user_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
mm_base_modem_terse_finish (MMBaseModem *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
return state_operation_finish (self, res, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
mm_base_modem_terse (MMBaseModem *self,
|
||||||
|
MMOperationLock operation_lock,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
state_operation (self,
|
||||||
|
STATE_OPERATION_TYPE_TERSE,
|
||||||
|
operation_lock,
|
||||||
|
MM_OPERATION_PRIORITY_DEFAULT,
|
||||||
callback,
|
callback,
|
||||||
user_data);
|
user_data);
|
||||||
}
|
}
|
||||||
@@ -920,11 +986,11 @@ mm_base_modem_disable_finish (MMBaseModem *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mm_base_modem_disable (MMBaseModem *self,
|
mm_base_modem_disable (MMBaseModem *self,
|
||||||
MMBaseModemOperationLock operation_lock,
|
MMOperationLock operation_lock,
|
||||||
MMBaseModemOperationPriority operation_priority,
|
MMOperationPriority operation_priority,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
state_operation (self,
|
state_operation (self,
|
||||||
STATE_OPERATION_TYPE_DISABLE,
|
STATE_OPERATION_TYPE_DISABLE,
|
||||||
@@ -945,15 +1011,15 @@ mm_base_modem_enable_finish (MMBaseModem *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mm_base_modem_enable (MMBaseModem *self,
|
mm_base_modem_enable (MMBaseModem *self,
|
||||||
MMBaseModemOperationLock operation_lock,
|
MMOperationLock operation_lock,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
state_operation (self,
|
state_operation (self,
|
||||||
STATE_OPERATION_TYPE_ENABLE,
|
STATE_OPERATION_TYPE_ENABLE,
|
||||||
operation_lock,
|
operation_lock,
|
||||||
MM_BASE_MODEM_OPERATION_PRIORITY_DEFAULT,
|
MM_OPERATION_PRIORITY_DEFAULT,
|
||||||
callback,
|
callback,
|
||||||
user_data);
|
user_data);
|
||||||
}
|
}
|
||||||
@@ -969,15 +1035,15 @@ mm_base_modem_initialize_finish (MMBaseModem *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mm_base_modem_initialize (MMBaseModem *self,
|
mm_base_modem_initialize (MMBaseModem *self,
|
||||||
MMBaseModemOperationLock operation_lock,
|
MMOperationLock operation_lock,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
state_operation (self,
|
state_operation (self,
|
||||||
STATE_OPERATION_TYPE_INITIALIZE,
|
STATE_OPERATION_TYPE_INITIALIZE,
|
||||||
operation_lock,
|
operation_lock,
|
||||||
MM_BASE_MODEM_OPERATION_PRIORITY_DEFAULT,
|
MM_OPERATION_PRIORITY_DEFAULT,
|
||||||
callback,
|
callback,
|
||||||
user_data);
|
user_data);
|
||||||
}
|
}
|
||||||
@@ -1264,25 +1330,28 @@ port_info_cmp (const MMModemPortInfo *a,
|
|||||||
return g_strcmp0 (a->name, b->name);
|
return g_strcmp0 (a->name, b->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
MMModemPortInfo *
|
static MMModemPortInfo *
|
||||||
mm_base_modem_get_port_infos (MMBaseModem *self,
|
parse_port_infos (GHashTable *ports,
|
||||||
guint *n_port_infos)
|
guint *n_port_infos,
|
||||||
|
MMPortGroup pgroup_filter)
|
||||||
{
|
{
|
||||||
GHashTableIter iter;
|
GHashTableIter iter;
|
||||||
GArray *port_infos;
|
GArray *port_infos;
|
||||||
MMPort *port;
|
MMPort *port;
|
||||||
|
|
||||||
if (!self->priv->ports) {
|
if (!ports) {
|
||||||
*n_port_infos = 0;
|
*n_port_infos = 0;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
*n_port_infos = g_hash_table_size (self->priv->ports);
|
port_infos = g_array_new (FALSE, FALSE, sizeof (MMModemPortInfo));
|
||||||
port_infos = g_array_sized_new (FALSE, FALSE, sizeof (MMModemPortInfo), *n_port_infos);
|
g_hash_table_iter_init (&iter, ports);
|
||||||
g_hash_table_iter_init (&iter, self->priv->ports);
|
|
||||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer)&port)) {
|
while (g_hash_table_iter_next (&iter, NULL, (gpointer)&port)) {
|
||||||
MMModemPortInfo port_info;
|
MMModemPortInfo port_info;
|
||||||
|
|
||||||
|
if (mm_port_get_port_group (port) != pgroup_filter)
|
||||||
|
continue;
|
||||||
|
|
||||||
port_info.name = g_strdup (mm_port_get_device (port));
|
port_info.name = g_strdup (mm_port_get_device (port));
|
||||||
switch (mm_port_get_port_type (port)) {
|
switch (mm_port_get_port_type (port)) {
|
||||||
case MM_PORT_TYPE_NET:
|
case MM_PORT_TYPE_NET:
|
||||||
@@ -1321,11 +1390,25 @@ mm_base_modem_get_port_infos (MMBaseModem *self,
|
|||||||
g_array_append_val (port_infos, port_info);
|
g_array_append_val (port_infos, port_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_assert (*n_port_infos == port_infos->len);
|
*n_port_infos = port_infos->len;
|
||||||
g_array_sort (port_infos, (GCompareFunc) port_info_cmp);
|
g_array_sort (port_infos, (GCompareFunc) port_info_cmp);
|
||||||
return (MMModemPortInfo *) g_array_free (port_infos, FALSE);
|
return (MMModemPortInfo *) g_array_free (port_infos, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MMModemPortInfo *
|
||||||
|
mm_base_modem_get_port_infos (MMBaseModem *self,
|
||||||
|
guint *n_port_infos)
|
||||||
|
{
|
||||||
|
return parse_port_infos (self->priv->ports, n_port_infos, MM_PORT_GROUP_USED);
|
||||||
|
}
|
||||||
|
|
||||||
|
MMModemPortInfo *
|
||||||
|
mm_base_modem_get_ignored_port_infos (MMBaseModem *self,
|
||||||
|
guint *n_port_infos)
|
||||||
|
{
|
||||||
|
return parse_port_infos (self->priv->ports, n_port_infos, MM_PORT_GROUP_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
port_cmp (MMPort *a,
|
port_cmp (MMPort *a,
|
||||||
MMPort *b)
|
MMPort *b)
|
||||||
@@ -1467,6 +1550,10 @@ mm_base_modem_organize_ports (MMBaseModem *self,
|
|||||||
|
|
||||||
g_hash_table_iter_init (&iter, self->priv->ports);
|
g_hash_table_iter_init (&iter, self->priv->ports);
|
||||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &candidate)) {
|
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &candidate)) {
|
||||||
|
/* Skip ports that should not be used */
|
||||||
|
if (mm_port_get_port_group (candidate) != MM_PORT_GROUP_USED)
|
||||||
|
continue;
|
||||||
|
|
||||||
switch (mm_port_get_port_type (candidate)) {
|
switch (mm_port_get_port_type (candidate)) {
|
||||||
|
|
||||||
case MM_PORT_TYPE_AT:
|
case MM_PORT_TYPE_AT:
|
||||||
@@ -1744,8 +1831,8 @@ mm_base_modem_organize_ports (MMBaseModem *self,
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Authorization */
|
/* Authorization */
|
||||||
|
|
||||||
gboolean
|
static gboolean
|
||||||
mm_base_modem_authorize_finish (MMBaseModem *self,
|
mm_base_modem_authorize_finish (MMIfaceAuth *auth,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
@@ -1767,24 +1854,18 @@ authorize_ready (MMAuthProvider *authp,
|
|||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
mm_base_modem_authorize (MMBaseModem *self,
|
mm_base_modem_authorize (MMIfaceAuth *auth,
|
||||||
GDBusMethodInvocation *invocation,
|
GDBusMethodInvocation *invocation,
|
||||||
const gchar *authorization,
|
const gchar *authorization,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GTask *task;
|
MMBaseModem *self = MM_BASE_MODEM (auth);
|
||||||
|
GTask *task;
|
||||||
|
|
||||||
task = g_task_new (self, self->priv->authp_cancellable, callback, user_data);
|
task = g_task_new (self, self->priv->authp_cancellable, callback, user_data);
|
||||||
|
|
||||||
/* When running in the session bus for tests, default to always allow */
|
|
||||||
if (mm_context_get_test_session ()) {
|
|
||||||
g_task_return_boolean (task, TRUE);
|
|
||||||
g_object_unref (task);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mm_auth_provider_authorize (self->priv->authp,
|
mm_auth_provider_authorize (self->priv->authp,
|
||||||
invocation,
|
invocation,
|
||||||
authorization,
|
authorization,
|
||||||
@@ -1797,10 +1878,10 @@ mm_base_modem_authorize (MMBaseModem *self,
|
|||||||
/* Exclusive operation */
|
/* Exclusive operation */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
gssize id;
|
gssize id;
|
||||||
MMBaseModemOperationPriority priority;
|
MMOperationPriority priority;
|
||||||
gchar *description;
|
gchar *description;
|
||||||
GTask *wait_task;
|
GTask *wait_task;
|
||||||
} OperationInfo;
|
} OperationInfo;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1813,7 +1894,7 @@ operation_info_free (OperationInfo *info)
|
|||||||
|
|
||||||
/* Exclusive operation lock */
|
/* Exclusive operation lock */
|
||||||
|
|
||||||
gssize
|
static gssize
|
||||||
mm_base_modem_operation_lock_finish (MMBaseModem *self,
|
mm_base_modem_operation_lock_finish (MMBaseModem *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
@@ -1838,7 +1919,7 @@ base_modem_operation_run (MMBaseModem *self)
|
|||||||
/* Run the operation in head of the list */
|
/* Run the operation in head of the list */
|
||||||
mm_obj_dbg (self, "[operation %" G_GSSIZE_FORMAT "] %s - %s: lock acquired",
|
mm_obj_dbg (self, "[operation %" G_GSSIZE_FORMAT "] %s - %s: lock acquired",
|
||||||
info->id,
|
info->id,
|
||||||
mm_base_modem_operation_priority_get_string (info->priority),
|
mm_operation_priority_get_string (info->priority),
|
||||||
info->description);
|
info->description);
|
||||||
task = g_steal_pointer (&info->wait_task);
|
task = g_steal_pointer (&info->wait_task);
|
||||||
g_task_return_int (task, info->id);
|
g_task_return_int (task, info->id);
|
||||||
@@ -1881,7 +1962,7 @@ abort_pending_operations (MMBaseModem *self)
|
|||||||
g_assert (info->wait_task);
|
g_assert (info->wait_task);
|
||||||
mm_obj_dbg (self, "[operation %" G_GSSIZE_FORMAT "] %s - %s: aborted early",
|
mm_obj_dbg (self, "[operation %" G_GSSIZE_FORMAT "] %s - %s: aborted early",
|
||||||
info->id,
|
info->id,
|
||||||
mm_base_modem_operation_priority_get_string (info->priority),
|
mm_operation_priority_get_string (info->priority),
|
||||||
info->description);
|
info->description);
|
||||||
|
|
||||||
task = g_steal_pointer (&info->wait_task);
|
task = g_steal_pointer (&info->wait_task);
|
||||||
@@ -1894,12 +1975,12 @@ abort_pending_operations (MMBaseModem *self)
|
|||||||
self->priv->scheduled_operations = head;
|
self->priv->scheduled_operations = head;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
mm_base_modem_operation_lock (MMBaseModem *self,
|
mm_base_modem_operation_lock (MMBaseModem *self,
|
||||||
MMBaseModemOperationPriority priority,
|
MMOperationPriority priority,
|
||||||
const gchar *description,
|
const gchar *description,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GTask *task;
|
GTask *task;
|
||||||
OperationInfo *info;
|
OperationInfo *info;
|
||||||
@@ -1926,19 +2007,19 @@ mm_base_modem_operation_lock (MMBaseModem *self,
|
|||||||
} else
|
} else
|
||||||
operation_id++;
|
operation_id++;
|
||||||
|
|
||||||
if (info->priority == MM_BASE_MODEM_OPERATION_PRIORITY_OVERRIDE) {
|
if (info->priority == MM_OPERATION_PRIORITY_OVERRIDE) {
|
||||||
mm_obj_dbg (self, "[operation %" G_GSSIZE_FORMAT "] %s - %s: override requested - no new operations will be allowed",
|
mm_obj_dbg (self, "[operation %" G_GSSIZE_FORMAT "] %s - %s: override requested - no new operations will be allowed",
|
||||||
info->id,
|
info->id,
|
||||||
mm_base_modem_operation_priority_get_string (info->priority),
|
mm_operation_priority_get_string (info->priority),
|
||||||
info->description);
|
info->description);
|
||||||
g_assert (!self->priv->scheduled_operations_forbidden_forever);
|
g_assert (!self->priv->scheduled_operations_forbidden_forever);
|
||||||
self->priv->scheduled_operations_forbidden_forever = TRUE;
|
self->priv->scheduled_operations_forbidden_forever = TRUE;
|
||||||
abort_pending_operations (self);
|
abort_pending_operations (self);
|
||||||
self->priv->scheduled_operations = g_list_append (self->priv->scheduled_operations, info);
|
self->priv->scheduled_operations = g_list_append (self->priv->scheduled_operations, info);
|
||||||
} else if (info->priority == MM_BASE_MODEM_OPERATION_PRIORITY_DEFAULT) {
|
} else if (info->priority == MM_OPERATION_PRIORITY_DEFAULT) {
|
||||||
mm_obj_dbg (self, "[operation %" G_GSSIZE_FORMAT "] %s - %s: scheduled",
|
mm_obj_dbg (self, "[operation %" G_GSSIZE_FORMAT "] %s - %s: scheduled",
|
||||||
info->id,
|
info->id,
|
||||||
mm_base_modem_operation_priority_get_string (info->priority),
|
mm_operation_priority_get_string (info->priority),
|
||||||
info->description);
|
info->description);
|
||||||
self->priv->scheduled_operations = g_list_append (self->priv->scheduled_operations, info);
|
self->priv->scheduled_operations = g_list_append (self->priv->scheduled_operations, info);
|
||||||
} else
|
} else
|
||||||
@@ -1949,10 +2030,11 @@ mm_base_modem_operation_lock (MMBaseModem *self,
|
|||||||
|
|
||||||
/* Exclusive operation unlock */
|
/* Exclusive operation unlock */
|
||||||
|
|
||||||
void
|
static void
|
||||||
mm_base_modem_operation_unlock (MMBaseModem *self,
|
mm_base_modem_operation_unlock (MMIfaceOpLock *_self,
|
||||||
gssize operation_id)
|
gssize operation_id)
|
||||||
{
|
{
|
||||||
|
MMBaseModem *self = MM_BASE_MODEM (_self);
|
||||||
OperationInfo *info;
|
OperationInfo *info;
|
||||||
|
|
||||||
g_assert (self->priv->scheduled_operations);
|
g_assert (self->priv->scheduled_operations);
|
||||||
@@ -1963,7 +2045,7 @@ mm_base_modem_operation_unlock (MMBaseModem *self,
|
|||||||
|
|
||||||
mm_obj_dbg (self, "[operation %" G_GSSIZE_FORMAT "] %s - %s: lock released",
|
mm_obj_dbg (self, "[operation %" G_GSSIZE_FORMAT "] %s - %s: lock released",
|
||||||
info->id,
|
info->id,
|
||||||
mm_base_modem_operation_priority_get_string (info->priority),
|
mm_operation_priority_get_string (info->priority),
|
||||||
info->description);
|
info->description);
|
||||||
|
|
||||||
/* Remove head list item and free its contents */
|
/* Remove head list item and free its contents */
|
||||||
@@ -1978,9 +2060,9 @@ mm_base_modem_operation_unlock (MMBaseModem *self,
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GDBusMethodInvocation *invocation;
|
GDBusMethodInvocation *invocation;
|
||||||
MMBaseModemOperationPriority operation_priority;
|
MMOperationPriority operation_priority;
|
||||||
gchar *operation_description;
|
gchar *operation_description;
|
||||||
} AuthorizeAndOperationLockContext;
|
} AuthorizeAndOperationLockContext;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1991,8 +2073,8 @@ authorize_and_operation_lock_context_free (AuthorizeAndOperationLockContext *ctx
|
|||||||
g_slice_free (AuthorizeAndOperationLockContext, ctx);
|
g_slice_free (AuthorizeAndOperationLockContext, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
gssize
|
static gssize
|
||||||
mm_base_modem_authorize_and_operation_lock_finish (MMBaseModem *self,
|
mm_base_modem_authorize_and_operation_lock_finish (MMIfaceOpLock *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
@@ -2016,35 +2098,35 @@ lock_after_authorize_ready (MMBaseModem *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
authorize_before_lock_ready (MMBaseModem *self,
|
authorize_before_lock_ready (MMIfaceAuth *auth,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GTask *task)
|
GTask *task)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
AuthorizeAndOperationLockContext *ctx;
|
AuthorizeAndOperationLockContext *ctx;
|
||||||
|
|
||||||
if (!mm_base_modem_authorize_finish (self, res, &error)) {
|
if (!mm_iface_auth_authorize_finish (auth, res, &error)) {
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = g_task_get_task_data (task);
|
ctx = g_task_get_task_data (task);
|
||||||
mm_base_modem_operation_lock (self,
|
mm_base_modem_operation_lock (MM_BASE_MODEM (auth),
|
||||||
ctx->operation_priority,
|
ctx->operation_priority,
|
||||||
ctx->operation_description,
|
ctx->operation_description,
|
||||||
(GAsyncReadyCallback) lock_after_authorize_ready,
|
(GAsyncReadyCallback) lock_after_authorize_ready,
|
||||||
task);
|
task);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
mm_base_modem_authorize_and_operation_lock (MMBaseModem *self,
|
mm_base_modem_authorize_and_operation_lock (MMIfaceOpLock *self,
|
||||||
GDBusMethodInvocation *invocation,
|
GDBusMethodInvocation *invocation,
|
||||||
const gchar *authorization,
|
const gchar *authorization,
|
||||||
MMBaseModemOperationPriority operation_priority,
|
MMOperationPriority operation_priority,
|
||||||
const gchar *operation_description,
|
const gchar *operation_description,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GTask *task;
|
GTask *task;
|
||||||
AuthorizeAndOperationLockContext *ctx;
|
AuthorizeAndOperationLockContext *ctx;
|
||||||
@@ -2057,7 +2139,7 @@ mm_base_modem_authorize_and_operation_lock (MMBaseModem *self,
|
|||||||
ctx->operation_description = g_strdup (operation_description);
|
ctx->operation_description = g_strdup (operation_description);
|
||||||
g_task_set_task_data (task, ctx, (GDestroyNotify)authorize_and_operation_lock_context_free);
|
g_task_set_task_data (task, ctx, (GDestroyNotify)authorize_and_operation_lock_context_free);
|
||||||
|
|
||||||
mm_base_modem_authorize (self,
|
mm_iface_auth_authorize (MM_IFACE_AUTH (self),
|
||||||
invocation,
|
invocation,
|
||||||
authorization,
|
authorization,
|
||||||
(GAsyncReadyCallback)authorize_before_lock_ready,
|
(GAsyncReadyCallback)authorize_before_lock_ready,
|
||||||
@@ -2132,13 +2214,22 @@ mm_base_modem_get_subsystem_device_id (MMBaseModem *self)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
clear_invalid_from_idle (MMBaseModem *self)
|
||||||
|
{
|
||||||
|
if (self->priv->invalid_from_idle)
|
||||||
|
g_source_remove (self->priv->invalid_from_idle);
|
||||||
|
self->priv->invalid_from_idle = 0;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
base_modem_invalid_idle (MMBaseModem *self)
|
base_modem_invalid_idle (MMBaseModem *self)
|
||||||
{
|
{
|
||||||
|
clear_invalid_from_idle (self);
|
||||||
|
|
||||||
/* Ensure the modem is set invalid if we get the modem-wide cancellable
|
/* Ensure the modem is set invalid if we get the modem-wide cancellable
|
||||||
* cancelled */
|
* cancelled */
|
||||||
mm_base_modem_set_valid (self, FALSE);
|
mm_base_modem_set_valid (self, FALSE);
|
||||||
g_object_unref (self);
|
|
||||||
return G_SOURCE_REMOVE;
|
return G_SOURCE_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2146,9 +2237,14 @@ static void
|
|||||||
base_modem_cancelled (GCancellable *cancellable,
|
base_modem_cancelled (GCancellable *cancellable,
|
||||||
MMBaseModem *self)
|
MMBaseModem *self)
|
||||||
{
|
{
|
||||||
|
clear_invalid_from_idle (self);
|
||||||
|
|
||||||
/* NOTE: Don't call set_valid() directly here, do it in an idle, and ensure
|
/* NOTE: Don't call set_valid() directly here, do it in an idle, and ensure
|
||||||
* that we pass a valid reference of the modem object as context. */
|
* that we pass a valid reference of the modem object as context. */
|
||||||
g_idle_add ((GSourceFunc)base_modem_invalid_idle, g_object_ref (self));
|
self->priv->invalid_from_idle = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
|
||||||
|
(GSourceFunc)base_modem_invalid_idle,
|
||||||
|
g_object_ref (self),
|
||||||
|
(GDestroyNotify) g_object_unref);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -2160,9 +2256,107 @@ setup_ports_table (GHashTable **ht)
|
|||||||
*ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
|
*ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
volatile gint refcount;
|
||||||
|
GError *error;
|
||||||
|
/* The Context owns the GTask so that we can ensure the Task returns only
|
||||||
|
* when all ports are closed. The reference count tracks open ports and
|
||||||
|
* the context will return the Task when it reaches zero (indicating all
|
||||||
|
* outstanding operations are complete and ports are closed).
|
||||||
|
*/
|
||||||
|
GTask *task;
|
||||||
|
} TeardownContext;
|
||||||
|
|
||||||
|
static TeardownContext *
|
||||||
|
teardown_context_new (GObject *source_object,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
TeardownContext *ctx;
|
||||||
|
|
||||||
|
ctx = g_slice_new0 (TeardownContext);
|
||||||
|
ctx->refcount = 1;
|
||||||
|
ctx->task = g_task_new (source_object, NULL, callback, user_data);
|
||||||
|
return ctx;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cleanup_modem_port (MMBaseModem *self,
|
teardown_context_ref (TeardownContext *ctx)
|
||||||
MMPort *port)
|
{
|
||||||
|
g_atomic_int_inc (&ctx->refcount);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
teardown_context_unref (TeardownContext *ctx)
|
||||||
|
{
|
||||||
|
if (g_atomic_int_dec_and_test (&ctx->refcount)) {
|
||||||
|
if (ctx->error)
|
||||||
|
g_task_return_error (ctx->task, g_steal_pointer (&ctx->error));
|
||||||
|
else
|
||||||
|
g_task_return_boolean (ctx->task, TRUE);
|
||||||
|
g_clear_object (&ctx->task);
|
||||||
|
g_slice_free (TeardownContext, ctx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined (WITH_MBIM) || defined (WITH_QMI)
|
||||||
|
|
||||||
|
static void
|
||||||
|
teardown_context_add_error (TeardownContext *ctx,
|
||||||
|
MMPort *port,
|
||||||
|
GError *error)
|
||||||
|
{
|
||||||
|
if (!ctx->error) {
|
||||||
|
ctx->error = g_error_copy (error);
|
||||||
|
g_prefix_error (&ctx->error,
|
||||||
|
"[%s] teardown error: ",
|
||||||
|
mm_port_get_device (port));
|
||||||
|
} else {
|
||||||
|
g_prefix_error (&ctx->error,
|
||||||
|
"[%s] teardown error: %s; ",
|
||||||
|
mm_port_get_device (port),
|
||||||
|
error->message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined WITH_MBIM
|
||||||
|
|
||||||
|
static void
|
||||||
|
mbim_port_close_ready (MMPortMbim *port,
|
||||||
|
GAsyncResult *res,
|
||||||
|
TeardownContext *ctx)
|
||||||
|
{
|
||||||
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
|
if (!mm_port_mbim_close_finish (port, res, &error))
|
||||||
|
teardown_context_add_error (ctx, MM_PORT (port), error);
|
||||||
|
teardown_context_unref (ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined WITH_QMI
|
||||||
|
|
||||||
|
static void
|
||||||
|
qmi_port_close_ready (MMPortQmi *port,
|
||||||
|
GAsyncResult *res,
|
||||||
|
TeardownContext *ctx)
|
||||||
|
{
|
||||||
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
|
if (!mm_port_qmi_close_finish (port, res, &error))
|
||||||
|
teardown_context_add_error (ctx, MM_PORT (port), error);
|
||||||
|
teardown_context_unref (ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
cleanup_modem_port (MMBaseModem *self,
|
||||||
|
MMPort *port,
|
||||||
|
TeardownContext *ctx)
|
||||||
{
|
{
|
||||||
mm_obj_dbg (self, "cleaning up port '%s/%s'...",
|
mm_obj_dbg (self, "cleaning up port '%s/%s'...",
|
||||||
mm_port_subsys_get_string (mm_port_get_subsys (MM_PORT (port))),
|
mm_port_subsys_get_string (mm_port_get_subsys (MM_PORT (port))),
|
||||||
@@ -2172,10 +2366,20 @@ cleanup_modem_port (MMBaseModem *self,
|
|||||||
g_signal_handlers_disconnect_by_func (port, port_timed_out_cb, self);
|
g_signal_handlers_disconnect_by_func (port, port_timed_out_cb, self);
|
||||||
g_signal_handlers_disconnect_by_func (port, port_removed_cb, self);
|
g_signal_handlers_disconnect_by_func (port, port_removed_cb, self);
|
||||||
|
|
||||||
|
if (ctx)
|
||||||
|
teardown_context_ref (ctx);
|
||||||
|
|
||||||
|
/* No need to close serial ports here as they do not require a specific
|
||||||
|
* shutdown procedure with message exchanges and callbacks. They will be
|
||||||
|
* closed when the modem is invalidated or disposed.
|
||||||
|
*/
|
||||||
|
|
||||||
#if defined WITH_MBIM
|
#if defined WITH_MBIM
|
||||||
/* We need to close the MBIM port cleanly when disposing the modem object */
|
/* We need to close the MBIM port cleanly when disposing the modem object */
|
||||||
if (MM_IS_PORT_MBIM (port)) {
|
if (MM_IS_PORT_MBIM (port)) {
|
||||||
mm_port_mbim_close (MM_PORT_MBIM (port), NULL, NULL);
|
mm_port_mbim_close (MM_PORT_MBIM (port),
|
||||||
|
ctx ? (GAsyncReadyCallback)mbim_port_close_ready : NULL,
|
||||||
|
ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -2186,27 +2390,61 @@ cleanup_modem_port (MMBaseModem *self,
|
|||||||
* allocating too many newer allocations will fail with client-ids-exhausted
|
* allocating too many newer allocations will fail with client-ids-exhausted
|
||||||
* errors. */
|
* errors. */
|
||||||
if (MM_IS_PORT_QMI (port)) {
|
if (MM_IS_PORT_QMI (port)) {
|
||||||
mm_port_qmi_close (MM_PORT_QMI (port), NULL, NULL);
|
mm_port_qmi_close (MM_PORT_QMI (port),
|
||||||
|
ctx ? (GAsyncReadyCallback)qmi_port_close_ready : NULL,
|
||||||
|
ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (ctx)
|
||||||
|
teardown_context_unref (ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
teardown_ports_table (MMBaseModem *self,
|
teardown_ports_tables (MMBaseModem *self,
|
||||||
GHashTable **ht)
|
TeardownContext *ctx)
|
||||||
{
|
{
|
||||||
|
GHashTable **tables[2] = {
|
||||||
|
&self->priv->link_ports,
|
||||||
|
&self->priv->ports,
|
||||||
|
};
|
||||||
GHashTableIter iter;
|
GHashTableIter iter;
|
||||||
gpointer value;
|
gpointer value;
|
||||||
gpointer key;
|
gpointer key;
|
||||||
|
guint i;
|
||||||
|
|
||||||
if (!*ht)
|
for (i = 0; i < G_N_ELEMENTS (tables); i++) {
|
||||||
return;
|
if (*tables[i]) {
|
||||||
|
g_hash_table_iter_init (&iter, *tables[i]);
|
||||||
|
while (g_hash_table_iter_next (&iter, &key, &value))
|
||||||
|
cleanup_modem_port (self, MM_PORT (value), ctx);
|
||||||
|
g_hash_table_destroy (*tables[i]);
|
||||||
|
*tables[i] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_hash_table_iter_init (&iter, *ht);
|
gboolean
|
||||||
while (g_hash_table_iter_next (&iter, &key, &value))
|
mm_base_modem_teardown_ports_finish (MMBaseModem *self,
|
||||||
cleanup_modem_port (self, MM_PORT (value));
|
GAsyncResult *res,
|
||||||
g_hash_table_destroy (g_steal_pointer (ht));
|
GError **error)
|
||||||
|
{
|
||||||
|
return g_task_propagate_boolean (G_TASK (res), error);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
mm_base_modem_teardown_ports (MMBaseModem *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
TeardownContext *ctx;
|
||||||
|
|
||||||
|
self->priv->torn_down = TRUE;
|
||||||
|
|
||||||
|
ctx = teardown_context_new (G_OBJECT (self), callback, user_data);
|
||||||
|
teardown_ports_tables (self, ctx);
|
||||||
|
teardown_context_unref (ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -2412,6 +2650,8 @@ dispose (GObject *object)
|
|||||||
g_cancellable_cancel (self->priv->cancellable);
|
g_cancellable_cancel (self->priv->cancellable);
|
||||||
g_clear_object (&self->priv->cancellable);
|
g_clear_object (&self->priv->cancellable);
|
||||||
|
|
||||||
|
clear_invalid_from_idle (self);
|
||||||
|
|
||||||
g_clear_object (&self->priv->primary);
|
g_clear_object (&self->priv->primary);
|
||||||
g_clear_object (&self->priv->secondary);
|
g_clear_object (&self->priv->secondary);
|
||||||
g_list_free_full (g_steal_pointer (&self->priv->data), g_object_unref);
|
g_list_free_full (g_steal_pointer (&self->priv->data), g_object_unref);
|
||||||
@@ -2426,8 +2666,9 @@ dispose (GObject *object)
|
|||||||
g_list_free_full (g_steal_pointer (&self->priv->mbim), g_object_unref);
|
g_list_free_full (g_steal_pointer (&self->priv->mbim), g_object_unref);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
teardown_ports_table (self, &self->priv->link_ports);
|
if (!self->priv->torn_down)
|
||||||
teardown_ports_table (self, &self->priv->ports);
|
mm_obj_warn (self, "teardown not called before dispose");
|
||||||
|
teardown_ports_tables (self, NULL);
|
||||||
|
|
||||||
g_clear_object (&self->priv->connection);
|
g_clear_object (&self->priv->connection);
|
||||||
|
|
||||||
@@ -2440,6 +2681,21 @@ log_object_iface_init (MMLogObjectInterface *iface)
|
|||||||
iface->build_id = log_object_build_id;
|
iface->build_id = log_object_build_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
auth_iface_init (MMIfaceAuthInterface *iface)
|
||||||
|
{
|
||||||
|
iface->authorize = mm_base_modem_authorize;
|
||||||
|
iface->authorize_finish = mm_base_modem_authorize_finish;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
op_lock_iface_init (MMIfaceOpLockInterface *iface)
|
||||||
|
{
|
||||||
|
iface->authorize_and_lock = mm_base_modem_authorize_and_operation_lock;
|
||||||
|
iface->authorize_and_lock_finish = mm_base_modem_authorize_and_operation_lock_finish;
|
||||||
|
iface->unlock = mm_base_modem_operation_unlock;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mm_base_modem_class_init (MMBaseModemClass *klass)
|
mm_base_modem_class_init (MMBaseModemClass *klass)
|
||||||
{
|
{
|
||||||
@@ -2538,7 +2794,7 @@ mm_base_modem_class_init (MMBaseModemClass *klass)
|
|||||||
g_object_class_install_property (object_class, PROP_SUBSYSTEM_DEVICE_ID, properties[PROP_SUBSYSTEM_DEVICE_ID]);
|
g_object_class_install_property (object_class, PROP_SUBSYSTEM_DEVICE_ID, properties[PROP_SUBSYSTEM_DEVICE_ID]);
|
||||||
|
|
||||||
properties[PROP_CONNECTION] =
|
properties[PROP_CONNECTION] =
|
||||||
g_param_spec_object (MM_BASE_MODEM_CONNECTION,
|
g_param_spec_object (MM_BINDABLE_CONNECTION,
|
||||||
"Connection",
|
"Connection",
|
||||||
"GDBus connection to the system bus.",
|
"GDBus connection to the system bus.",
|
||||||
G_TYPE_DBUS_CONNECTION,
|
G_TYPE_DBUS_CONNECTION,
|
||||||
|
|||||||
+52
-79
@@ -36,6 +36,7 @@
|
|||||||
#include "mm-port-serial-qcdm.h"
|
#include "mm-port-serial-qcdm.h"
|
||||||
#include "mm-port-serial-gps.h"
|
#include "mm-port-serial-gps.h"
|
||||||
#include "mm-iface-port-at.h"
|
#include "mm-iface-port-at.h"
|
||||||
|
#include "mm-iface-op-lock.h"
|
||||||
|
|
||||||
#if defined WITH_QMI
|
#if defined WITH_QMI
|
||||||
#include "mm-port-qmi.h"
|
#include "mm-port-qmi.h"
|
||||||
@@ -56,7 +57,6 @@ typedef struct _MMBaseModem MMBaseModem;
|
|||||||
typedef struct _MMBaseModemClass MMBaseModemClass;
|
typedef struct _MMBaseModemClass MMBaseModemClass;
|
||||||
typedef struct _MMBaseModemPrivate MMBaseModemPrivate;
|
typedef struct _MMBaseModemPrivate MMBaseModemPrivate;
|
||||||
|
|
||||||
#define MM_BASE_MODEM_CONNECTION "base-modem-connection"
|
|
||||||
#define MM_BASE_MODEM_MAX_TIMEOUTS "base-modem-max-timeouts"
|
#define MM_BASE_MODEM_MAX_TIMEOUTS "base-modem-max-timeouts"
|
||||||
#define MM_BASE_MODEM_VALID "base-modem-valid"
|
#define MM_BASE_MODEM_VALID "base-modem-valid"
|
||||||
#define MM_BASE_MODEM_DEVICE "base-modem-device"
|
#define MM_BASE_MODEM_DEVICE "base-modem-device"
|
||||||
@@ -109,6 +109,15 @@ struct _MMBaseModemClass {
|
|||||||
* this method triggers a synchronization of all modem interfaces */
|
* this method triggers a synchronization of all modem interfaces */
|
||||||
StateOperation sync;
|
StateOperation sync;
|
||||||
StateOperationFinish sync_finish;
|
StateOperationFinish sync_finish;
|
||||||
|
|
||||||
|
/* Modem terse.
|
||||||
|
* When suspending in quick suspend/resume mode,
|
||||||
|
* this method disables unsolicited events on the 3GPP interface only.
|
||||||
|
* This is enough for phones to suspend properly, but it
|
||||||
|
* might be useful to extend it to all other interfaces
|
||||||
|
* that support it as well */
|
||||||
|
StateOperation terse;
|
||||||
|
StateOperationFinish terse_finish;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Allow plugins to subclass port object creation as needed */
|
/* Allow plugins to subclass port object creation as needed */
|
||||||
@@ -137,6 +146,7 @@ guint mm_base_modem_get_dbus_id (MMBaseModem *self);
|
|||||||
|
|
||||||
gboolean mm_base_modem_grab_port (MMBaseModem *self,
|
gboolean mm_base_modem_grab_port (MMBaseModem *self,
|
||||||
MMKernelDevice *kernel_device,
|
MMKernelDevice *kernel_device,
|
||||||
|
MMPortGroup pgroup,
|
||||||
MMPortType ptype,
|
MMPortType ptype,
|
||||||
MMPortSerialAtFlag at_pflags,
|
MMPortSerialAtFlag at_pflags,
|
||||||
GError **error);
|
GError **error);
|
||||||
@@ -183,6 +193,8 @@ GList *mm_base_modem_get_data_ports (MMBaseModem *self);
|
|||||||
|
|
||||||
MMModemPortInfo *mm_base_modem_get_port_infos (MMBaseModem *self,
|
MMModemPortInfo *mm_base_modem_get_port_infos (MMBaseModem *self,
|
||||||
guint *n_port_infos);
|
guint *n_port_infos);
|
||||||
|
MMModemPortInfo *mm_base_modem_get_ignored_port_infos (MMBaseModem *self,
|
||||||
|
guint *n_port_infos);
|
||||||
|
|
||||||
GList *mm_base_modem_find_ports (MMBaseModem *self,
|
GList *mm_base_modem_find_ports (MMBaseModem *self,
|
||||||
MMPortSubsys subsys,
|
MMPortSubsys subsys,
|
||||||
@@ -216,95 +228,56 @@ guint mm_base_modem_get_subsystem_device_id (MMBaseModem *self);
|
|||||||
|
|
||||||
GCancellable *mm_base_modem_peek_cancellable (MMBaseModem *self);
|
GCancellable *mm_base_modem_peek_cancellable (MMBaseModem *self);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
/* Polkit */
|
|
||||||
|
|
||||||
void mm_base_modem_authorize (MMBaseModem *self,
|
|
||||||
GDBusMethodInvocation *invocation,
|
|
||||||
const gchar *authorization,
|
|
||||||
GAsyncReadyCallback callback,
|
|
||||||
gpointer user_data);
|
|
||||||
gboolean mm_base_modem_authorize_finish (MMBaseModem *self,
|
|
||||||
GAsyncResult *res,
|
|
||||||
GError **error);
|
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
/* Operation lock support */
|
|
||||||
|
|
||||||
typedef enum { /*< underscore_name=mm_base_modem_operation_priority >*/
|
|
||||||
MM_BASE_MODEM_OPERATION_PRIORITY_UNKNOWN,
|
|
||||||
/* Default operations are scheduled at the end of the list of pending
|
|
||||||
* operations */
|
|
||||||
MM_BASE_MODEM_OPERATION_PRIORITY_DEFAULT,
|
|
||||||
/* An override operation will make all pending operations be cancelled, and
|
|
||||||
* it will also disallow adding new operations. This type of operation would
|
|
||||||
* be the last one expected in a modem object. */
|
|
||||||
MM_BASE_MODEM_OPERATION_PRIORITY_OVERRIDE,
|
|
||||||
} MMBaseModemOperationPriority;
|
|
||||||
|
|
||||||
void mm_base_modem_operation_lock (MMBaseModem *self,
|
|
||||||
MMBaseModemOperationPriority priority,
|
|
||||||
const gchar *description,
|
|
||||||
GAsyncReadyCallback callback,
|
|
||||||
gpointer user_data);
|
|
||||||
gssize mm_base_modem_operation_lock_finish (MMBaseModem *self,
|
|
||||||
GAsyncResult *res,
|
|
||||||
GError **error);
|
|
||||||
void mm_base_modem_operation_unlock (MMBaseModem *self,
|
|
||||||
gssize operation_id);
|
|
||||||
|
|
||||||
void mm_base_modem_authorize_and_operation_lock (MMBaseModem *self,
|
|
||||||
GDBusMethodInvocation *invocation,
|
|
||||||
const gchar *authorization,
|
|
||||||
MMBaseModemOperationPriority operation_priority,
|
|
||||||
const gchar *operation_description,
|
|
||||||
GAsyncReadyCallback callback,
|
|
||||||
gpointer user_data);
|
|
||||||
gssize mm_base_modem_authorize_and_operation_lock_finish (MMBaseModem *self,
|
|
||||||
GAsyncResult *res,
|
|
||||||
GError **error);
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* State operations */
|
/* State operations */
|
||||||
|
|
||||||
typedef enum {
|
void mm_base_modem_initialize (MMBaseModem *self,
|
||||||
MM_BASE_MODEM_OPERATION_LOCK_REQUIRED,
|
MMOperationLock operation_lock,
|
||||||
MM_BASE_MODEM_OPERATION_LOCK_ALREADY_ACQUIRED,
|
GAsyncReadyCallback callback,
|
||||||
} MMBaseModemOperationLock;
|
gpointer user_data);
|
||||||
|
gboolean mm_base_modem_initialize_finish (MMBaseModem *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
void mm_base_modem_initialize (MMBaseModem *self,
|
void mm_base_modem_enable (MMBaseModem *self,
|
||||||
MMBaseModemOperationLock operation_lock,
|
MMOperationLock operation_lock,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
gboolean mm_base_modem_initialize_finish (MMBaseModem *self,
|
gboolean mm_base_modem_enable_finish (MMBaseModem *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
void mm_base_modem_enable (MMBaseModem *self,
|
void mm_base_modem_disable (MMBaseModem *self,
|
||||||
MMBaseModemOperationLock operation_lock,
|
MMOperationLock operation_lock,
|
||||||
GAsyncReadyCallback callback,
|
MMOperationPriority priority,
|
||||||
gpointer user_data);
|
GAsyncReadyCallback callback,
|
||||||
gboolean mm_base_modem_enable_finish (MMBaseModem *self,
|
gpointer user_data);
|
||||||
GAsyncResult *res,
|
gboolean mm_base_modem_disable_finish (MMBaseModem *self,
|
||||||
GError **error);
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
void mm_base_modem_disable (MMBaseModem *self,
|
|
||||||
MMBaseModemOperationLock operation_lock,
|
|
||||||
MMBaseModemOperationPriority priority,
|
|
||||||
GAsyncReadyCallback callback,
|
|
||||||
gpointer user_data);
|
|
||||||
gboolean mm_base_modem_disable_finish (MMBaseModem *self,
|
|
||||||
GAsyncResult *res,
|
|
||||||
GError **error);
|
|
||||||
|
|
||||||
#if defined WITH_SUSPEND_RESUME
|
#if defined WITH_SUSPEND_RESUME
|
||||||
void mm_base_modem_sync (MMBaseModem *self,
|
void mm_base_modem_sync (MMBaseModem *self,
|
||||||
MMBaseModemOperationLock operation_lock,
|
MMOperationLock operation_lock,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean mm_base_modem_sync_finish (MMBaseModem *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
void mm_base_modem_terse (MMBaseModem *self,
|
||||||
|
MMOperationLock operation_lock,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
gboolean mm_base_modem_sync_finish (MMBaseModem *self,
|
gboolean mm_base_modem_terse_finish (MMBaseModem *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void mm_base_modem_teardown_ports (MMBaseModem *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean mm_base_modem_teardown_ports_finish (MMBaseModem *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
#endif /* MM_BASE_MODEM_H */
|
#endif /* MM_BASE_MODEM_H */
|
||||||
|
|||||||
+139
-46
@@ -34,18 +34,22 @@
|
|||||||
#include "mm-log-object.h"
|
#include "mm-log-object.h"
|
||||||
#include "mm-modem-helpers.h"
|
#include "mm-modem-helpers.h"
|
||||||
#include "mm-error-helpers.h"
|
#include "mm-error-helpers.h"
|
||||||
|
#include "mm-bind.h"
|
||||||
|
|
||||||
static void async_initable_iface_init (GAsyncInitableIface *iface);
|
static void async_initable_iface_init (GAsyncInitableIface *iface);
|
||||||
static void log_object_iface_init (MMLogObjectInterface *iface);
|
static void log_object_iface_init (MMLogObjectInterface *iface);
|
||||||
|
static void bind_iface_init (MMBindInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_EXTENDED (MMBaseSim, mm_base_sim, MM_GDBUS_TYPE_SIM_SKELETON, 0,
|
G_DEFINE_TYPE_EXTENDED (MMBaseSim, mm_base_sim, MM_GDBUS_TYPE_SIM_SKELETON, 0,
|
||||||
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init)
|
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init)
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init))
|
G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init)
|
||||||
|
G_IMPLEMENT_INTERFACE (MM_TYPE_BIND, bind_iface_init))
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_PATH,
|
PROP_PATH,
|
||||||
PROP_CONNECTION,
|
PROP_CONNECTION,
|
||||||
|
PROP_BIND_TO,
|
||||||
PROP_MODEM,
|
PROP_MODEM,
|
||||||
PROP_SLOT_NUMBER,
|
PROP_SLOT_NUMBER,
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
@@ -63,6 +67,13 @@ struct _MMBaseSimPrivate {
|
|||||||
GDBusConnection *connection;
|
GDBusConnection *connection;
|
||||||
guint dbus_id;
|
guint dbus_id;
|
||||||
|
|
||||||
|
/* The authorization provider */
|
||||||
|
MMAuthProvider *authp;
|
||||||
|
GCancellable *authp_cancellable;
|
||||||
|
|
||||||
|
/* The object this SIM is bound to */
|
||||||
|
GObject *bind_to;
|
||||||
|
|
||||||
/* The modem which owns this SIM */
|
/* The modem which owns this SIM */
|
||||||
MMBaseModem *modem;
|
MMBaseModem *modem;
|
||||||
/* The path where the SIM object is exported */
|
/* The path where the SIM object is exported */
|
||||||
@@ -238,18 +249,25 @@ handle_change_pin_ready (MMBaseSim *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_change_pin_auth_ready (MMBaseModem *modem,
|
handle_change_pin_auth_ready (MMAuthProvider *authp,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleChangePinContext *ctx)
|
HandleChangePinContext *ctx)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (!mm_base_modem_authorize_finish (modem, res, &error)) {
|
if (!mm_auth_provider_authorize_finish (authp, res, &error)) {
|
||||||
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||||
handle_change_pin_context_free (ctx);
|
handle_change_pin_context_free (ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mm_utils_is_numeric (ctx->old_pin) || !mm_utils_is_numeric (ctx->new_pin)) {
|
||||||
|
mm_dbus_method_invocation_return_error_literal (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS,
|
||||||
|
"PIN must be numeric");
|
||||||
|
handle_change_pin_context_free (ctx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* If changing PIN is not implemented, report an error */
|
/* If changing PIN is not implemented, report an error */
|
||||||
if (!MM_BASE_SIM_GET_CLASS (ctx->self)->change_pin ||
|
if (!MM_BASE_SIM_GET_CLASS (ctx->self)->change_pin ||
|
||||||
!MM_BASE_SIM_GET_CLASS (ctx->self)->change_pin_finish) {
|
!MM_BASE_SIM_GET_CLASS (ctx->self)->change_pin_finish) {
|
||||||
@@ -296,11 +314,12 @@ handle_change_pin (MMBaseSim *self,
|
|||||||
ctx->old_pin = g_strdup (old_pin);
|
ctx->old_pin = g_strdup (old_pin);
|
||||||
ctx->new_pin = g_strdup (new_pin);
|
ctx->new_pin = g_strdup (new_pin);
|
||||||
|
|
||||||
mm_base_modem_authorize (self->priv->modem,
|
mm_auth_provider_authorize (self->priv->authp,
|
||||||
invocation,
|
invocation,
|
||||||
MM_AUTHORIZATION_DEVICE_CONTROL,
|
MM_AUTHORIZATION_DEVICE_CONTROL,
|
||||||
(GAsyncReadyCallback)handle_change_pin_auth_ready,
|
self->priv->authp_cancellable,
|
||||||
ctx);
|
(GAsyncReadyCallback)handle_change_pin_auth_ready,
|
||||||
|
ctx);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,18 +440,25 @@ handle_enable_pin_ready (MMBaseSim *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_enable_pin_auth_ready (MMBaseModem *modem,
|
handle_enable_pin_auth_ready (MMAuthProvider *authp,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleEnablePinContext *ctx)
|
HandleEnablePinContext *ctx)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (!mm_base_modem_authorize_finish (modem, res, &error)) {
|
if (!mm_auth_provider_authorize_finish (authp, res, &error)) {
|
||||||
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||||
handle_enable_pin_context_free (ctx);
|
handle_enable_pin_context_free (ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mm_utils_is_numeric (ctx->pin)) {
|
||||||
|
mm_dbus_method_invocation_return_error_literal (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS,
|
||||||
|
"PIN must be numeric");
|
||||||
|
handle_enable_pin_context_free (ctx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* If changing PIN is not implemented, report an error */
|
/* If changing PIN is not implemented, report an error */
|
||||||
if (!MM_BASE_SIM_GET_CLASS (ctx->self)->enable_pin ||
|
if (!MM_BASE_SIM_GET_CLASS (ctx->self)->enable_pin ||
|
||||||
!MM_BASE_SIM_GET_CLASS (ctx->self)->enable_pin_finish) {
|
!MM_BASE_SIM_GET_CLASS (ctx->self)->enable_pin_finish) {
|
||||||
@@ -478,11 +504,12 @@ handle_enable_pin (MMBaseSim *self,
|
|||||||
ctx->pin = g_strdup (pin);
|
ctx->pin = g_strdup (pin);
|
||||||
ctx->enabled = enabled;
|
ctx->enabled = enabled;
|
||||||
|
|
||||||
mm_base_modem_authorize (self->priv->modem,
|
mm_auth_provider_authorize (self->priv->authp,
|
||||||
invocation,
|
invocation,
|
||||||
MM_AUTHORIZATION_DEVICE_CONTROL,
|
MM_AUTHORIZATION_DEVICE_CONTROL,
|
||||||
(GAsyncReadyCallback)handle_enable_pin_auth_ready,
|
self->priv->authp_cancellable,
|
||||||
ctx);
|
(GAsyncReadyCallback)handle_enable_pin_auth_ready,
|
||||||
|
ctx);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -844,18 +871,25 @@ handle_send_pin_ready (MMBaseSim *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_send_pin_auth_ready (MMBaseModem *modem,
|
handle_send_pin_auth_ready (MMAuthProvider *authp,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleSendPinContext *ctx)
|
HandleSendPinContext *ctx)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (!mm_base_modem_authorize_finish (modem, res, &error)) {
|
if (!mm_auth_provider_authorize_finish (authp, res, &error)) {
|
||||||
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||||
handle_send_pin_context_free (ctx);
|
handle_send_pin_context_free (ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mm_utils_is_numeric (ctx->pin)) {
|
||||||
|
mm_dbus_method_invocation_return_error_literal (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS,
|
||||||
|
"PIN must be numeric");
|
||||||
|
handle_send_pin_context_free (ctx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!mm_gdbus_sim_get_active (MM_GDBUS_SIM (ctx->self))) {
|
if (!mm_gdbus_sim_get_active (MM_GDBUS_SIM (ctx->self))) {
|
||||||
mm_dbus_method_invocation_return_error_literal (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED,
|
mm_dbus_method_invocation_return_error_literal (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED,
|
||||||
"Cannot send PIN: SIM not currently active");
|
"Cannot send PIN: SIM not currently active");
|
||||||
@@ -889,11 +923,12 @@ handle_send_pin (MMBaseSim *self,
|
|||||||
ctx->invocation = g_object_ref (invocation);
|
ctx->invocation = g_object_ref (invocation);
|
||||||
ctx->pin = g_strdup (pin);
|
ctx->pin = g_strdup (pin);
|
||||||
|
|
||||||
mm_base_modem_authorize (self->priv->modem,
|
mm_auth_provider_authorize (self->priv->authp,
|
||||||
invocation,
|
invocation,
|
||||||
MM_AUTHORIZATION_DEVICE_CONTROL,
|
MM_AUTHORIZATION_DEVICE_CONTROL,
|
||||||
(GAsyncReadyCallback)handle_send_pin_auth_ready,
|
self->priv->authp_cancellable,
|
||||||
ctx);
|
(GAsyncReadyCallback)handle_send_pin_auth_ready,
|
||||||
|
ctx);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -948,18 +983,25 @@ handle_send_puk_ready (MMBaseSim *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_send_puk_auth_ready (MMBaseModem *modem,
|
handle_send_puk_auth_ready (MMAuthProvider *authp,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleSendPukContext *ctx)
|
HandleSendPukContext *ctx)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (!mm_base_modem_authorize_finish (modem, res, &error)) {
|
if (!mm_auth_provider_authorize_finish (authp, res, &error)) {
|
||||||
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||||
handle_send_puk_context_free (ctx);
|
handle_send_puk_context_free (ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mm_utils_is_numeric (ctx->puk) || !mm_utils_is_numeric (ctx->new_pin)) {
|
||||||
|
mm_dbus_method_invocation_return_error_literal (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS,
|
||||||
|
"PIN/PUK must be numeric");
|
||||||
|
handle_send_puk_context_free (ctx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!mm_gdbus_sim_get_active (MM_GDBUS_SIM (ctx->self))) {
|
if (!mm_gdbus_sim_get_active (MM_GDBUS_SIM (ctx->self))) {
|
||||||
mm_dbus_method_invocation_return_error_literal (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED,
|
mm_dbus_method_invocation_return_error_literal (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED,
|
||||||
"Cannot send PUK: SIM not currently active");
|
"Cannot send PUK: SIM not currently active");
|
||||||
@@ -996,11 +1038,12 @@ handle_send_puk (MMBaseSim *self,
|
|||||||
ctx->puk = g_strdup (puk);
|
ctx->puk = g_strdup (puk);
|
||||||
ctx->new_pin = g_strdup (new_pin);
|
ctx->new_pin = g_strdup (new_pin);
|
||||||
|
|
||||||
mm_base_modem_authorize (self->priv->modem,
|
mm_auth_provider_authorize (self->priv->authp,
|
||||||
invocation,
|
invocation,
|
||||||
MM_AUTHORIZATION_DEVICE_CONTROL,
|
MM_AUTHORIZATION_DEVICE_CONTROL,
|
||||||
(GAsyncReadyCallback)handle_send_puk_auth_ready,
|
self->priv->authp_cancellable,
|
||||||
ctx);
|
(GAsyncReadyCallback)handle_send_puk_auth_ready,
|
||||||
|
ctx);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1503,14 +1546,36 @@ handle_set_preferred_networks_ready (MMBaseSim *self,
|
|||||||
handle_set_preferred_networks_context_free (ctx);
|
handle_set_preferred_networks_context_free (ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
validate_networks_list (GList *networks_list,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
GList *l;
|
||||||
|
|
||||||
|
for (l = networks_list; l; l = g_list_next (l)) {
|
||||||
|
MMSimPreferredNetwork *network = (MMSimPreferredNetwork *)l->data;
|
||||||
|
const gchar *operator_code;
|
||||||
|
|
||||||
|
operator_code = mm_sim_preferred_network_get_operator_code (network);
|
||||||
|
if (!mm_utils_is_numeric (operator_code)) {
|
||||||
|
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS,
|
||||||
|
"Invalid operator code: '%s'", operator_code);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_set_preferred_networks_auth_ready (MMBaseModem *modem,
|
handle_set_preferred_networks_auth_ready (MMAuthProvider *authp,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleSetPreferredNetworksContext *ctx)
|
HandleSetPreferredNetworksContext *ctx)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
GList *networks_list = NULL;
|
||||||
|
|
||||||
if (!mm_base_modem_authorize_finish (modem, res, &error)) {
|
if (!mm_auth_provider_authorize_finish (authp, res, &error)) {
|
||||||
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||||
handle_set_preferred_networks_context_free (ctx);
|
handle_set_preferred_networks_context_free (ctx);
|
||||||
return;
|
return;
|
||||||
@@ -1538,12 +1603,22 @@ handle_set_preferred_networks_auth_ready (MMBaseModem *modem,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
networks_list = mm_sim_preferred_network_list_new_from_variant (ctx->networks);
|
||||||
|
if (!validate_networks_list (networks_list, &error)) {
|
||||||
|
g_list_free_full (networks_list, g_object_unref);
|
||||||
|
mm_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||||
|
handle_set_preferred_networks_context_free (ctx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mm_obj_info (ctx->self, "processing user request to set preferred networks...");
|
mm_obj_info (ctx->self, "processing user request to set preferred networks...");
|
||||||
MM_BASE_SIM_GET_CLASS (ctx->self)->set_preferred_networks (
|
MM_BASE_SIM_GET_CLASS (ctx->self)->set_preferred_networks (
|
||||||
ctx->self,
|
ctx->self,
|
||||||
mm_sim_preferred_network_list_new_from_variant (ctx->networks),
|
networks_list,
|
||||||
(GAsyncReadyCallback)handle_set_preferred_networks_ready,
|
(GAsyncReadyCallback)handle_set_preferred_networks_ready,
|
||||||
ctx);
|
ctx);
|
||||||
|
|
||||||
|
g_list_free_full (networks_list, g_object_unref);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -1558,11 +1633,12 @@ handle_set_preferred_networks (MMBaseSim *self,
|
|||||||
ctx->invocation = g_object_ref (invocation);
|
ctx->invocation = g_object_ref (invocation);
|
||||||
ctx->networks = g_variant_ref (networks_variant);
|
ctx->networks = g_variant_ref (networks_variant);
|
||||||
|
|
||||||
mm_base_modem_authorize (self->priv->modem,
|
mm_auth_provider_authorize (self->priv->authp,
|
||||||
invocation,
|
invocation,
|
||||||
MM_AUTHORIZATION_DEVICE_CONTROL,
|
MM_AUTHORIZATION_DEVICE_CONTROL,
|
||||||
(GAsyncReadyCallback)handle_set_preferred_networks_auth_ready,
|
self->priv->authp_cancellable,
|
||||||
ctx);
|
(GAsyncReadyCallback)handle_set_preferred_networks_auth_ready,
|
||||||
|
ctx);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2286,6 +2362,7 @@ load_gid2 (MMBaseSim *self,
|
|||||||
|
|
||||||
MMBaseSim *
|
MMBaseSim *
|
||||||
mm_base_sim_new_initialized (MMBaseModem *modem,
|
mm_base_sim_new_initialized (MMBaseModem *modem,
|
||||||
|
GObject *bind_to,
|
||||||
guint slot_number,
|
guint slot_number,
|
||||||
gboolean active,
|
gboolean active,
|
||||||
const gchar *sim_identifier,
|
const gchar *sim_identifier,
|
||||||
@@ -2299,6 +2376,7 @@ mm_base_sim_new_initialized (MMBaseModem *modem,
|
|||||||
|
|
||||||
sim = MM_BASE_SIM (g_object_new (MM_TYPE_BASE_SIM,
|
sim = MM_BASE_SIM (g_object_new (MM_TYPE_BASE_SIM,
|
||||||
MM_BASE_SIM_MODEM, modem,
|
MM_BASE_SIM_MODEM, modem,
|
||||||
|
MM_BIND_TO, bind_to,
|
||||||
MM_BASE_SIM_SLOT_NUMBER, slot_number,
|
MM_BASE_SIM_SLOT_NUMBER, slot_number,
|
||||||
"active", active,
|
"active", active,
|
||||||
"sim-identifier", sim_identifier,
|
"sim-identifier", sim_identifier,
|
||||||
@@ -2888,6 +2966,7 @@ initable_init_async (GAsyncInitable *initable,
|
|||||||
|
|
||||||
void
|
void
|
||||||
mm_base_sim_new (MMBaseModem *modem,
|
mm_base_sim_new (MMBaseModem *modem,
|
||||||
|
GObject *bind_to,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
@@ -2898,6 +2977,7 @@ mm_base_sim_new (MMBaseModem *modem,
|
|||||||
callback,
|
callback,
|
||||||
user_data,
|
user_data,
|
||||||
MM_BASE_SIM_MODEM, modem,
|
MM_BASE_SIM_MODEM, modem,
|
||||||
|
MM_BIND_TO, bind_to,
|
||||||
"active", TRUE, /* by default always active */
|
"active", TRUE, /* by default always active */
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
@@ -2963,18 +3043,14 @@ set_property (GObject *object,
|
|||||||
else if (self->priv->path)
|
else if (self->priv->path)
|
||||||
sim_dbus_export (self);
|
sim_dbus_export (self);
|
||||||
break;
|
break;
|
||||||
|
case PROP_BIND_TO:
|
||||||
|
g_clear_object (&self->priv->bind_to);
|
||||||
|
self->priv->bind_to = g_value_dup_object (value);
|
||||||
|
mm_bind_to (MM_BIND (self), MM_BASE_SIM_CONNECTION, self->priv->bind_to);
|
||||||
|
break;
|
||||||
case PROP_MODEM:
|
case PROP_MODEM:
|
||||||
g_clear_object (&self->priv->modem);
|
g_clear_object (&self->priv->modem);
|
||||||
self->priv->modem = g_value_dup_object (value);
|
self->priv->modem = g_value_dup_object (value);
|
||||||
if (self->priv->modem) {
|
|
||||||
/* Set owner ID */
|
|
||||||
mm_log_object_set_owner_id (MM_LOG_OBJECT (self), mm_log_object_get_id (MM_LOG_OBJECT (self->priv->modem)));
|
|
||||||
/* Bind the modem's connection (which is set when it is exported,
|
|
||||||
* and unset when unexported) to the SIM's connection */
|
|
||||||
g_object_bind_property (self->priv->modem, MM_BASE_MODEM_CONNECTION,
|
|
||||||
self, MM_BASE_SIM_CONNECTION,
|
|
||||||
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case PROP_SLOT_NUMBER:
|
case PROP_SLOT_NUMBER:
|
||||||
self->priv->slot_number = g_value_get_uint (value);
|
self->priv->slot_number = g_value_get_uint (value);
|
||||||
@@ -3000,6 +3076,9 @@ get_property (GObject *object,
|
|||||||
case PROP_CONNECTION:
|
case PROP_CONNECTION:
|
||||||
g_value_set_object (value, self->priv->connection);
|
g_value_set_object (value, self->priv->connection);
|
||||||
break;
|
break;
|
||||||
|
case PROP_BIND_TO:
|
||||||
|
g_value_set_object (value, self->priv->bind_to);
|
||||||
|
break;
|
||||||
case PROP_MODEM:
|
case PROP_MODEM:
|
||||||
g_value_set_object (value, self->priv->modem);
|
g_value_set_object (value, self->priv->modem);
|
||||||
break;
|
break;
|
||||||
@@ -3022,6 +3101,10 @@ mm_base_sim_init (MMBaseSim *self)
|
|||||||
|
|
||||||
/* Each SIM is given a unique id to build its own DBus path */
|
/* Each SIM is given a unique id to build its own DBus path */
|
||||||
self->priv->dbus_id = id++;
|
self->priv->dbus_id = id++;
|
||||||
|
|
||||||
|
/* Setup authorization provider */
|
||||||
|
self->priv->authp = mm_auth_provider_get ();
|
||||||
|
self->priv->authp_cancellable = g_cancellable_new ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -3047,6 +3130,9 @@ dispose (GObject *object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_clear_object (&self->priv->modem);
|
g_clear_object (&self->priv->modem);
|
||||||
|
g_clear_object (&self->priv->bind_to);
|
||||||
|
g_cancellable_cancel (self->priv->authp_cancellable);
|
||||||
|
g_clear_object (&self->priv->authp_cancellable);
|
||||||
|
|
||||||
G_OBJECT_CLASS (mm_base_sim_parent_class)->dispose (object);
|
G_OBJECT_CLASS (mm_base_sim_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
@@ -3064,6 +3150,11 @@ log_object_iface_init (MMLogObjectInterface *iface)
|
|||||||
iface->build_id = log_object_build_id;
|
iface->build_id = log_object_build_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
bind_iface_init (MMBindInterface *iface)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mm_base_sim_class_init (MMBaseSimClass *klass)
|
mm_base_sim_class_init (MMBaseSimClass *klass)
|
||||||
{
|
{
|
||||||
@@ -3128,6 +3219,8 @@ mm_base_sim_class_init (MMBaseSimClass *klass)
|
|||||||
G_PARAM_READWRITE);
|
G_PARAM_READWRITE);
|
||||||
g_object_class_install_property (object_class, PROP_MODEM, properties[PROP_MODEM]);
|
g_object_class_install_property (object_class, PROP_MODEM, properties[PROP_MODEM]);
|
||||||
|
|
||||||
|
g_object_class_override_property (object_class, PROP_BIND_TO, MM_BIND_TO);
|
||||||
|
|
||||||
properties[PROP_SLOT_NUMBER] =
|
properties[PROP_SLOT_NUMBER] =
|
||||||
g_param_spec_uint (MM_BASE_SIM_SLOT_NUMBER,
|
g_param_spec_uint (MM_BASE_SIM_SLOT_NUMBER,
|
||||||
"Slot number",
|
"Slot number",
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ GType mm_base_sim_get_type (void);
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseSim, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseSim, g_object_unref)
|
||||||
|
|
||||||
void mm_base_sim_new (MMBaseModem *modem,
|
void mm_base_sim_new (MMBaseModem *modem,
|
||||||
|
GObject *bind_to,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
@@ -228,6 +229,7 @@ gboolean mm_base_sim_initialize_finish (MMBaseSim *self,
|
|||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
MMBaseSim *mm_base_sim_new_initialized (MMBaseModem *modem,
|
MMBaseSim *mm_base_sim_new_initialized (MMBaseModem *modem,
|
||||||
|
GObject *bind_to,
|
||||||
guint slot_number,
|
guint slot_number,
|
||||||
gboolean active,
|
gboolean active,
|
||||||
const gchar *sim_identifier,
|
const gchar *sim_identifier,
|
||||||
|
|||||||
+237
-899
File diff suppressed because it is too large
Load Diff
+30
-19
@@ -25,7 +25,6 @@
|
|||||||
#include <libmm-glib.h>
|
#include <libmm-glib.h>
|
||||||
|
|
||||||
#include "mm-sms-part.h"
|
#include "mm-sms-part.h"
|
||||||
#include "mm-base-modem.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
@@ -46,12 +45,19 @@ typedef struct _MMBaseSms MMBaseSms;
|
|||||||
typedef struct _MMBaseSmsClass MMBaseSmsClass;
|
typedef struct _MMBaseSmsClass MMBaseSmsClass;
|
||||||
typedef struct _MMBaseSmsPrivate MMBaseSmsPrivate;
|
typedef struct _MMBaseSmsPrivate MMBaseSmsPrivate;
|
||||||
|
|
||||||
|
/* Properties */
|
||||||
#define MM_BASE_SMS_PATH "sms-path"
|
#define MM_BASE_SMS_PATH "sms-path"
|
||||||
#define MM_BASE_SMS_CONNECTION "sms-connection"
|
#define MM_BASE_SMS_CONNECTION "sms-connection"
|
||||||
#define MM_BASE_SMS_MODEM "sms-modem"
|
|
||||||
#define MM_BASE_SMS_IS_MULTIPART "sms-is-multipart"
|
#define MM_BASE_SMS_IS_MULTIPART "sms-is-multipart"
|
||||||
#define MM_BASE_SMS_MAX_PARTS "sms-max-parts"
|
#define MM_BASE_SMS_MAX_PARTS "sms-max-parts"
|
||||||
#define MM_BASE_SMS_MULTIPART_REFERENCE "sms-multipart-reference"
|
#define MM_BASE_SMS_MULTIPART_REFERENCE "sms-multipart-reference"
|
||||||
|
#define MM_BASE_SMS_IS_3GPP "sms-is-3gpp"
|
||||||
|
#define MM_BASE_SMS_DEFAULT_STORAGE "sms-default-storage"
|
||||||
|
#define MM_BASE_SMS_SUPPORTED_STORAGES "sms-supported-storages"
|
||||||
|
#define MM_BASE_SMS_CONNECTION_PARENT_PROPERTY_NAME "sms-connection-parent-property-name"
|
||||||
|
|
||||||
|
/* Signals */
|
||||||
|
#define MM_BASE_SMS_SET_LOCAL_MULTIPART_REFERENCE "sms-set-local-multipart-reference"
|
||||||
|
|
||||||
struct _MMBaseSms {
|
struct _MMBaseSms {
|
||||||
MmGdbusSmsSkeleton parent;
|
MmGdbusSmsSkeleton parent;
|
||||||
@@ -85,28 +91,31 @@ struct _MMBaseSmsClass {
|
|||||||
gboolean (* delete_finish) (MMBaseSms *self,
|
gboolean (* delete_finish) (MMBaseSms *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
/* Signal */
|
||||||
|
void (*set_local_multipart_reference) (MMBaseSms *self,
|
||||||
|
const gchar *number);
|
||||||
};
|
};
|
||||||
|
|
||||||
GType mm_base_sms_get_type (void);
|
GType mm_base_sms_get_type (void);
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseSms, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseSms, g_object_unref)
|
||||||
|
|
||||||
/* This one can be overridden by plugins */
|
gboolean mm_base_sms_init_from_properties (MMBaseSms *self,
|
||||||
MMBaseSms *mm_base_sms_new (MMBaseModem *modem);
|
MMSmsProperties *properties,
|
||||||
MMBaseSms *mm_base_sms_new_from_properties (MMBaseModem *modem,
|
GError **error);
|
||||||
MMSmsProperties *properties,
|
gboolean mm_base_sms_singlepart_init (MMBaseSms *self,
|
||||||
GError **error);
|
MMSmsState state,
|
||||||
MMBaseSms *mm_base_sms_singlepart_new (MMBaseModem *modem,
|
MMSmsStorage storage,
|
||||||
MMSmsState state,
|
MMSmsPart *part,
|
||||||
MMSmsStorage storage,
|
GError **error);
|
||||||
MMSmsPart *part,
|
gboolean mm_base_sms_multipart_init (MMBaseSms *self,
|
||||||
GError **error);
|
MMSmsState state,
|
||||||
MMBaseSms *mm_base_sms_multipart_new (MMBaseModem *modem,
|
MMSmsStorage storage,
|
||||||
MMSmsState state,
|
guint reference,
|
||||||
MMSmsStorage storage,
|
guint max_parts,
|
||||||
guint reference,
|
MMSmsPart *first_part,
|
||||||
guint max_parts,
|
GError **error);
|
||||||
MMSmsPart *first_part,
|
|
||||||
GError **error);
|
|
||||||
gboolean mm_base_sms_multipart_take_part (MMBaseSms *self,
|
gboolean mm_base_sms_multipart_take_part (MMBaseSms *self,
|
||||||
MMSmsPart *part,
|
MMSmsPart *part,
|
||||||
GError **error);
|
GError **error);
|
||||||
@@ -123,6 +132,8 @@ GList *mm_base_sms_get_parts (MMBaseSms *self);
|
|||||||
gboolean mm_base_sms_is_multipart (MMBaseSms *self);
|
gboolean mm_base_sms_is_multipart (MMBaseSms *self);
|
||||||
guint mm_base_sms_get_max_parts (MMBaseSms *self);
|
guint mm_base_sms_get_max_parts (MMBaseSms *self);
|
||||||
guint mm_base_sms_get_multipart_reference (MMBaseSms *self);
|
guint mm_base_sms_get_multipart_reference (MMBaseSms *self);
|
||||||
|
void mm_base_sms_set_multipart_reference (MMBaseSms *self,
|
||||||
|
guint reference);
|
||||||
gboolean mm_base_sms_multipart_is_complete (MMBaseSms *self);
|
gboolean mm_base_sms_multipart_is_complete (MMBaseSms *self);
|
||||||
gboolean mm_base_sms_multipart_is_assembled (MMBaseSms *self);
|
gboolean mm_base_sms_multipart_is_assembled (MMBaseSms *self);
|
||||||
|
|
||||||
|
|||||||
+19
-8
@@ -33,6 +33,7 @@
|
|||||||
#include "mm-bearer-mbim.h"
|
#include "mm-bearer-mbim.h"
|
||||||
#include "mm-log-object.h"
|
#include "mm-log-object.h"
|
||||||
#include "mm-context.h"
|
#include "mm-context.h"
|
||||||
|
#include "mm-bind.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (MMBearerMbim, mm_bearer_mbim, MM_TYPE_BASE_BEARER)
|
G_DEFINE_TYPE (MMBearerMbim, mm_bearer_mbim, MM_TYPE_BASE_BEARER)
|
||||||
|
|
||||||
@@ -640,9 +641,10 @@ ip_configuration_async_cleanup (GTask *task)
|
|||||||
|
|
||||||
ctx = g_task_get_task_data (task);
|
ctx = g_task_get_task_data (task);
|
||||||
|
|
||||||
g_assert (ctx->async_slaac_cancellation_id);
|
if (ctx->async_slaac_cancellation_id) {
|
||||||
g_cancellable_disconnect (g_task_get_cancellable (task), ctx->async_slaac_cancellation_id);
|
g_cancellable_disconnect (g_task_get_cancellable (task), ctx->async_slaac_cancellation_id);
|
||||||
ctx->async_slaac_cancellation_id = 0;
|
ctx->async_slaac_cancellation_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
g_assert (ctx->async_slaac_notification_id);
|
g_assert (ctx->async_slaac_notification_id);
|
||||||
if (g_signal_handler_is_connected (ctx->mbim, ctx->async_slaac_notification_id))
|
if (g_signal_handler_is_connected (ctx->mbim, ctx->async_slaac_notification_id))
|
||||||
@@ -666,8 +668,15 @@ ip_configuration_async_timeout (GTask *task)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ip_configuration_async_cancelled (GTask *task)
|
ip_configuration_async_cancelled (GCancellable *cancellable,
|
||||||
|
GTask *task)
|
||||||
{
|
{
|
||||||
|
ConnectContext *ctx;
|
||||||
|
|
||||||
|
/* Avoid the explicit g_cancellable_disconnect(), which would deadlock */
|
||||||
|
ctx = g_task_get_task_data (task);
|
||||||
|
ctx->async_slaac_cancellation_id = 0;
|
||||||
|
|
||||||
ip_configuration_async_cleanup (task);
|
ip_configuration_async_cleanup (task);
|
||||||
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED,
|
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED,
|
||||||
"Cancelled waiting for SLAAC notification");
|
"Cancelled waiting for SLAAC notification");
|
||||||
@@ -1458,10 +1467,11 @@ load_settings_from_bearer (MMBearerMbim *self,
|
|||||||
guint max_multiplexed_bearers;
|
guint max_multiplexed_bearers;
|
||||||
const gchar *data_port_driver;
|
const gchar *data_port_driver;
|
||||||
|
|
||||||
if (!mm_broadband_modem_get_active_multiplexed_bearers (MM_BROADBAND_MODEM (ctx->modem),
|
if (!mm_iface_modem_count_bearers (MM_IFACE_MODEM (ctx->modem),
|
||||||
¤t_multiplexed_bearers,
|
MM_IFACE_MODEM_COUNT_BEARERS_FLAG_MULTIPLEXED,
|
||||||
&max_multiplexed_bearers,
|
¤t_multiplexed_bearers,
|
||||||
error))
|
&max_multiplexed_bearers,
|
||||||
|
error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Check multiplex support in the kernel and the device */
|
/* Check multiplex support in the kernel and the device */
|
||||||
@@ -2019,6 +2029,7 @@ mm_bearer_mbim_new (MMBroadbandModemMbim *modem,
|
|||||||
* g_object_new() here */
|
* g_object_new() here */
|
||||||
bearer = g_object_new (MM_TYPE_BEARER_MBIM,
|
bearer = g_object_new (MM_TYPE_BEARER_MBIM,
|
||||||
MM_BASE_BEARER_MODEM, modem,
|
MM_BASE_BEARER_MODEM, modem,
|
||||||
|
MM_BIND_TO, G_OBJECT (modem),
|
||||||
MM_BASE_BEARER_CONFIG, config,
|
MM_BASE_BEARER_CONFIG, config,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|||||||
+7
-4
@@ -37,6 +37,7 @@
|
|||||||
#include "mm-log-object.h"
|
#include "mm-log-object.h"
|
||||||
#include "mm-modem-helpers.h"
|
#include "mm-modem-helpers.h"
|
||||||
#include "mm-context.h"
|
#include "mm-context.h"
|
||||||
|
#include "mm-bind.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (MMBearerQmi, mm_bearer_qmi, MM_TYPE_BASE_BEARER)
|
G_DEFINE_TYPE (MMBearerQmi, mm_bearer_qmi, MM_TYPE_BASE_BEARER)
|
||||||
|
|
||||||
@@ -2424,10 +2425,11 @@ load_settings_from_bearer (MMBearerQmi *self,
|
|||||||
guint max_multiplexed_bearers;
|
guint max_multiplexed_bearers;
|
||||||
gboolean multiplex_supported = TRUE;
|
gboolean multiplex_supported = TRUE;
|
||||||
|
|
||||||
if (!mm_broadband_modem_get_active_multiplexed_bearers (MM_BROADBAND_MODEM (ctx->modem),
|
if (!mm_iface_modem_count_bearers (MM_IFACE_MODEM (ctx->modem),
|
||||||
¤t_multiplexed_bearers,
|
MM_IFACE_MODEM_COUNT_BEARERS_FLAG_MULTIPLEXED,
|
||||||
&max_multiplexed_bearers,
|
¤t_multiplexed_bearers,
|
||||||
error))
|
&max_multiplexed_bearers,
|
||||||
|
error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Check multiplex support in the kernel and the device */
|
/* Check multiplex support in the kernel and the device */
|
||||||
@@ -2959,6 +2961,7 @@ mm_bearer_qmi_new (MMBroadbandModemQmi *modem,
|
|||||||
* g_object_new() here */
|
* g_object_new() here */
|
||||||
bearer = g_object_new (MM_TYPE_BEARER_QMI,
|
bearer = g_object_new (MM_TYPE_BEARER_QMI,
|
||||||
MM_BASE_BEARER_MODEM, modem,
|
MM_BASE_BEARER_MODEM, modem,
|
||||||
|
MM_BIND_TO, G_OBJECT (modem),
|
||||||
MM_BASE_BEARER_CONFIG, config,
|
MM_BASE_BEARER_CONFIG, config,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 Dan Williams <dan@ioncontrol.co>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "mm-bind.h"
|
||||||
|
#include "mm-log-object.h"
|
||||||
|
|
||||||
|
G_DEFINE_INTERFACE (MMBind, mm_bind, MM_TYPE_LOG_OBJECT)
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
mm_bind_to (MMBind *self, const gchar *local_propname, GObject *other_object)
|
||||||
|
{
|
||||||
|
if (other_object) {
|
||||||
|
/* Set log owner ID */
|
||||||
|
mm_log_object_set_owner_id (MM_LOG_OBJECT (self),
|
||||||
|
mm_log_object_get_id (MM_LOG_OBJECT (other_object)));
|
||||||
|
|
||||||
|
if (local_propname) {
|
||||||
|
/* Bind the other object's connection property (which is set when it is
|
||||||
|
* exported, and unset when unexported) to this object's connection
|
||||||
|
* property.
|
||||||
|
*/
|
||||||
|
g_object_bind_property (other_object,
|
||||||
|
MM_BINDABLE_CONNECTION,
|
||||||
|
self,
|
||||||
|
local_propname,
|
||||||
|
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return !!other_object;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
mm_bind_default_init (MMBindInterface *iface)
|
||||||
|
{
|
||||||
|
static gsize initialized = 0;
|
||||||
|
|
||||||
|
if (!g_once_init_enter (&initialized))
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Properties */
|
||||||
|
g_object_interface_install_property (
|
||||||
|
iface,
|
||||||
|
g_param_spec_object (MM_BIND_TO,
|
||||||
|
"Bind to",
|
||||||
|
"Bind to this object",
|
||||||
|
G_TYPE_OBJECT,
|
||||||
|
G_PARAM_READWRITE));
|
||||||
|
|
||||||
|
g_once_init_leave (&initialized, 1);
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 Dan Williams <dan@ioncontrol.co>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MM_CHILD_H
|
||||||
|
#define MM_CHILD_H
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
/* Properties */
|
||||||
|
#define MM_BIND_TO "bind-to"
|
||||||
|
|
||||||
|
/* Property name used by an object that wants to allow others
|
||||||
|
* to bind its connection property.
|
||||||
|
*/
|
||||||
|
#define MM_BINDABLE_CONNECTION "bind-connection"
|
||||||
|
|
||||||
|
#define MM_TYPE_BIND mm_bind_get_type ()
|
||||||
|
G_DECLARE_INTERFACE (MMBind, mm_bind, MM, BIND, MMBind)
|
||||||
|
|
||||||
|
struct _MMBindInterface
|
||||||
|
{
|
||||||
|
GTypeInterface g_iface;
|
||||||
|
};
|
||||||
|
|
||||||
|
gboolean mm_bind_to (MMBind *self,
|
||||||
|
const gchar *local_propname,
|
||||||
|
GObject *other_object);
|
||||||
|
|
||||||
|
#endif /* MM_LOG_OBJECT_H */
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
#include "mm-modem-helpers.h"
|
#include "mm-modem-helpers.h"
|
||||||
#include "mm-port-enums-types.h"
|
#include "mm-port-enums-types.h"
|
||||||
#include "mm-helper-enums-types.h"
|
#include "mm-helper-enums-types.h"
|
||||||
|
#include "mm-bind.h"
|
||||||
|
|
||||||
static void async_initable_iface_init (GAsyncInitableIface *iface);
|
static void async_initable_iface_init (GAsyncInitableIface *iface);
|
||||||
|
|
||||||
@@ -634,7 +635,13 @@ select_profile_3gpp_get_profile_ready (MMIfaceModem3gppProfileManager *modem,
|
|||||||
profile = mm_iface_modem_3gpp_profile_manager_get_profile_finish (modem, res, &error);
|
profile = mm_iface_modem_3gpp_profile_manager_get_profile_finish (modem, res, &error);
|
||||||
if (!profile)
|
if (!profile)
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
else
|
else if (!mm_3gpp_profile_get_enabled (profile)) {
|
||||||
|
g_task_return_new_error (task,
|
||||||
|
MM_CORE_ERROR,
|
||||||
|
MM_CORE_ERROR_FAILED,
|
||||||
|
"Profile '%d' is internally disabled",
|
||||||
|
ctx->profile_id);
|
||||||
|
} else
|
||||||
g_task_return_int (task, ctx->profile_id);
|
g_task_return_int (task, ctx->profile_id);
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
}
|
}
|
||||||
@@ -1960,6 +1967,7 @@ mm_broadband_bearer_new (MMBroadbandModem *modem,
|
|||||||
callback,
|
callback,
|
||||||
user_data,
|
user_data,
|
||||||
MM_BASE_BEARER_MODEM, modem,
|
MM_BASE_BEARER_MODEM, modem,
|
||||||
|
MM_BIND_TO, G_OBJECT (modem),
|
||||||
MM_BASE_BEARER_CONFIG, bearer_properties,
|
MM_BASE_BEARER_CONFIG, bearer_properties,
|
||||||
MM_BROADBAND_BEARER_FLOW_CONTROL, flow_control,
|
MM_BROADBAND_BEARER_FLOW_CONTROL, flow_control,
|
||||||
NULL);
|
NULL);
|
||||||
|
|||||||
+102
-51
@@ -153,6 +153,7 @@ struct _MMBroadbandModemMbimPrivate {
|
|||||||
gboolean is_ms_sar_supported;
|
gboolean is_ms_sar_supported;
|
||||||
gboolean is_google_carrier_lock_supported;
|
gboolean is_google_carrier_lock_supported;
|
||||||
gboolean is_ms_device_reset_supported;
|
gboolean is_ms_device_reset_supported;
|
||||||
|
gboolean is_qdu_supported;
|
||||||
|
|
||||||
/* Process unsolicited notifications */
|
/* Process unsolicited notifications */
|
||||||
gulong notification_id;
|
gulong notification_id;
|
||||||
@@ -190,7 +191,6 @@ struct _MMBroadbandModemMbimPrivate {
|
|||||||
/* Multi-SIM support */
|
/* Multi-SIM support */
|
||||||
guint32 executor_index;
|
guint32 executor_index;
|
||||||
guint active_slot_index;
|
guint active_slot_index;
|
||||||
gboolean pending_sim_slot_switch_action;
|
|
||||||
|
|
||||||
MMUnlockRetries *unlock_retries;
|
MMUnlockRetries *unlock_retries;
|
||||||
};
|
};
|
||||||
@@ -344,7 +344,7 @@ peek_port_mbim_for_data (MMBroadbandModemMbim *self,
|
|||||||
g_assert (mm_port_get_subsys (data) == MM_PORT_SUBSYS_NET);
|
g_assert (mm_port_get_subsys (data) == MM_PORT_SUBSYS_NET);
|
||||||
|
|
||||||
net_port_driver = mm_kernel_device_get_driver (mm_port_peek_kernel_device (data));
|
net_port_driver = mm_kernel_device_get_driver (mm_port_peek_kernel_device (data));
|
||||||
if (g_strcmp0 (net_port_driver, "cdc_mbim") != 0 && g_strcmp0 (net_port_driver, "mhi_net")) {
|
if (g_strcmp0 (net_port_driver, "cdc_mbim") && g_strcmp0 (net_port_driver, "mhi-pci-generic")) {
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
MM_CORE_ERROR,
|
MM_CORE_ERROR,
|
||||||
MM_CORE_ERROR_FAILED,
|
MM_CORE_ERROR_FAILED,
|
||||||
@@ -354,7 +354,7 @@ peek_port_mbim_for_data (MMBroadbandModemMbim *self,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_strcmp0 (net_port_driver, "mhi_net"))
|
if (!g_strcmp0 (net_port_driver, "mhi-pci-generic"))
|
||||||
return mm_broadband_modem_mbim_peek_port_mbim (self);
|
return mm_broadband_modem_mbim_peek_port_mbim (self);
|
||||||
|
|
||||||
net_port_parent_path = mm_kernel_device_get_interface_sysfs_path (mm_port_peek_kernel_device (data));
|
net_port_parent_path = mm_kernel_device_get_interface_sysfs_path (mm_port_peek_kernel_device (data));
|
||||||
@@ -519,7 +519,7 @@ device_caps_query_ready (MbimDevice *device,
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
LoadCurrentCapabilitiesContext *ctx;
|
LoadCurrentCapabilitiesContext *ctx;
|
||||||
MbimDataClass caps_data_class = MBIM_DATA_CLASS_NONE;
|
MbimDataClass caps_data_class = MBIM_DATA_CLASS_NONE;
|
||||||
g_autofree gchar *caps_custom_data_class_str;
|
g_autofree gchar *caps_custom_data_class_str = NULL;
|
||||||
|
|
||||||
self = g_task_get_source_object (task);
|
self = g_task_get_source_object (task);
|
||||||
ctx = g_task_get_task_data (task);
|
ctx = g_task_get_task_data (task);
|
||||||
@@ -3537,6 +3537,12 @@ query_device_services_ready (MbimDevice *device,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (service == MBIM_SERVICE_QDU) {
|
||||||
|
mm_obj_dbg (self, "Qualcomm Device Upgrade method mbim-qdu supported");
|
||||||
|
self->priv->is_qdu_supported = TRUE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* no optional features to check in remaining services */
|
/* no optional features to check in remaining services */
|
||||||
}
|
}
|
||||||
mbim_device_service_element_array_free (device_services);
|
mbim_device_service_element_array_free (device_services);
|
||||||
@@ -5504,7 +5510,7 @@ basic_connect_notification_subscriber_ready_status (MMBroadbandModemMbim *self,
|
|||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
gboolean active_sim_event = FALSE;
|
gboolean active_sim_event = FALSE;
|
||||||
|
|
||||||
if (self->priv->pending_sim_slot_switch_action) {
|
if (mm_iface_modem_is_primary_sim_slot_switch_ongoing (MM_IFACE_MODEM (self))) {
|
||||||
mm_obj_dbg (self, "ignoring slot status change");
|
mm_obj_dbg (self, "ignoring slot status change");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -5840,6 +5846,7 @@ static gboolean process_pdu_messages (MMBroadbandModemMbim *self,
|
|||||||
guint32 messages_count,
|
guint32 messages_count,
|
||||||
MbimSmsPduReadRecordArray *pdu_messages,
|
MbimSmsPduReadRecordArray *pdu_messages,
|
||||||
guint expected_index,
|
guint expected_index,
|
||||||
|
gboolean unstored,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -5864,6 +5871,7 @@ sms_notification_read_flash_sms (MMBroadbandModemMbim *self,
|
|||||||
messages_count,
|
messages_count,
|
||||||
pdu_messages,
|
pdu_messages,
|
||||||
SMS_PART_INVALID_INDEX,
|
SMS_PART_INVALID_INDEX,
|
||||||
|
TRUE,
|
||||||
&error))
|
&error))
|
||||||
mm_obj_dbg (self, "flash SMS message reading failed: %s", error->message);
|
mm_obj_dbg (self, "flash SMS message reading failed: %s", error->message);
|
||||||
}
|
}
|
||||||
@@ -5943,6 +5951,7 @@ alert_sms_read_query_ready (MbimDevice *device,
|
|||||||
messages_count,
|
messages_count,
|
||||||
pdu_messages,
|
pdu_messages,
|
||||||
ctx->expected_index,
|
ctx->expected_index,
|
||||||
|
FALSE,
|
||||||
&error))
|
&error))
|
||||||
mm_obj_dbg (ctx->self, "SMS message reading failed: %s", error->message);
|
mm_obj_dbg (ctx->self, "SMS message reading failed: %s", error->message);
|
||||||
|
|
||||||
@@ -6206,7 +6215,7 @@ ms_basic_connect_extensions_notification_slot_info_status (MMBroadbandModemMbim
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->priv->pending_sim_slot_switch_action) {
|
if (mm_iface_modem_is_primary_sim_slot_switch_ongoing (MM_IFACE_MODEM (self))) {
|
||||||
mm_obj_dbg (self, "ignoring slot status change in SIM slot %d: %s", slot_index + 1, mbim_uicc_slot_state_get_string (slot_state));
|
mm_obj_dbg (self, "ignoring slot status change in SIM slot %d: %s", slot_index + 1, mbim_uicc_slot_state_get_string (slot_state));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -9024,35 +9033,45 @@ load_initial_sms_parts_finish (MMIfaceModemMessaging *self,
|
|||||||
static void
|
static void
|
||||||
add_sms_part (MMBroadbandModemMbim *self,
|
add_sms_part (MMBroadbandModemMbim *self,
|
||||||
const MbimSmsPduReadRecord *pdu,
|
const MbimSmsPduReadRecord *pdu,
|
||||||
|
guint part_index,
|
||||||
guint expected_index)
|
guint expected_index)
|
||||||
{
|
{
|
||||||
MMSmsPart *part;
|
MMSmsPart *part;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
part = mm_sms_part_3gpp_new_from_binary_pdu (pdu->message_index,
|
part = mm_sms_part_3gpp_new_from_binary_pdu (part_index,
|
||||||
pdu->pdu_data,
|
pdu->pdu_data,
|
||||||
pdu->pdu_data_size,
|
pdu->pdu_data_size,
|
||||||
self,
|
self,
|
||||||
FALSE,
|
FALSE,
|
||||||
&error);
|
&error);
|
||||||
if (part) {
|
if (!part) {
|
||||||
mm_obj_dbg (self, "correctly parsed PDU (%d)", pdu->message_index);
|
|
||||||
if (expected_index != SMS_PART_INVALID_INDEX && (expected_index != mm_sms_part_get_index (part))) {
|
|
||||||
/* Some Fibocom L850 modems report an invalid part index (always 1) in the response
|
|
||||||
* message. Because we know which message part was requested, we can use that value
|
|
||||||
* instead to workaround this bug. */
|
|
||||||
mm_obj_dbg (self, "Expected SMS part index '%u' but device reports index '%u': using the expected one",
|
|
||||||
expected_index, mm_sms_part_get_index (part));
|
|
||||||
mm_sms_part_set_index (part, expected_index);
|
|
||||||
}
|
|
||||||
mm_iface_modem_messaging_take_part (MM_IFACE_MODEM_MESSAGING (self),
|
|
||||||
part,
|
|
||||||
mm_sms_state_from_mbim_message_status (pdu->message_status),
|
|
||||||
MM_SMS_STORAGE_MT);
|
|
||||||
} else {
|
|
||||||
/* Don't treat the error as critical */
|
/* Don't treat the error as critical */
|
||||||
mm_obj_dbg (self, "error parsing PDU (%d): %s",
|
mm_obj_dbg (self, "error parsing PDU (%d): %s",
|
||||||
pdu->message_index, error->message);
|
pdu->message_index, error->message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mm_obj_dbg (self, "correctly parsed PDU (%d)", pdu->message_index);
|
||||||
|
if (expected_index != SMS_PART_INVALID_INDEX && (expected_index != mm_sms_part_get_index (part))) {
|
||||||
|
/* Some Fibocom L850 modems report an invalid part index (always 1) in the response
|
||||||
|
* message. Because we know which message part was requested, we can use that value
|
||||||
|
* instead to workaround this bug. */
|
||||||
|
mm_obj_dbg (self, "Expected SMS part index '%u' but device reports index '%u': using the expected one",
|
||||||
|
expected_index, mm_sms_part_get_index (part));
|
||||||
|
mm_sms_part_set_index (part, expected_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mm_iface_modem_messaging_take_part (MM_IFACE_MODEM_MESSAGING (self),
|
||||||
|
mm_broadband_modem_create_sms (MM_BROADBAND_MODEM (self)),
|
||||||
|
part,
|
||||||
|
mm_sms_state_from_mbim_message_status (pdu->message_status),
|
||||||
|
MM_SMS_STORAGE_MT,
|
||||||
|
&error)) {
|
||||||
|
/* Don't treat the error as critical */
|
||||||
|
mm_obj_dbg (self, "error adding SMS (%d): %s",
|
||||||
|
pdu->message_index, error->message);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9062,6 +9081,7 @@ process_pdu_messages (MMBroadbandModemMbim *self,
|
|||||||
guint32 messages_count,
|
guint32 messages_count,
|
||||||
MbimSmsPduReadRecordArray *pdu_messages,
|
MbimSmsPduReadRecordArray *pdu_messages,
|
||||||
guint expected_index,
|
guint expected_index,
|
||||||
|
gboolean unstored,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
guint i;
|
guint i;
|
||||||
@@ -9087,11 +9107,26 @@ process_pdu_messages (MMBroadbandModemMbim *self,
|
|||||||
|
|
||||||
mm_obj_dbg (self, "%u SMS PDUs reported", messages_count);
|
mm_obj_dbg (self, "%u SMS PDUs reported", messages_count);
|
||||||
for (i = 0; i < messages_count; i++) {
|
for (i = 0; i < messages_count; i++) {
|
||||||
if (pdu_messages[i]) {
|
guint message_index;
|
||||||
mm_obj_dbg (self, "processing SMS PDU %u/%u...", i+1, messages_count);
|
|
||||||
add_sms_part (self, pdu_messages[i], expected_index);
|
if (!pdu_messages[i]) {
|
||||||
} else
|
|
||||||
mm_obj_dbg (self, "ignoring invalid SMS PDU %u/%u...", i+1, messages_count);
|
mm_obj_dbg (self, "ignoring invalid SMS PDU %u/%u...", i+1, messages_count);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
mm_obj_dbg (self, "processing SMS PDU %u/%u...", i+1, messages_count);
|
||||||
|
|
||||||
|
message_index = pdu_messages[i]->message_index;
|
||||||
|
if (unstored && message_index != 0) {
|
||||||
|
mm_obj_warn (self,
|
||||||
|
"processed unstored PDU with non-zero message index (%u)",
|
||||||
|
message_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
add_sms_part (self,
|
||||||
|
pdu_messages[i],
|
||||||
|
unstored ? SMS_PART_INVALID_INDEX : message_index,
|
||||||
|
expected_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -9126,6 +9161,7 @@ sms_read_query_ready (MbimDevice *device,
|
|||||||
messages_count,
|
messages_count,
|
||||||
pdu_messages,
|
pdu_messages,
|
||||||
SMS_PART_INVALID_INDEX,
|
SMS_PART_INVALID_INDEX,
|
||||||
|
FALSE,
|
||||||
&error))
|
&error))
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
else
|
else
|
||||||
@@ -9231,9 +9267,14 @@ enable_unsolicited_events_messaging (MMIfaceModemMessaging *_self,
|
|||||||
/* Create SMS (Messaging interface) */
|
/* Create SMS (Messaging interface) */
|
||||||
|
|
||||||
static MMBaseSms *
|
static MMBaseSms *
|
||||||
messaging_create_sms (MMIfaceModemMessaging *self)
|
messaging_create_sms (MMBroadbandModem *self)
|
||||||
{
|
{
|
||||||
return mm_sms_mbim_new (MM_BASE_MODEM (self));
|
MMSmsStorage default_storage;
|
||||||
|
|
||||||
|
default_storage = mm_iface_modem_messaging_get_default_storage (MM_IFACE_MODEM_MESSAGING (self));
|
||||||
|
return mm_sms_mbim_new (MM_BASE_MODEM (self),
|
||||||
|
mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self)),
|
||||||
|
default_storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -9967,8 +10008,6 @@ set_device_slot_mappings_ready (MbimDevice *device,
|
|||||||
|
|
||||||
self = g_task_get_source_object (task);
|
self = g_task_get_source_object (task);
|
||||||
|
|
||||||
g_assert (self->priv->pending_sim_slot_switch_action);
|
|
||||||
|
|
||||||
/* the slot index in MM starts at 1 */
|
/* the slot index in MM starts at 1 */
|
||||||
slot_number = GPOINTER_TO_UINT (g_task_get_task_data (task)) - 1;
|
slot_number = GPOINTER_TO_UINT (g_task_get_task_data (task)) - 1;
|
||||||
|
|
||||||
@@ -9979,7 +10018,6 @@ set_device_slot_mappings_ready (MbimDevice *device,
|
|||||||
&map_count,
|
&map_count,
|
||||||
&slot_mappings,
|
&slot_mappings,
|
||||||
&error)) {
|
&error)) {
|
||||||
self->priv->pending_sim_slot_switch_action = FALSE;
|
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
return;
|
return;
|
||||||
@@ -9988,13 +10026,9 @@ set_device_slot_mappings_ready (MbimDevice *device,
|
|||||||
for (i = 0; i < map_count; i++) {
|
for (i = 0; i < map_count; i++) {
|
||||||
if (i == self->priv->executor_index) {
|
if (i == self->priv->executor_index) {
|
||||||
if (slot_number != slot_mappings[i]->slot) {
|
if (slot_number != slot_mappings[i]->slot) {
|
||||||
self->priv->pending_sim_slot_switch_action = FALSE;
|
|
||||||
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND,
|
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND,
|
||||||
"SIM slot switch to '%u' failed", slot_number);
|
"SIM slot switch to '%u' failed", slot_number);
|
||||||
} else {
|
} else {
|
||||||
/* Keep pending_sim_slot_switch_action flag TRUE to cleanly ignore SIM related indications
|
|
||||||
* during slot switching, We don't want SIM related indications received trigger the update
|
|
||||||
* of SimSlots property, which may not be what we want as the modem object is being shutdown */
|
|
||||||
self->priv->active_slot_index = slot_number + 1;
|
self->priv->active_slot_index = slot_number + 1;
|
||||||
g_task_return_boolean (task, TRUE);
|
g_task_return_boolean (task, TRUE);
|
||||||
}
|
}
|
||||||
@@ -10004,7 +10038,6 @@ set_device_slot_mappings_ready (MbimDevice *device,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self->priv->pending_sim_slot_switch_action = FALSE;
|
|
||||||
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND,
|
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND,
|
||||||
"Can't find executor index '%u'", self->priv->executor_index);
|
"Can't find executor index '%u'", self->priv->executor_index);
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
@@ -10056,16 +10089,6 @@ before_set_query_device_slot_mappings_ready (MbimDevice *device,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flag a pending SIM slot switch operation, so that we can ignore slot state updates
|
|
||||||
* during the process. */
|
|
||||||
if (self->priv->pending_sim_slot_switch_action) {
|
|
||||||
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_IN_PROGRESS,
|
|
||||||
"there is already an ongoing SIM slot switch operation");
|
|
||||||
g_object_unref (task);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
self->priv->pending_sim_slot_switch_action = TRUE;
|
|
||||||
|
|
||||||
for (i = 0; i < map_count; i++) {
|
for (i = 0; i < map_count; i++) {
|
||||||
if (i == self->priv->executor_index)
|
if (i == self->priv->executor_index)
|
||||||
slot_mappings[i]->slot = slot_number;
|
slot_mappings[i]->slot = slot_number;
|
||||||
@@ -10345,11 +10368,43 @@ modem_firmware_load_update_settings_finish (MMIfaceModemFirmware *self,
|
|||||||
return mm_iface_modem_firmware_load_update_settings_in_port_finish (self, res, error);
|
return mm_iface_modem_firmware_load_update_settings_in_port_finish (self, res, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
modem_is_qdu_supported (MMBaseModem *modem,
|
||||||
|
MMKernelDevice *kernel_device)
|
||||||
|
{
|
||||||
|
return mm_kernel_device_get_global_property_as_boolean (kernel_device, "ID_MM_MBIM_QDU");
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
modem_firmware_load_update_settings (MMIfaceModemFirmware *self,
|
modem_firmware_load_update_settings (MMIfaceModemFirmware *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
GTask *task;
|
||||||
|
MMPortMbim *mbim_port;
|
||||||
|
MMKernelDevice *kernel_device;
|
||||||
|
MMModemFirmwareUpdateMethod update_methods;
|
||||||
|
g_autoptr(MMFirmwareUpdateSettings) update_settings = NULL;
|
||||||
|
|
||||||
|
/* Check first if 'mbim-qdu' is supported and selected via udev. If the
|
||||||
|
* update method 'mbim-qdu' is not supported and not selected via udev,
|
||||||
|
* then the generic update method 'firehose/sahara' are checked.
|
||||||
|
*/
|
||||||
|
update_methods = MM_MODEM_FIRMWARE_UPDATE_METHOD_NONE;
|
||||||
|
mbim_port = mm_broadband_modem_mbim_peek_port_mbim (MM_BROADBAND_MODEM_MBIM (self));
|
||||||
|
if (mbim_port) {
|
||||||
|
kernel_device = mm_port_peek_kernel_device (MM_PORT (mbim_port));
|
||||||
|
if ((MM_BROADBAND_MODEM_MBIM (self)->priv->is_qdu_supported) &&
|
||||||
|
modem_is_qdu_supported (MM_BASE_MODEM (self), kernel_device)) {
|
||||||
|
task = g_task_new (self, NULL, callback, user_data);
|
||||||
|
update_settings = mm_firmware_update_settings_new (update_methods);
|
||||||
|
mm_firmware_update_settings_set_method (update_settings, MM_MODEM_FIRMWARE_UPDATE_METHOD_MBIM_QDU);
|
||||||
|
g_task_return_pointer (task, g_object_ref (update_settings), (GDestroyNotify) g_object_unref);
|
||||||
|
g_object_unref (task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mm_iface_modem_firmware_load_update_settings_in_port (
|
mm_iface_modem_firmware_load_update_settings_in_port (
|
||||||
self,
|
self,
|
||||||
MM_PORT (mm_broadband_modem_mbim_peek_port_mbim (MM_BROADBAND_MODEM_MBIM (self))),
|
MM_PORT (mm_broadband_modem_mbim_peek_port_mbim (MM_BROADBAND_MODEM_MBIM (self))),
|
||||||
@@ -10416,10 +10471,6 @@ dispose (GObject *object)
|
|||||||
/* Explicitly remove notification handler */
|
/* Explicitly remove notification handler */
|
||||||
self->priv->setup_flags = PROCESS_NOTIFICATION_FLAG_NONE;
|
self->priv->setup_flags = PROCESS_NOTIFICATION_FLAG_NONE;
|
||||||
common_setup_cleanup_unsolicited_events_sync (self, mbim, FALSE);
|
common_setup_cleanup_unsolicited_events_sync (self, mbim, FALSE);
|
||||||
|
|
||||||
/* If we did open the MBIM port during initialization, close it now */
|
|
||||||
if (mm_port_mbim_is_open (mbim))
|
|
||||||
mm_port_mbim_close (mbim, NULL, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_clear_object (&self->priv->unlock_retries);
|
g_clear_object (&self->priv->unlock_retries);
|
||||||
@@ -10720,7 +10771,6 @@ iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface)
|
|||||||
iface->enable_unsolicited_events_finish = common_enable_disable_unsolicited_events_messaging_finish;
|
iface->enable_unsolicited_events_finish = common_enable_disable_unsolicited_events_messaging_finish;
|
||||||
iface->disable_unsolicited_events = disable_unsolicited_events_messaging;
|
iface->disable_unsolicited_events = disable_unsolicited_events_messaging;
|
||||||
iface->disable_unsolicited_events_finish = common_enable_disable_unsolicited_events_messaging_finish;
|
iface->disable_unsolicited_events_finish = common_enable_disable_unsolicited_events_messaging_finish;
|
||||||
iface->create_sms = messaging_create_sms;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -10790,6 +10840,7 @@ mm_broadband_modem_mbim_class_init (MMBroadbandModemMbimClass *klass)
|
|||||||
/* Do not initialize the MBIM modem through AT commands */
|
/* Do not initialize the MBIM modem through AT commands */
|
||||||
broadband_modem_class->enabling_modem_init = NULL;
|
broadband_modem_class->enabling_modem_init = NULL;
|
||||||
broadband_modem_class->enabling_modem_init_finish = NULL;
|
broadband_modem_class->enabling_modem_init_finish = NULL;
|
||||||
|
broadband_modem_class->create_sms = messaging_create_sms;
|
||||||
|
|
||||||
#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED
|
#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED
|
||||||
g_object_class_install_property (object_class, PROP_QMI_UNSUPPORTED,
|
g_object_class_install_property (object_class, PROP_QMI_UNSUPPORTED,
|
||||||
|
|||||||
+1095
-51
File diff suppressed because it is too large
Load Diff
+390
-283
File diff suppressed because it is too large
Load Diff
@@ -27,6 +27,7 @@
|
|||||||
#include "mm-modem-helpers.h"
|
#include "mm-modem-helpers.h"
|
||||||
#include "mm-charsets.h"
|
#include "mm-charsets.h"
|
||||||
#include "mm-base-modem.h"
|
#include "mm-base-modem.h"
|
||||||
|
#include "mm-base-sms.h"
|
||||||
|
|
||||||
#define MM_TYPE_BROADBAND_MODEM (mm_broadband_modem_get_type ())
|
#define MM_TYPE_BROADBAND_MODEM (mm_broadband_modem_get_type ())
|
||||||
#define MM_BROADBAND_MODEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM, MMBroadbandModem))
|
#define MM_BROADBAND_MODEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM, MMBroadbandModem))
|
||||||
@@ -105,6 +106,9 @@ struct _MMBroadbandModemClass {
|
|||||||
gint (* load_initial_eps_bearer_cid_finish) (MMBroadbandModem *self,
|
gint (* load_initial_eps_bearer_cid_finish) (MMBroadbandModem *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
/* Create SMS objects */
|
||||||
|
MMBaseSms * (* create_sms) (MMBroadbandModem *self);
|
||||||
};
|
};
|
||||||
|
|
||||||
GType mm_broadband_modem_get_type (void);
|
GType mm_broadband_modem_get_type (void);
|
||||||
@@ -126,30 +130,15 @@ gchar *mm_broadband_modem_create_device_identifier (MMBroadbandModem *self,
|
|||||||
const gchar *ati1,
|
const gchar *ati1,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
/* Locking/unlocking SMS storages */
|
|
||||||
void mm_broadband_modem_lock_sms_storages (MMBroadbandModem *self,
|
|
||||||
MMSmsStorage mem1, /* reading/listing/deleting */
|
|
||||||
MMSmsStorage mem2, /* storing/sending */
|
|
||||||
GAsyncReadyCallback callback,
|
|
||||||
gpointer user_data);
|
|
||||||
gboolean mm_broadband_modem_lock_sms_storages_finish (MMBroadbandModem *self,
|
|
||||||
GAsyncResult *res,
|
|
||||||
GError **error);
|
|
||||||
void mm_broadband_modem_unlock_sms_storages (MMBroadbandModem *self,
|
|
||||||
gboolean mem1,
|
|
||||||
gboolean mem2);
|
|
||||||
/* Helper to update SIM hot swap */
|
/* Helper to update SIM hot swap */
|
||||||
gboolean mm_broadband_modem_sim_hot_swap_ports_context_init (MMBroadbandModem *self,
|
gboolean mm_broadband_modem_sim_hot_swap_ports_context_init (MMBroadbandModem *self,
|
||||||
GError **error);
|
GError **error);
|
||||||
void mm_broadband_modem_sim_hot_swap_ports_context_reset (MMBroadbandModem *self);
|
void mm_broadband_modem_sim_hot_swap_ports_context_reset (MMBroadbandModem *self);
|
||||||
|
|
||||||
/* Helper to manage multiplexed bearers */
|
|
||||||
gboolean mm_broadband_modem_get_active_multiplexed_bearers (MMBroadbandModem *self,
|
|
||||||
guint *out_current,
|
|
||||||
guint *out_max,
|
|
||||||
GError **error);
|
|
||||||
|
|
||||||
/* Helper to manage initial EPS bearer */
|
/* Helper to manage initial EPS bearer */
|
||||||
gint mm_broadband_modem_get_initial_eps_bearer_cid (MMBroadbandModem *self);
|
gint mm_broadband_modem_get_initial_eps_bearer_cid (MMBroadbandModem *self);
|
||||||
|
|
||||||
|
/* Helper to create a new modem-specific SMS object */
|
||||||
|
MMBaseSms *mm_broadband_modem_create_sms (MMBroadbandModem *self);
|
||||||
|
|
||||||
#endif /* MM_BROADBAND_MODEM_H */
|
#endif /* MM_BROADBAND_MODEM_H */
|
||||||
|
|||||||
@@ -0,0 +1,474 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2015 Riccardo Vangelisti <riccardo.vangelisti@sadel.it>
|
||||||
|
* Copyright (C) 2019 Aleksander Morgado <aleksander@aleksander.es>
|
||||||
|
* Copyright (C) 2019 Purism SPC
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include <ModemManager.h>
|
||||||
|
#define _LIBMM_INSIDE_MM
|
||||||
|
#include <libmm-glib.h>
|
||||||
|
|
||||||
|
#include "mm-call-at.h"
|
||||||
|
#include "mm-base-modem-at.h"
|
||||||
|
#include "mm-base-modem.h"
|
||||||
|
#include "mm-modem-helpers.h"
|
||||||
|
#include "mm-error-helpers.h"
|
||||||
|
#include "mm-log-object.h"
|
||||||
|
#include "mm-bind.h"
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (MMCallAt, mm_call_at, MM_TYPE_BASE_CALL)
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FEATURE_SUPPORT_UNKNOWN,
|
||||||
|
FEATURE_NOT_SUPPORTED,
|
||||||
|
FEATURE_SUPPORTED,
|
||||||
|
} FeatureSupport;
|
||||||
|
|
||||||
|
struct _MMCallAtPrivate {
|
||||||
|
/* The modem which owns this call */
|
||||||
|
MMBaseModem *modem;
|
||||||
|
|
||||||
|
/* DTMF support */
|
||||||
|
FeatureSupport vtd_supported;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Start the CALL */
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
call_start_finish (MMBaseCall *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
return g_task_propagate_boolean (G_TASK (res), error);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_start_ready (MMBaseModem *modem,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GTask *task)
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
const gchar *response = NULL;
|
||||||
|
|
||||||
|
response = mm_base_modem_at_command_finish (modem, res, &error);
|
||||||
|
|
||||||
|
/* check response for error */
|
||||||
|
if (response && response[0])
|
||||||
|
error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
|
||||||
|
"Couldn't start the call: Unhandled response '%s'", response);
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
g_task_return_error (task, error);
|
||||||
|
else
|
||||||
|
g_task_return_boolean (task, TRUE);
|
||||||
|
g_object_unref (task);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_start (MMBaseCall *_self,
|
||||||
|
GCancellable *cancellable,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
MMCallAt *self = MM_CALL_AT (_self);
|
||||||
|
GError *error = NULL;
|
||||||
|
GTask *task;
|
||||||
|
gchar *cmd;
|
||||||
|
MMIfacePortAt *port;
|
||||||
|
|
||||||
|
task = g_task_new (self, NULL, callback, user_data);
|
||||||
|
|
||||||
|
port = mm_base_modem_peek_best_at_port (self->priv->modem, &error);
|
||||||
|
if (!port) {
|
||||||
|
g_task_return_error (task, error);
|
||||||
|
g_object_unref (task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd = g_strdup_printf ("ATD%s;", mm_gdbus_call_get_number (MM_GDBUS_CALL (self)));
|
||||||
|
mm_base_modem_at_command_full (self->priv->modem,
|
||||||
|
port,
|
||||||
|
cmd,
|
||||||
|
90,
|
||||||
|
FALSE, /* no cached */
|
||||||
|
FALSE, /* no raw */
|
||||||
|
cancellable,
|
||||||
|
(GAsyncReadyCallback)call_start_ready,
|
||||||
|
task);
|
||||||
|
g_free (cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Accept the call */
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
call_accept_finish (MMBaseCall *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
return g_task_propagate_boolean (G_TASK (res), error);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_accept_ready (MMBaseModem *modem,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GTask *task)
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
const gchar *response;
|
||||||
|
|
||||||
|
response = mm_base_modem_at_command_finish (modem, res, &error);
|
||||||
|
|
||||||
|
/* check response for error */
|
||||||
|
if (response && response[0])
|
||||||
|
g_set_error (&error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
|
||||||
|
"Couldn't accept the call: Unhandled response '%s'", response);
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
g_task_return_error (task, error);
|
||||||
|
else
|
||||||
|
g_task_return_boolean (task, TRUE);
|
||||||
|
g_object_unref (task);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_accept (MMBaseCall *_self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
MMCallAt *self = MM_CALL_AT (_self);
|
||||||
|
GTask *task;
|
||||||
|
|
||||||
|
task = g_task_new (self, NULL, callback, user_data);
|
||||||
|
mm_base_modem_at_command (self->priv->modem,
|
||||||
|
"ATA",
|
||||||
|
2,
|
||||||
|
FALSE,
|
||||||
|
(GAsyncReadyCallback)call_accept_ready,
|
||||||
|
task);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Deflect the call */
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
call_deflect_finish (MMBaseCall *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
return g_task_propagate_boolean (G_TASK (res), error);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_deflect_ready (MMBaseModem *modem,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GTask *task)
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
mm_base_modem_at_command_finish (modem, res, &error);
|
||||||
|
if (error)
|
||||||
|
g_task_return_error (task, error);
|
||||||
|
else
|
||||||
|
g_task_return_boolean (task, TRUE);
|
||||||
|
g_object_unref (task);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_deflect (MMBaseCall *_self,
|
||||||
|
const gchar *number,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
MMCallAt *self = MM_CALL_AT (_self);
|
||||||
|
GTask *task;
|
||||||
|
gchar *cmd;
|
||||||
|
|
||||||
|
task = g_task_new (self, NULL, callback, user_data);
|
||||||
|
|
||||||
|
cmd = g_strdup_printf ("+CTFR=%s", number);
|
||||||
|
mm_base_modem_at_command (self->priv->modem,
|
||||||
|
cmd,
|
||||||
|
20,
|
||||||
|
FALSE,
|
||||||
|
(GAsyncReadyCallback)call_deflect_ready,
|
||||||
|
task);
|
||||||
|
g_free (cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Hangup the call */
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
call_hangup_finish (MMBaseCall *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
return g_task_propagate_boolean (G_TASK (res), error);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
chup_ready (MMBaseModem *modem,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GTask *task)
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
mm_base_modem_at_command_finish (modem, res, &error);
|
||||||
|
if (error)
|
||||||
|
g_task_return_error (task, error);
|
||||||
|
else
|
||||||
|
g_task_return_boolean (task, TRUE);
|
||||||
|
g_object_unref (task);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
chup_fallback (GTask *task)
|
||||||
|
{
|
||||||
|
MMCallAt *self;
|
||||||
|
|
||||||
|
self = MM_CALL_AT (g_task_get_source_object (task));
|
||||||
|
mm_base_modem_at_command (self->priv->modem,
|
||||||
|
"+CHUP",
|
||||||
|
2,
|
||||||
|
FALSE,
|
||||||
|
(GAsyncReadyCallback)chup_ready,
|
||||||
|
task);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
chld_hangup_ready (MMBaseModem *modem,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GTask *task)
|
||||||
|
{
|
||||||
|
MMBaseCall *self;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
self = g_task_get_source_object (task);
|
||||||
|
|
||||||
|
mm_base_modem_at_command_finish (modem, res, &error);
|
||||||
|
if (error) {
|
||||||
|
mm_obj_warn (self, "couldn't hangup single call with call id '%u': %s",
|
||||||
|
mm_base_call_get_index (MM_BASE_CALL (self)), error->message);
|
||||||
|
g_error_free (error);
|
||||||
|
chup_fallback (task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_task_return_boolean (task, TRUE);
|
||||||
|
g_object_unref (task);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_hangup (MMBaseCall *_self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
MMCallAt *self = MM_CALL_AT (_self);
|
||||||
|
GTask *task;
|
||||||
|
guint index;
|
||||||
|
|
||||||
|
task = g_task_new (self, NULL, callback, user_data);
|
||||||
|
|
||||||
|
/* Try to hangup the single call id */
|
||||||
|
index = mm_base_call_get_index (MM_BASE_CALL (self));
|
||||||
|
if (index) {
|
||||||
|
gchar *cmd;
|
||||||
|
|
||||||
|
cmd = g_strdup_printf ("+CHLD=1%u", index);
|
||||||
|
mm_base_modem_at_command (self->priv->modem,
|
||||||
|
cmd,
|
||||||
|
2,
|
||||||
|
FALSE,
|
||||||
|
(GAsyncReadyCallback)chld_hangup_ready,
|
||||||
|
task);
|
||||||
|
g_free (cmd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* otherwise terminate all */
|
||||||
|
chup_fallback (task);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Send DTMF tone to call */
|
||||||
|
|
||||||
|
static gssize
|
||||||
|
call_send_dtmf_finish (MMBaseCall *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
return g_task_propagate_int (G_TASK (res), error);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_send_dtmf_ready (MMBaseModem *modem,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GTask *task)
|
||||||
|
{
|
||||||
|
MMBaseCall *self;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
self = g_task_get_source_object (task);
|
||||||
|
|
||||||
|
mm_base_modem_at_command_finish (modem, res, &error);
|
||||||
|
if (error) {
|
||||||
|
mm_obj_dbg (self, "couldn't send dtmf: %s", error->message);
|
||||||
|
g_task_return_error (task, error);
|
||||||
|
g_object_unref (task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We sent one character */
|
||||||
|
g_task_return_int (task, 1);
|
||||||
|
g_object_unref (task);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
send_dtmf_digit (MMCallAt *self,
|
||||||
|
GTask *task,
|
||||||
|
const gchar dtmf_digit)
|
||||||
|
{
|
||||||
|
g_autofree gchar *cmd = NULL;
|
||||||
|
|
||||||
|
cmd = g_strdup_printf ("AT+VTS=%c", dtmf_digit);
|
||||||
|
mm_base_modem_at_command (self->priv->modem,
|
||||||
|
cmd,
|
||||||
|
3,
|
||||||
|
FALSE,
|
||||||
|
(GAsyncReadyCallback)call_send_dtmf_ready,
|
||||||
|
task);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_dtmf_vtd_ready (MMBaseModem *modem,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GTask *task)
|
||||||
|
{
|
||||||
|
MMCallAt *self;
|
||||||
|
g_autoptr(GError) error = NULL;
|
||||||
|
gchar dtmf_digit;
|
||||||
|
|
||||||
|
self = g_task_get_source_object (task);
|
||||||
|
|
||||||
|
mm_base_modem_at_command_finish (modem, res, &error);
|
||||||
|
self->priv->vtd_supported = error ? FEATURE_NOT_SUPPORTED : FEATURE_SUPPORTED;
|
||||||
|
|
||||||
|
dtmf_digit = (gchar) GPOINTER_TO_UINT (g_task_get_task_data (task));
|
||||||
|
send_dtmf_digit (self, task, dtmf_digit);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_send_dtmf (MMBaseCall *_self,
|
||||||
|
const gchar *dtmf,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
MMCallAt *self = MM_CALL_AT (_self);
|
||||||
|
GTask *task;
|
||||||
|
g_autofree gchar *cmd = NULL;
|
||||||
|
|
||||||
|
task = g_task_new (self, NULL, callback, user_data);
|
||||||
|
|
||||||
|
if (self->priv->vtd_supported == FEATURE_NOT_SUPPORTED) {
|
||||||
|
send_dtmf_digit (self, task, dtmf[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_task_set_task_data (task, GUINT_TO_POINTER (dtmf[0]), NULL);
|
||||||
|
|
||||||
|
/* Otherwise try to set duration */
|
||||||
|
cmd = g_strdup_printf ("AT+VTD=%u", mm_base_call_get_dtmf_tone_duration (_self));
|
||||||
|
mm_base_modem_at_command (self->priv->modem,
|
||||||
|
cmd,
|
||||||
|
3,
|
||||||
|
FALSE,
|
||||||
|
(GAsyncReadyCallback)call_dtmf_vtd_ready,
|
||||||
|
task);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
MMBaseCall *
|
||||||
|
mm_call_at_new (MMBaseModem *modem,
|
||||||
|
GObject *bind_to,
|
||||||
|
MMCallDirection direction,
|
||||||
|
const gchar *number,
|
||||||
|
const guint dtmf_tone_duration,
|
||||||
|
gboolean skip_incoming_timeout,
|
||||||
|
gboolean supports_dialing_to_ringing,
|
||||||
|
gboolean supports_ringing_to_active)
|
||||||
|
{
|
||||||
|
MMBaseCall *call;
|
||||||
|
|
||||||
|
call = MM_BASE_CALL (g_object_new (MM_TYPE_CALL_AT,
|
||||||
|
MM_BASE_CALL_IFACE_MODEM_VOICE, modem,
|
||||||
|
MM_BIND_TO, bind_to,
|
||||||
|
MM_CALL_DIRECTION, direction,
|
||||||
|
MM_CALL_NUMBER, number,
|
||||||
|
MM_CALL_DTMF_TONE_DURATION, dtmf_tone_duration,
|
||||||
|
MM_BASE_CALL_SKIP_INCOMING_TIMEOUT, skip_incoming_timeout,
|
||||||
|
MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING, supports_dialing_to_ringing,
|
||||||
|
MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE, supports_ringing_to_active,
|
||||||
|
NULL));
|
||||||
|
MM_CALL_AT (call)->priv->modem = g_object_ref (modem);
|
||||||
|
return call;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
mm_call_at_init (MMCallAt *self)
|
||||||
|
{
|
||||||
|
/* Initialize private data */
|
||||||
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_CALL_AT, MMCallAtPrivate);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
dispose (GObject *object)
|
||||||
|
{
|
||||||
|
MMCallAt *self = MM_CALL_AT (object);
|
||||||
|
|
||||||
|
g_clear_object (&self->priv->modem);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (mm_call_at_parent_class)->dispose (object);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
mm_call_at_class_init (MMCallAtClass *klass)
|
||||||
|
{
|
||||||
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
MMBaseCallClass *base_call_class = MM_BASE_CALL_CLASS (klass);
|
||||||
|
|
||||||
|
g_type_class_add_private (object_class, sizeof (MMCallAtPrivate));
|
||||||
|
|
||||||
|
object_class->dispose = dispose;
|
||||||
|
|
||||||
|
base_call_class->start = call_start;
|
||||||
|
base_call_class->start_finish = call_start_finish;
|
||||||
|
base_call_class->accept = call_accept;
|
||||||
|
base_call_class->accept_finish = call_accept_finish;
|
||||||
|
base_call_class->deflect = call_deflect;
|
||||||
|
base_call_class->deflect_finish = call_deflect_finish;
|
||||||
|
base_call_class->hangup = call_hangup;
|
||||||
|
base_call_class->hangup_finish = call_hangup_finish;
|
||||||
|
base_call_class->send_dtmf = call_send_dtmf;
|
||||||
|
base_call_class->send_dtmf_finish = call_send_dtmf_finish;
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2015 Riccardo Vangelisti <riccardo.vangelisti@sadel.it>
|
||||||
|
* Copyright (C) 2019 Purism SPC
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MM_CALL_AT_H
|
||||||
|
#define MM_CALL_AT_H
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
#define _LIBMM_INSIDE_MM
|
||||||
|
#include <libmm-glib.h>
|
||||||
|
|
||||||
|
#include "mm-base-call.h"
|
||||||
|
#include "mm-base-modem.h"
|
||||||
|
|
||||||
|
#define MM_TYPE_CALL_AT (mm_call_at_get_type ())
|
||||||
|
#define MM_CALL_AT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_CALL_AT, MMCallAt))
|
||||||
|
#define MM_CALL_AT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_CALL_AT, MMCallAtClass))
|
||||||
|
#define MM_IS_CALL_AT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_CALL_AT))
|
||||||
|
#define MM_IS_CALL_AT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_CALL_AT))
|
||||||
|
#define MM_CALL_AT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_CALL_AT, MMCallAtClass))
|
||||||
|
|
||||||
|
typedef struct _MMCallAt MMCallAt;
|
||||||
|
typedef struct _MMCallAtClass MMCallAtClass;
|
||||||
|
typedef struct _MMCallAtPrivate MMCallAtPrivate;
|
||||||
|
|
||||||
|
struct _MMCallAt {
|
||||||
|
MMBaseCall parent;
|
||||||
|
MMCallAtPrivate *priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MMCallAtClass {
|
||||||
|
MMBaseCallClass parent;
|
||||||
|
};
|
||||||
|
|
||||||
|
GType mm_call_at_get_type (void);
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCallAt, g_object_unref)
|
||||||
|
|
||||||
|
MMBaseCall *mm_call_at_new (MMBaseModem *modem,
|
||||||
|
GObject *bind_to,
|
||||||
|
MMCallDirection direction,
|
||||||
|
const gchar *number,
|
||||||
|
const guint dtmf_tone_duration,
|
||||||
|
gboolean skip_incoming_timeout,
|
||||||
|
gboolean supports_dialing_to_ringing,
|
||||||
|
gboolean supports_ringing_to_active);
|
||||||
|
|
||||||
|
#endif /* MM_CALL_AT_H */
|
||||||
+2
-63
@@ -24,20 +24,12 @@
|
|||||||
#define _LIBMM_INSIDE_MM
|
#define _LIBMM_INSIDE_MM
|
||||||
#include <libmm-glib.h>
|
#include <libmm-glib.h>
|
||||||
|
|
||||||
#include "mm-iface-modem-messaging.h"
|
|
||||||
#include "mm-call-list.h"
|
#include "mm-call-list.h"
|
||||||
#include "mm-base-call.h"
|
#include "mm-base-call.h"
|
||||||
#include "mm-log.h"
|
#include "mm-log.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (MMCallList, mm_call_list, G_TYPE_OBJECT)
|
G_DEFINE_TYPE (MMCallList, mm_call_list, G_TYPE_OBJECT)
|
||||||
|
|
||||||
enum {
|
|
||||||
PROP_0,
|
|
||||||
PROP_MODEM,
|
|
||||||
PROP_LAST
|
|
||||||
};
|
|
||||||
static GParamSpec *properties[PROP_LAST];
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SIGNAL_CALL_ADDED,
|
SIGNAL_CALL_ADDED,
|
||||||
SIGNAL_CALL_DELETED,
|
SIGNAL_CALL_DELETED,
|
||||||
@@ -46,8 +38,6 @@ enum {
|
|||||||
static guint signals[SIGNAL_LAST];
|
static guint signals[SIGNAL_LAST];
|
||||||
|
|
||||||
struct _MMCallListPrivate {
|
struct _MMCallListPrivate {
|
||||||
/* The owner modem */
|
|
||||||
MMBaseModem *modem;
|
|
||||||
/* List of call objects */
|
/* List of call objects */
|
||||||
GList *list;
|
GList *list;
|
||||||
};
|
};
|
||||||
@@ -213,49 +203,10 @@ mm_call_list_add_call (MMCallList *self,
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
MMCallList *
|
MMCallList *
|
||||||
mm_call_list_new (MMBaseModem *modem)
|
mm_call_list_new (void)
|
||||||
{
|
{
|
||||||
/* Create the object */
|
/* Create the object */
|
||||||
return g_object_new (MM_TYPE_CALL_LIST,
|
return g_object_new (MM_TYPE_CALL_LIST, NULL);
|
||||||
MM_CALL_LIST_MODEM, modem,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
const GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
MMCallList *self = MM_CALL_LIST (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_MODEM:
|
|
||||||
g_clear_object (&self->priv->modem);
|
|
||||||
self->priv->modem = g_value_dup_object (value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
MMCallList *self = MM_CALL_LIST (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_MODEM:
|
|
||||||
g_value_set_object (value, self->priv->modem);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -272,7 +223,6 @@ dispose (GObject *object)
|
|||||||
{
|
{
|
||||||
MMCallList *self = MM_CALL_LIST (object);
|
MMCallList *self = MM_CALL_LIST (object);
|
||||||
|
|
||||||
g_clear_object (&self->priv->modem);
|
|
||||||
g_list_free_full (self->priv->list, g_object_unref);
|
g_list_free_full (self->priv->list, g_object_unref);
|
||||||
self->priv->list = NULL;
|
self->priv->list = NULL;
|
||||||
|
|
||||||
@@ -287,19 +237,8 @@ mm_call_list_class_init (MMCallListClass *klass)
|
|||||||
g_type_class_add_private (object_class, sizeof (MMCallListPrivate));
|
g_type_class_add_private (object_class, sizeof (MMCallListPrivate));
|
||||||
|
|
||||||
/* Virtual methods */
|
/* Virtual methods */
|
||||||
object_class->get_property = get_property;
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->dispose = dispose;
|
object_class->dispose = dispose;
|
||||||
|
|
||||||
/* Properties */
|
|
||||||
properties[PROP_MODEM] =
|
|
||||||
g_param_spec_object (MM_CALL_LIST_MODEM,
|
|
||||||
"Modem",
|
|
||||||
"The Modem which owns this CALL list",
|
|
||||||
MM_TYPE_BASE_MODEM,
|
|
||||||
G_PARAM_READWRITE);
|
|
||||||
g_object_class_install_property (object_class, PROP_MODEM, properties[PROP_MODEM]);
|
|
||||||
|
|
||||||
/* Signals */
|
/* Signals */
|
||||||
signals[SIGNAL_CALL_ADDED] =
|
signals[SIGNAL_CALL_ADDED] =
|
||||||
g_signal_new (MM_CALL_ADDED,
|
g_signal_new (MM_CALL_ADDED,
|
||||||
|
|||||||
+1
-4
@@ -19,7 +19,6 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "mm-base-modem.h"
|
|
||||||
#include "mm-base-call.h"
|
#include "mm-base-call.h"
|
||||||
|
|
||||||
#define MM_TYPE_CALL_LIST (mm_call_list_get_type ())
|
#define MM_TYPE_CALL_LIST (mm_call_list_get_type ())
|
||||||
@@ -33,8 +32,6 @@ typedef struct _MMCallList MMCallList;
|
|||||||
typedef struct _MMCallListClass MMCallListClass;
|
typedef struct _MMCallListClass MMCallListClass;
|
||||||
typedef struct _MMCallListPrivate MMCallListPrivate;
|
typedef struct _MMCallListPrivate MMCallListPrivate;
|
||||||
|
|
||||||
#define MM_CALL_LIST_MODEM "call-list-modem"
|
|
||||||
|
|
||||||
#define MM_CALL_ADDED "call-added"
|
#define MM_CALL_ADDED "call-added"
|
||||||
#define MM_CALL_DELETED "call-deleted"
|
#define MM_CALL_DELETED "call-deleted"
|
||||||
|
|
||||||
@@ -57,7 +54,7 @@ struct _MMCallListClass {
|
|||||||
GType mm_call_list_get_type (void);
|
GType mm_call_list_get_type (void);
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCallList, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCallList, g_object_unref)
|
||||||
|
|
||||||
MMCallList *mm_call_list_new (MMBaseModem *modem);
|
MMCallList *mm_call_list_new (void);
|
||||||
|
|
||||||
GStrv mm_call_list_get_paths (MMCallList *self);
|
GStrv mm_call_list_get_paths (MMCallList *self);
|
||||||
guint mm_call_list_get_count (MMCallList *self);
|
guint mm_call_list_get_count (MMCallList *self);
|
||||||
|
|||||||
+140
-95
@@ -31,9 +31,15 @@
|
|||||||
#include "mm-call-qmi.h"
|
#include "mm-call-qmi.h"
|
||||||
#include "mm-base-modem.h"
|
#include "mm-base-modem.h"
|
||||||
#include "mm-log-object.h"
|
#include "mm-log-object.h"
|
||||||
|
#include "mm-bind.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (MMCallQmi, mm_call_qmi, MM_TYPE_BASE_CALL)
|
G_DEFINE_TYPE (MMCallQmi, mm_call_qmi, MM_TYPE_BASE_CALL)
|
||||||
|
|
||||||
|
struct _MMCallQmiPrivate {
|
||||||
|
/* The modem which owns this call */
|
||||||
|
MMBaseModem *modem;
|
||||||
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -47,12 +53,7 @@ ensure_qmi_client (MMCallQmi *self,
|
|||||||
QmiClient *client;
|
QmiClient *client;
|
||||||
MMPortQmi *port;
|
MMPortQmi *port;
|
||||||
|
|
||||||
g_object_get (self,
|
port = mm_broadband_modem_qmi_peek_port_qmi (MM_BROADBAND_MODEM_QMI (self->priv->modem));
|
||||||
MM_BASE_CALL_MODEM, &modem,
|
|
||||||
NULL);
|
|
||||||
g_assert (MM_IS_BASE_MODEM (modem));
|
|
||||||
|
|
||||||
port = mm_broadband_modem_qmi_peek_port_qmi (MM_BROADBAND_MODEM_QMI (modem));
|
|
||||||
g_object_unref (modem);
|
g_object_unref (modem);
|
||||||
|
|
||||||
if (!port) {
|
if (!port) {
|
||||||
@@ -330,22 +331,41 @@ call_hangup (MMBaseCall *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Send DTMF character */
|
/* DTMF handling */
|
||||||
|
|
||||||
typedef struct {
|
static gboolean
|
||||||
QmiClient *client;
|
get_client_and_call_id (MMCallQmi *self,
|
||||||
guint8 call_id;
|
GAsyncReadyCallback callback,
|
||||||
} SendDtmfContext;
|
gpointer user_data,
|
||||||
|
QmiClient **client,
|
||||||
static void
|
guint *call_id)
|
||||||
send_dtmf_context_free (SendDtmfContext *ctx)
|
|
||||||
{
|
{
|
||||||
g_clear_object (&ctx->client);
|
g_return_val_if_fail (client, FALSE);
|
||||||
g_slice_free (SendDtmfContext, ctx);
|
g_return_val_if_fail (call_id, FALSE);
|
||||||
|
|
||||||
|
/* Ensure Voice client */
|
||||||
|
if (!ensure_qmi_client (self,
|
||||||
|
QMI_SERVICE_VOICE, client,
|
||||||
|
callback, user_data))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
*call_id = mm_base_call_get_index (MM_BASE_CALL (self));
|
||||||
|
if (*call_id == 0) {
|
||||||
|
g_task_report_new_error (self,
|
||||||
|
callback,
|
||||||
|
user_data,
|
||||||
|
(gpointer) __func__,
|
||||||
|
MM_CORE_ERROR,
|
||||||
|
MM_CORE_ERROR_INVALID_ARGS,
|
||||||
|
"Invalid call index");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
call_send_dtmf_finish (MMBaseCall *self,
|
call_stop_dtmf_finish (MMBaseCall *call,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
@@ -365,35 +385,59 @@ voice_stop_continuous_dtmf_ready (QmiClientVoice *client,
|
|||||||
g_prefix_error (&error, "QMI operation failed: ");
|
g_prefix_error (&error, "QMI operation failed: ");
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
} else if (!qmi_message_voice_stop_continuous_dtmf_output_get_result (output, &error)) {
|
} else if (!qmi_message_voice_stop_continuous_dtmf_output_get_result (output, &error)) {
|
||||||
g_prefix_error (&error, "Couldn't send DTMF character: ");
|
g_prefix_error (&error, "Couldn't stop DTMF character: ");
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
} else {
|
} else {
|
||||||
g_task_return_boolean (task, TRUE);
|
g_task_return_boolean (task, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static void
|
||||||
voice_stop_continuous_dtmf (GTask *task)
|
call_stop_dtmf (MMBaseCall *_self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
SendDtmfContext *ctx;
|
MMCallQmi *self = MM_CALL_QMI (_self);
|
||||||
GError *error = NULL;
|
GTask *task;
|
||||||
g_autoptr (QmiMessageVoiceStopContinuousDtmfInput) input = NULL;
|
QmiClient *client = NULL;
|
||||||
|
guint call_id = 0;
|
||||||
|
GError *error = NULL;
|
||||||
|
g_autoptr (QmiMessageVoiceStopContinuousDtmfInput) input = NULL;
|
||||||
|
|
||||||
ctx = g_task_get_task_data (task);
|
if (!get_client_and_call_id (self,
|
||||||
|
callback,
|
||||||
|
user_data,
|
||||||
|
&client,
|
||||||
|
&call_id))
|
||||||
|
return;
|
||||||
|
|
||||||
|
task = g_task_new (self, NULL, callback, user_data);
|
||||||
|
|
||||||
input = qmi_message_voice_stop_continuous_dtmf_input_new ();
|
input = qmi_message_voice_stop_continuous_dtmf_input_new ();
|
||||||
qmi_message_voice_stop_continuous_dtmf_input_set_data (input, ctx->call_id, &error);
|
if (!qmi_message_voice_stop_continuous_dtmf_input_set_data (input,
|
||||||
|
call_id,
|
||||||
|
&error)) {
|
||||||
|
g_task_return_error (task, error);
|
||||||
|
g_object_unref (task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
qmi_client_voice_stop_continuous_dtmf (QMI_CLIENT_VOICE (ctx->client),
|
/* Stop sending DTMF tone */
|
||||||
|
qmi_client_voice_stop_continuous_dtmf (QMI_CLIENT_VOICE (client),
|
||||||
input,
|
input,
|
||||||
5,
|
5,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) voice_stop_continuous_dtmf_ready,
|
(GAsyncReadyCallback) voice_stop_continuous_dtmf_ready,
|
||||||
task);
|
task);
|
||||||
|
}
|
||||||
|
|
||||||
return G_SOURCE_REMOVE;
|
static gssize
|
||||||
|
call_send_dtmf_finish (MMBaseCall *call,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
return g_task_propagate_int (G_TASK (res), error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -401,80 +445,55 @@ voice_start_continuous_dtmf_ready (QmiClientVoice *client,
|
|||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GTask *task)
|
GTask *task)
|
||||||
{
|
{
|
||||||
g_autoptr(QmiMessageVoiceStartContinuousDtmfOutput) output = NULL;
|
g_autoptr (QmiMessageVoiceStartContinuousDtmfOutput) output = NULL;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
output = qmi_client_voice_start_continuous_dtmf_finish (client, res, &error);
|
output = qmi_client_voice_start_continuous_dtmf_finish (client, res, &error);
|
||||||
if (!output) {
|
if (!output) {
|
||||||
g_prefix_error (&error, "QMI operation failed: ");
|
g_prefix_error (&error, "QMI operation failed: ");
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
g_object_unref (task);
|
} else if (!qmi_message_voice_start_continuous_dtmf_output_get_result (output, &error)) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!qmi_message_voice_start_continuous_dtmf_output_get_result (output, &error)) {
|
|
||||||
g_prefix_error (&error, "Couldn't send DTMF character: ");
|
g_prefix_error (&error, "Couldn't send DTMF character: ");
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
|
} else {
|
||||||
|
g_task_return_int (task, 1);
|
||||||
|
}
|
||||||
|
g_object_unref (task);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_send_dtmf (MMBaseCall *_self,
|
||||||
|
const gchar *dtmf,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
MMCallQmi *self = MM_CALL_QMI (_self);
|
||||||
|
GTask *task;
|
||||||
|
QmiClient *client = NULL;
|
||||||
|
guint call_id = 0;
|
||||||
|
GError *error = NULL;
|
||||||
|
g_autoptr (QmiMessageVoiceStartContinuousDtmfInput) input = NULL;
|
||||||
|
|
||||||
|
if (!get_client_and_call_id (self,
|
||||||
|
callback,
|
||||||
|
user_data,
|
||||||
|
&client,
|
||||||
|
&call_id))
|
||||||
|
return;
|
||||||
|
|
||||||
|
task = g_task_new (self, NULL, callback, user_data);
|
||||||
|
|
||||||
|
input = qmi_message_voice_start_continuous_dtmf_input_new ();
|
||||||
|
if (!qmi_message_voice_start_continuous_dtmf_input_set_data (input,
|
||||||
|
call_id,
|
||||||
|
dtmf[0],
|
||||||
|
&error)) {
|
||||||
|
g_task_return_error (task, error);
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Disable DTMF press after 500 ms */
|
|
||||||
g_timeout_add (500, (GSourceFunc) voice_stop_continuous_dtmf, task);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
call_send_dtmf (MMBaseCall *self,
|
|
||||||
const gchar *dtmf,
|
|
||||||
GAsyncReadyCallback callback,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GTask *task;
|
|
||||||
GError *error = NULL;
|
|
||||||
SendDtmfContext *ctx;
|
|
||||||
QmiClient *client = NULL;
|
|
||||||
guint8 call_id;
|
|
||||||
g_autoptr (QmiMessageVoiceStartContinuousDtmfInput) input = NULL;
|
|
||||||
|
|
||||||
/* Ensure Voice client */
|
|
||||||
if (!ensure_qmi_client (MM_CALL_QMI (self),
|
|
||||||
QMI_SERVICE_VOICE, &client,
|
|
||||||
callback, user_data))
|
|
||||||
return;
|
|
||||||
|
|
||||||
task = g_task_new (self, NULL, callback, user_data);
|
|
||||||
|
|
||||||
call_id = mm_base_call_get_index (self);
|
|
||||||
if (call_id == 0) {
|
|
||||||
g_task_return_new_error (task,
|
|
||||||
MM_CORE_ERROR,
|
|
||||||
MM_CORE_ERROR_INVALID_ARGS,
|
|
||||||
"Invalid call index");
|
|
||||||
g_object_unref (task);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx = g_slice_new0 (SendDtmfContext);
|
|
||||||
ctx->client = g_object_ref (client);
|
|
||||||
ctx->call_id = call_id;
|
|
||||||
|
|
||||||
g_task_set_task_data (task, ctx, (GDestroyNotify) send_dtmf_context_free);
|
|
||||||
|
|
||||||
/* Send DTMF character as ASCII number */
|
/* Send DTMF character as ASCII number */
|
||||||
input = qmi_message_voice_start_continuous_dtmf_input_new ();
|
|
||||||
qmi_message_voice_start_continuous_dtmf_input_set_data (input,
|
|
||||||
call_id,
|
|
||||||
(guint8) dtmf[0],
|
|
||||||
&error);
|
|
||||||
if (error) {
|
|
||||||
g_task_return_new_error (task,
|
|
||||||
MM_CORE_ERROR,
|
|
||||||
MM_CORE_ERROR_INVALID_ARGS,
|
|
||||||
"DTMF data build failed");
|
|
||||||
g_object_unref (task);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
qmi_client_voice_start_continuous_dtmf (QMI_CLIENT_VOICE (client),
|
qmi_client_voice_start_continuous_dtmf (QMI_CLIENT_VOICE (client),
|
||||||
input,
|
input,
|
||||||
5,
|
5,
|
||||||
@@ -488,28 +507,52 @@ call_send_dtmf (MMBaseCall *self,
|
|||||||
MMBaseCall *
|
MMBaseCall *
|
||||||
mm_call_qmi_new (MMBaseModem *modem,
|
mm_call_qmi_new (MMBaseModem *modem,
|
||||||
MMCallDirection direction,
|
MMCallDirection direction,
|
||||||
const gchar *number)
|
const gchar *number,
|
||||||
|
const guint dtmf_tone_duration)
|
||||||
{
|
{
|
||||||
return MM_BASE_CALL (g_object_new (MM_TYPE_CALL_QMI,
|
MMBaseCall *call;
|
||||||
MM_BASE_CALL_MODEM, modem,
|
|
||||||
"direction", direction,
|
call = MM_BASE_CALL (g_object_new (MM_TYPE_CALL_QMI,
|
||||||
"number", number,
|
MM_BASE_CALL_IFACE_MODEM_VOICE, modem,
|
||||||
|
MM_BIND_TO, modem,
|
||||||
|
MM_CALL_DIRECTION, direction,
|
||||||
|
MM_CALL_NUMBER, number,
|
||||||
|
MM_CALL_DTMF_TONE_DURATION, dtmf_tone_duration,
|
||||||
MM_BASE_CALL_SKIP_INCOMING_TIMEOUT, TRUE,
|
MM_BASE_CALL_SKIP_INCOMING_TIMEOUT, TRUE,
|
||||||
MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING, TRUE,
|
MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING, TRUE,
|
||||||
MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE, TRUE,
|
MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE, TRUE,
|
||||||
NULL));
|
NULL));
|
||||||
|
MM_CALL_QMI (call)->priv->modem = g_object_ref (modem);
|
||||||
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mm_call_qmi_init (MMCallQmi *self)
|
mm_call_qmi_init (MMCallQmi *self)
|
||||||
{
|
{
|
||||||
|
/* Initialize private data */
|
||||||
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_CALL_QMI, MMCallQmiPrivate);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
dispose (GObject *object)
|
||||||
|
{
|
||||||
|
MMCallQmi *self = MM_CALL_QMI (object);
|
||||||
|
|
||||||
|
g_clear_object (&self->priv->modem);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (mm_call_qmi_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mm_call_qmi_class_init (MMCallQmiClass *klass)
|
mm_call_qmi_class_init (MMCallQmiClass *klass)
|
||||||
{
|
{
|
||||||
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
MMBaseCallClass *base_call_class = MM_BASE_CALL_CLASS (klass);
|
MMBaseCallClass *base_call_class = MM_BASE_CALL_CLASS (klass);
|
||||||
|
|
||||||
|
g_type_class_add_private (object_class, sizeof (MMCallQmiPrivate));
|
||||||
|
|
||||||
|
object_class->dispose = dispose;
|
||||||
|
|
||||||
base_call_class->start = call_start;
|
base_call_class->start = call_start;
|
||||||
base_call_class->start_finish = call_start_finish;
|
base_call_class->start_finish = call_start_finish;
|
||||||
base_call_class->accept = call_accept;
|
base_call_class->accept = call_accept;
|
||||||
@@ -518,4 +561,6 @@ mm_call_qmi_class_init (MMCallQmiClass *klass)
|
|||||||
base_call_class->hangup_finish = call_hangup_finish;
|
base_call_class->hangup_finish = call_hangup_finish;
|
||||||
base_call_class->send_dtmf = call_send_dtmf;
|
base_call_class->send_dtmf = call_send_dtmf;
|
||||||
base_call_class->send_dtmf_finish = call_send_dtmf_finish;
|
base_call_class->send_dtmf_finish = call_send_dtmf_finish;
|
||||||
|
base_call_class->stop_dtmf = call_stop_dtmf;
|
||||||
|
base_call_class->stop_dtmf_finish = call_stop_dtmf_finish;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -33,9 +33,11 @@
|
|||||||
|
|
||||||
typedef struct _MMCallQmi MMCallQmi;
|
typedef struct _MMCallQmi MMCallQmi;
|
||||||
typedef struct _MMCallQmiClass MMCallQmiClass;
|
typedef struct _MMCallQmiClass MMCallQmiClass;
|
||||||
|
typedef struct _MMCallQmiPrivate MMCallQmiPrivate;
|
||||||
|
|
||||||
struct _MMCallQmi {
|
struct _MMCallQmi {
|
||||||
MMBaseCall parent;
|
MMBaseCall parent;
|
||||||
|
MMCallQmiPrivate *priv;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MMCallQmiClass {
|
struct _MMCallQmiClass {
|
||||||
@@ -47,6 +49,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCallQmi, g_object_unref)
|
|||||||
|
|
||||||
MMBaseCall *mm_call_qmi_new (MMBaseModem *modem,
|
MMBaseCall *mm_call_qmi_new (MMBaseModem *modem,
|
||||||
MMCallDirection direction,
|
MMCallDirection direction,
|
||||||
const gchar *number);
|
const gchar *number,
|
||||||
|
const guint dtmf_tone_duration);
|
||||||
|
|
||||||
#endif /* MM_CALL_QMI_H */
|
#endif /* MM_CALL_QMI_H */
|
||||||
|
|||||||
+29
-9
@@ -32,14 +32,18 @@
|
|||||||
#include "mm-cbm-list.h"
|
#include "mm-cbm-list.h"
|
||||||
#include "mm-base-cbm.h"
|
#include "mm-base-cbm.h"
|
||||||
#include "mm-log-object.h"
|
#include "mm-log-object.h"
|
||||||
|
#include "mm-bind.h"
|
||||||
|
|
||||||
static void log_object_iface_init (MMLogObjectInterface *iface);
|
static void log_object_iface_init (MMLogObjectInterface *iface);
|
||||||
|
static void bind_iface_init (MMBindInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_EXTENDED (MMCbmList, mm_cbm_list, G_TYPE_OBJECT, 0,
|
G_DEFINE_TYPE_EXTENDED (MMCbmList, mm_cbm_list, G_TYPE_OBJECT, 0,
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init))
|
G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init)
|
||||||
|
G_IMPLEMENT_INTERFACE (MM_TYPE_BIND, bind_iface_init))
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
PROP_BIND_TO,
|
||||||
PROP_MODEM,
|
PROP_MODEM,
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
};
|
};
|
||||||
@@ -53,6 +57,8 @@ enum {
|
|||||||
static guint signals[SIGNAL_LAST];
|
static guint signals[SIGNAL_LAST];
|
||||||
|
|
||||||
struct _MMCbmListPrivate {
|
struct _MMCbmListPrivate {
|
||||||
|
/* The object this CBM list is bound to */
|
||||||
|
GObject *bind_to;
|
||||||
/* The owner modem */
|
/* The owner modem */
|
||||||
MMBaseModem *modem;
|
MMBaseModem *modem;
|
||||||
/* List of cbm objects */
|
/* List of cbm objects */
|
||||||
@@ -173,6 +179,7 @@ cmp_cbm_by_serial_and_id (MMBaseCbm *cbm,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
take_part (MMCbmList *self,
|
take_part (MMCbmList *self,
|
||||||
|
GObject *bind_to,
|
||||||
MMCbmPart *part,
|
MMCbmPart *part,
|
||||||
MMCbmState state,
|
MMCbmState state,
|
||||||
GError **error)
|
GError **error)
|
||||||
@@ -196,7 +203,7 @@ take_part (MMCbmList *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Create new cbm */
|
/* Create new cbm */
|
||||||
cbm = mm_base_cbm_new_with_part (self->priv->modem,
|
cbm = mm_base_cbm_new_with_part (bind_to,
|
||||||
state,
|
state,
|
||||||
mm_cbm_part_get_num_parts (part),
|
mm_cbm_part_get_num_parts (part),
|
||||||
part,
|
part,
|
||||||
@@ -250,6 +257,7 @@ mm_cbm_list_has_part (MMCbmList *self,
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mm_cbm_list_take_part (MMCbmList *self,
|
mm_cbm_list_take_part (MMCbmList *self,
|
||||||
|
GObject *bind_to,
|
||||||
MMCbmPart *part,
|
MMCbmPart *part,
|
||||||
MMCbmState state,
|
MMCbmState state,
|
||||||
GError **error)
|
GError **error)
|
||||||
@@ -269,7 +277,7 @@ mm_cbm_list_take_part (MMCbmList *self,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return take_part (self, part, state, error);
|
return take_part (self, bind_to, part, state, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -283,11 +291,12 @@ log_object_build_id (MMLogObject *_self)
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
MMCbmList *
|
MMCbmList *
|
||||||
mm_cbm_list_new (MMBaseModem *modem)
|
mm_cbm_list_new (MMBaseModem *modem, GObject *bind_to)
|
||||||
{
|
{
|
||||||
/* Create the object */
|
/* Create the object */
|
||||||
return g_object_new (MM_TYPE_CBM_LIST,
|
return g_object_new (MM_TYPE_CBM_LIST,
|
||||||
MM_CBM_LIST_MODEM, modem,
|
MM_CBM_LIST_MODEM, modem,
|
||||||
|
MM_BIND_TO, bind_to,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,14 +309,14 @@ set_property (GObject *object,
|
|||||||
MMCbmList *self = MM_CBM_LIST (object);
|
MMCbmList *self = MM_CBM_LIST (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
|
case PROP_BIND_TO:
|
||||||
|
g_clear_object (&self->priv->bind_to);
|
||||||
|
self->priv->bind_to = g_value_dup_object (value);
|
||||||
|
mm_bind_to (MM_BIND (self), NULL, self->priv->bind_to);
|
||||||
|
break;
|
||||||
case PROP_MODEM:
|
case PROP_MODEM:
|
||||||
g_clear_object (&self->priv->modem);
|
g_clear_object (&self->priv->modem);
|
||||||
self->priv->modem = g_value_dup_object (value);
|
self->priv->modem = g_value_dup_object (value);
|
||||||
if (self->priv->modem) {
|
|
||||||
/* Set owner ID */
|
|
||||||
mm_log_object_set_owner_id (MM_LOG_OBJECT (self),
|
|
||||||
mm_log_object_get_id (MM_LOG_OBJECT (self->priv->modem)));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
@@ -324,6 +333,9 @@ get_property (GObject *object,
|
|||||||
MMCbmList *self = MM_CBM_LIST (object);
|
MMCbmList *self = MM_CBM_LIST (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
|
case PROP_BIND_TO:
|
||||||
|
g_value_set_object (value, self->priv->bind_to);
|
||||||
|
break;
|
||||||
case PROP_MODEM:
|
case PROP_MODEM:
|
||||||
g_value_set_object (value, self->priv->modem);
|
g_value_set_object (value, self->priv->modem);
|
||||||
break;
|
break;
|
||||||
@@ -348,6 +360,7 @@ dispose (GObject *object)
|
|||||||
MMCbmList *self = MM_CBM_LIST (object);
|
MMCbmList *self = MM_CBM_LIST (object);
|
||||||
|
|
||||||
g_clear_object (&self->priv->modem);
|
g_clear_object (&self->priv->modem);
|
||||||
|
g_clear_object (&self->priv->bind_to);
|
||||||
g_list_free_full (self->priv->list, g_object_unref);
|
g_list_free_full (self->priv->list, g_object_unref);
|
||||||
self->priv->list = NULL;
|
self->priv->list = NULL;
|
||||||
|
|
||||||
@@ -360,6 +373,11 @@ log_object_iface_init (MMLogObjectInterface *iface)
|
|||||||
iface->build_id = log_object_build_id;
|
iface->build_id = log_object_build_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
bind_iface_init (MMBindInterface *iface)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mm_cbm_list_class_init (MMCbmListClass *klass)
|
mm_cbm_list_class_init (MMCbmListClass *klass)
|
||||||
{
|
{
|
||||||
@@ -381,6 +399,8 @@ mm_cbm_list_class_init (MMCbmListClass *klass)
|
|||||||
G_PARAM_READWRITE);
|
G_PARAM_READWRITE);
|
||||||
g_object_class_install_property (object_class, PROP_MODEM, properties[PROP_MODEM]);
|
g_object_class_install_property (object_class, PROP_MODEM, properties[PROP_MODEM]);
|
||||||
|
|
||||||
|
g_object_class_override_property (object_class, PROP_BIND_TO, MM_BIND_TO);
|
||||||
|
|
||||||
/* Signals */
|
/* Signals */
|
||||||
signals[SIGNAL_ADDED] =
|
signals[SIGNAL_ADDED] =
|
||||||
g_signal_new (MM_CBM_ADDED,
|
g_signal_new (MM_CBM_ADDED,
|
||||||
|
|||||||
+3
-1
@@ -57,7 +57,8 @@ struct _MMCbmListClass {
|
|||||||
GType mm_cbm_list_get_type (void);
|
GType mm_cbm_list_get_type (void);
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCbmList, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCbmList, g_object_unref)
|
||||||
|
|
||||||
MMCbmList *mm_cbm_list_new (MMBaseModem *modem);
|
MMCbmList *mm_cbm_list_new (MMBaseModem *modem,
|
||||||
|
GObject *bind_to);
|
||||||
|
|
||||||
GStrv mm_cbm_list_get_paths (MMCbmList *self);
|
GStrv mm_cbm_list_get_paths (MMCbmList *self);
|
||||||
guint mm_cbm_list_get_count (MMCbmList *self);
|
guint mm_cbm_list_get_count (MMCbmList *self);
|
||||||
@@ -68,6 +69,7 @@ gboolean mm_cbm_list_has_part (MMCbmList *self,
|
|||||||
guint8 part_num);
|
guint8 part_num);
|
||||||
|
|
||||||
gboolean mm_cbm_list_take_part (MMCbmList *self,
|
gboolean mm_cbm_list_take_part (MMCbmList *self,
|
||||||
|
GObject *bind_to,
|
||||||
MMCbmPart *part,
|
MMCbmPart *part,
|
||||||
MMCbmState state,
|
MMCbmState state,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|||||||
+117
-11
@@ -27,9 +27,17 @@
|
|||||||
#include "mm-sms-part-3gpp.h"
|
#include "mm-sms-part-3gpp.h"
|
||||||
|
|
||||||
#define CBS_DATA_CODING_GROUP_MASK 0b11110000
|
#define CBS_DATA_CODING_GROUP_MASK 0b11110000
|
||||||
|
#define CBS_DATA_CODING_LANG_MASK 0b00001111
|
||||||
#define CBS_DATA_CODING_LANG_GSM7 0b00000000
|
#define CBS_DATA_CODING_LANG_GSM7 0b00000000
|
||||||
#define CBS_DATA_CODING_GSM7 0b00010000
|
#define CBS_DATA_CODING_GSM7 0b00010000
|
||||||
#define CBS_DATA_CODING_UCS2 0b00010001
|
#define CBS_DATA_CODING_UCS2 0b00010001
|
||||||
|
#define CBS_DATA_CODING_OTHER 0b00100000
|
||||||
|
#define CBS_DATA_CODING_OTHER_CZECH 0b00100000
|
||||||
|
#define CBS_DATA_CODING_OTHER_HEBREW 0b00100001
|
||||||
|
#define CBS_DATA_CODING_OTHER_ARABIC 0b00100010
|
||||||
|
#define CBS_DATA_CODING_OTHER_RUSSIAN 0b00100011
|
||||||
|
#define CBS_DATA_CODING_OTHER_ICELANDIC 0b00100100
|
||||||
|
#define CBS_DATA_CODING_UNSPECIFIED 0b00110000
|
||||||
#define CBS_DATA_CODING_GENERAL_NO_CLASS 0b01000000
|
#define CBS_DATA_CODING_GENERAL_NO_CLASS 0b01000000
|
||||||
#define CBS_DATA_CODING_GENERAL_CLASS 0b01010000
|
#define CBS_DATA_CODING_GENERAL_CLASS 0b01010000
|
||||||
#define CBS_DATA_CODING_GENERAL_CHARSET_MASK 0b00001100
|
#define CBS_DATA_CODING_GENERAL_CHARSET_MASK 0b00001100
|
||||||
@@ -46,10 +54,48 @@ struct _MMCbmPart {
|
|||||||
guint8 part_num;
|
guint8 part_num;
|
||||||
|
|
||||||
gchar *text;
|
gchar *text;
|
||||||
|
gchar *language;
|
||||||
MMSmsEncoding encoding;
|
MMSmsEncoding encoding;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static gchar *
|
||||||
|
mm_cbm_part_coding_group_to_language (guint8 group)
|
||||||
|
{
|
||||||
|
switch (group & CBS_DATA_CODING_LANG_MASK) {
|
||||||
|
case 0b0000:
|
||||||
|
return g_strdup ("de");
|
||||||
|
case 0b0001:
|
||||||
|
return g_strdup ("en");
|
||||||
|
case 0b0010:
|
||||||
|
return g_strdup ("it");
|
||||||
|
case 0b0011:
|
||||||
|
return g_strdup ("fr");
|
||||||
|
case 0b0100:
|
||||||
|
return g_strdup ("es");
|
||||||
|
case 0b0101:
|
||||||
|
return g_strdup ("nl");
|
||||||
|
case 0b0110:
|
||||||
|
return g_strdup ("sv");
|
||||||
|
case 0b0111:
|
||||||
|
return g_strdup ("da");
|
||||||
|
case 0b1000:
|
||||||
|
return g_strdup ("pt");
|
||||||
|
case 0b1001:
|
||||||
|
return g_strdup ("fi");
|
||||||
|
case 0b1010:
|
||||||
|
return g_strdup ("no");
|
||||||
|
case 0b1011:
|
||||||
|
return g_strdup ("el");
|
||||||
|
case 0b1110:
|
||||||
|
return g_strdup ("pl");
|
||||||
|
case 0b1111:
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MMCbmPart *
|
MMCbmPart *
|
||||||
mm_cbm_part_new_from_pdu (const gchar *hexpdu,
|
mm_cbm_part_new_from_pdu (const gchar *hexpdu,
|
||||||
gpointer log_object,
|
gpointer log_object,
|
||||||
@@ -74,12 +120,13 @@ mm_cbm_part_new_from_binary_pdu (const guint8 *pdu,
|
|||||||
gpointer log_object,
|
gpointer log_object,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
MMCbmPart *cbm_part;
|
g_autoptr (MMCbmPart) cbm_part = NULL;
|
||||||
MMCbmGeoScope scope;
|
MMCbmGeoScope scope;
|
||||||
guint offset = 0;
|
guint offset = 0;
|
||||||
guint16 serial, group;
|
guint16 serial, group;
|
||||||
int len;
|
int len;
|
||||||
g_autofree gchar *text = NULL;
|
g_autofree gchar *text = NULL;
|
||||||
|
gboolean has_lang = FALSE, has_7bit_lang = FALSE;
|
||||||
|
|
||||||
cbm_part = mm_cbm_part_new ();
|
cbm_part = mm_cbm_part_new ();
|
||||||
|
|
||||||
@@ -94,7 +141,6 @@ mm_cbm_part_new_from_binary_pdu (const guint8 *pdu,
|
|||||||
check_descr_str, \
|
check_descr_str, \
|
||||||
pdu_len, \
|
pdu_len, \
|
||||||
required_size); \
|
required_size); \
|
||||||
mm_cbm_part_free (cbm_part); \
|
|
||||||
return NULL; \
|
return NULL; \
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +162,6 @@ mm_cbm_part_new_from_binary_pdu (const guint8 *pdu,
|
|||||||
mm_obj_dbg (log_object, " immediate cell cbm scope");
|
mm_obj_dbg (log_object, " immediate cell cbm scope");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mm_cbm_part_free (cbm_part);
|
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
MM_CORE_ERROR,
|
MM_CORE_ERROR,
|
||||||
MM_CORE_ERROR_FAILED,
|
MM_CORE_ERROR_FAILED,
|
||||||
@@ -137,14 +182,40 @@ mm_cbm_part_new_from_binary_pdu (const guint8 *pdu,
|
|||||||
/* Order matches 3GPP TS 23.038 Chapter 5 */
|
/* Order matches 3GPP TS 23.038 Chapter 5 */
|
||||||
if (group == CBS_DATA_CODING_LANG_GSM7) {
|
if (group == CBS_DATA_CODING_LANG_GSM7) {
|
||||||
cbm_part->encoding = MM_SMS_ENCODING_GSM7;
|
cbm_part->encoding = MM_SMS_ENCODING_GSM7;
|
||||||
|
cbm_part->language = mm_cbm_part_coding_group_to_language (pdu[offset]);
|
||||||
} else if (pdu[offset] == CBS_DATA_CODING_GSM7) {
|
} else if (pdu[offset] == CBS_DATA_CODING_GSM7) {
|
||||||
PDU_SIZE_CHECK (offset + 4, "cannot skip lang");
|
has_lang = TRUE;
|
||||||
offset += 3;
|
|
||||||
cbm_part->encoding = MM_SMS_ENCODING_GSM7;
|
cbm_part->encoding = MM_SMS_ENCODING_GSM7;
|
||||||
} else if (pdu[offset] == CBS_DATA_CODING_UCS2) {
|
} else if (pdu[offset] == CBS_DATA_CODING_UCS2) {
|
||||||
PDU_SIZE_CHECK (offset + 3, "cannot skip lang");
|
has_7bit_lang = TRUE;
|
||||||
offset += 2;
|
|
||||||
cbm_part->encoding = MM_SMS_ENCODING_UCS2;
|
cbm_part->encoding = MM_SMS_ENCODING_UCS2;
|
||||||
|
} else if (group == CBS_DATA_CODING_OTHER) {
|
||||||
|
switch (group) {
|
||||||
|
case CBS_DATA_CODING_OTHER_CZECH:
|
||||||
|
cbm_part->encoding = MM_SMS_ENCODING_GSM7;
|
||||||
|
cbm_part->language = g_strdup ("cs");
|
||||||
|
break;
|
||||||
|
case CBS_DATA_CODING_OTHER_HEBREW:
|
||||||
|
cbm_part->encoding = MM_SMS_ENCODING_UCS2;
|
||||||
|
cbm_part->language = g_strdup ("he");
|
||||||
|
break;
|
||||||
|
case CBS_DATA_CODING_OTHER_ARABIC:
|
||||||
|
cbm_part->encoding = MM_SMS_ENCODING_UCS2;
|
||||||
|
cbm_part->language = g_strdup ("ar");
|
||||||
|
break;
|
||||||
|
case CBS_DATA_CODING_OTHER_RUSSIAN:
|
||||||
|
cbm_part->encoding = MM_SMS_ENCODING_UCS2;
|
||||||
|
cbm_part->language = g_strdup ("ru");
|
||||||
|
break;
|
||||||
|
case CBS_DATA_CODING_OTHER_ICELANDIC:
|
||||||
|
cbm_part->encoding = MM_SMS_ENCODING_GSM7;
|
||||||
|
cbm_part->language = g_strdup ("is");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
cbm_part->encoding = MM_SMS_ENCODING_GSM7;
|
||||||
|
}
|
||||||
|
} else if (group == CBS_DATA_CODING_UNSPECIFIED) {
|
||||||
|
cbm_part->encoding = MM_SMS_ENCODING_GSM7;
|
||||||
} else if ((group == CBS_DATA_CODING_GENERAL_CLASS) ||
|
} else if ((group == CBS_DATA_CODING_GENERAL_CLASS) ||
|
||||||
(group == CBS_DATA_CODING_GENERAL_NO_CLASS) ||
|
(group == CBS_DATA_CODING_GENERAL_NO_CLASS) ||
|
||||||
(group == CBS_DATA_CODING_UDH)) {
|
(group == CBS_DATA_CODING_UDH)) {
|
||||||
@@ -154,8 +225,9 @@ mm_cbm_part_new_from_binary_pdu (const guint8 *pdu,
|
|||||||
cbm_part->encoding = MM_SMS_ENCODING_GSM7;
|
cbm_part->encoding = MM_SMS_ENCODING_GSM7;
|
||||||
else if (charset == CBS_DATA_CODING_GENERAL_UCS2)
|
else if (charset == CBS_DATA_CODING_GENERAL_UCS2)
|
||||||
cbm_part->encoding = MM_SMS_ENCODING_UCS2;
|
cbm_part->encoding = MM_SMS_ENCODING_UCS2;
|
||||||
} else {
|
}
|
||||||
mm_cbm_part_free (cbm_part);
|
|
||||||
|
if (cbm_part->encoding == MM_SMS_ENCODING_UNKNOWN) {
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
MM_CORE_ERROR,
|
MM_CORE_ERROR,
|
||||||
MM_CORE_ERROR_FAILED,
|
MM_CORE_ERROR_FAILED,
|
||||||
@@ -170,12 +242,45 @@ mm_cbm_part_new_from_binary_pdu (const guint8 *pdu,
|
|||||||
cbm_part->part_num = (pdu[offset] & 0xF0) >> 4;
|
cbm_part->part_num = (pdu[offset] & 0xF0) >> 4;
|
||||||
offset++;
|
offset++;
|
||||||
|
|
||||||
|
if (has_lang) {
|
||||||
|
PDU_SIZE_CHECK (offset + 4, "cannot read lang");
|
||||||
|
if (pdu[offset+2] != '\r') {
|
||||||
|
g_set_error_literal (error,
|
||||||
|
MM_CORE_ERROR,
|
||||||
|
MM_CORE_ERROR_FAILED,
|
||||||
|
"Failed to parse lang");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
cbm_part->language = g_strdup_printf ("%c%c", pdu[offset], pdu[offset+1]);
|
||||||
|
offset += 3;
|
||||||
|
} else if (has_7bit_lang) {
|
||||||
|
PDU_SIZE_CHECK (offset + 3, "cannot read 7bit lang");
|
||||||
|
cbm_part->language = mm_sms_decode_text (&pdu[offset],
|
||||||
|
2,
|
||||||
|
MM_SMS_ENCODING_GSM7,
|
||||||
|
0,
|
||||||
|
log_object,
|
||||||
|
NULL);
|
||||||
|
if (!cbm_part->language) {
|
||||||
|
g_set_error_literal (error,
|
||||||
|
MM_CORE_ERROR,
|
||||||
|
MM_CORE_ERROR_FAILED,
|
||||||
|
"Failed to parse lang");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
offset += 2;
|
||||||
|
}
|
||||||
|
|
||||||
switch (cbm_part->encoding) {
|
switch (cbm_part->encoding) {
|
||||||
case MM_SMS_ENCODING_GSM7:
|
case MM_SMS_ENCODING_GSM7:
|
||||||
len = ((pdu_len - offset) * 8) / 7;
|
len = ((pdu_len - offset) * 8) / 7;
|
||||||
break;
|
break;
|
||||||
case MM_SMS_ENCODING_UCS2:
|
case MM_SMS_ENCODING_UCS2:
|
||||||
len = pdu_len - offset;
|
len = pdu_len - offset;
|
||||||
|
/* UCS2 must be even number of bytes but some messages
|
||||||
|
* eg from 'il' have trailing 00 */
|
||||||
|
if (len % 2)
|
||||||
|
len--;
|
||||||
break;
|
break;
|
||||||
case MM_SMS_ENCODING_8BIT:
|
case MM_SMS_ENCODING_8BIT:
|
||||||
case MM_SMS_ENCODING_UNKNOWN:
|
case MM_SMS_ENCODING_UNKNOWN:
|
||||||
@@ -190,12 +295,11 @@ mm_cbm_part_new_from_binary_pdu (const guint8 *pdu,
|
|||||||
log_object,
|
log_object,
|
||||||
error);
|
error);
|
||||||
if (!text) {
|
if (!text) {
|
||||||
mm_cbm_part_free (cbm_part);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
cbm_part->text = g_steal_pointer (&text);
|
cbm_part->text = g_steal_pointer (&text);
|
||||||
|
|
||||||
return cbm_part;
|
return g_steal_pointer (&cbm_part);
|
||||||
}
|
}
|
||||||
|
|
||||||
MMCbmPart *
|
MMCbmPart *
|
||||||
@@ -207,6 +311,7 @@ mm_cbm_part_new (void)
|
|||||||
void
|
void
|
||||||
mm_cbm_part_free (MMCbmPart *part)
|
mm_cbm_part_free (MMCbmPart *part)
|
||||||
{
|
{
|
||||||
|
g_clear_pointer (&part->language, g_free);
|
||||||
g_clear_pointer (&part->text, g_free);
|
g_clear_pointer (&part->text, g_free);
|
||||||
g_slice_free (MMCbmPart, part);
|
g_slice_free (MMCbmPart, part);
|
||||||
}
|
}
|
||||||
@@ -223,3 +328,4 @@ PART_GET_FUNC (guint, num_parts)
|
|||||||
PART_GET_FUNC (const char *, text)
|
PART_GET_FUNC (const char *, text)
|
||||||
PART_GET_FUNC (guint16, channel)
|
PART_GET_FUNC (guint16, channel)
|
||||||
PART_GET_FUNC (guint16, serial)
|
PART_GET_FUNC (guint16, serial)
|
||||||
|
PART_GET_FUNC (const char *, language)
|
||||||
|
|||||||
@@ -59,11 +59,14 @@ MMCbmPart *mm_cbm_part_new_from_binary_pdu (const guint8 *pdu,
|
|||||||
MMCbmPart *mm_cbm_part_new (void);
|
MMCbmPart *mm_cbm_part_new (void);
|
||||||
void mm_cbm_part_free (MMCbmPart *part);
|
void mm_cbm_part_free (MMCbmPart *part);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCbmPart, mm_cbm_part_free)
|
||||||
|
|
||||||
guint mm_cbm_part_get_part_num (MMCbmPart *part);
|
guint mm_cbm_part_get_part_num (MMCbmPart *part);
|
||||||
guint mm_cbm_part_get_num_parts (MMCbmPart *part);
|
guint mm_cbm_part_get_num_parts (MMCbmPart *part);
|
||||||
const char *mm_cbm_part_get_text (MMCbmPart *part);
|
const char *mm_cbm_part_get_text (MMCbmPart *part);
|
||||||
|
|
||||||
guint16 mm_cbm_part_get_serial (MMCbmPart *part);
|
guint16 mm_cbm_part_get_serial (MMCbmPart *part);
|
||||||
guint16 mm_cbm_part_get_channel (MMCbmPart *part);
|
guint16 mm_cbm_part_get_channel (MMCbmPart *part);
|
||||||
|
const char *mm_cbm_part_get_language (MMCbmPart *part);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+105
-19
@@ -27,6 +27,7 @@
|
|||||||
#include "mm-plugin.h"
|
#include "mm-plugin.h"
|
||||||
#include "mm-log-object.h"
|
#include "mm-log-object.h"
|
||||||
#include "mm-daemon-enums-types.h"
|
#include "mm-daemon-enums-types.h"
|
||||||
|
#include "mm-bind.h"
|
||||||
|
|
||||||
static void log_object_iface_init (MMLogObjectInterface *iface);
|
static void log_object_iface_init (MMLogObjectInterface *iface);
|
||||||
|
|
||||||
@@ -341,7 +342,7 @@ unexport_modem (MMDevice *self)
|
|||||||
if (path != NULL) {
|
if (path != NULL) {
|
||||||
g_dbus_object_manager_server_unexport (self->priv->object_manager, path);
|
g_dbus_object_manager_server_unexport (self->priv->object_manager, path);
|
||||||
g_object_set (self->priv->modem,
|
g_object_set (self->priv->modem,
|
||||||
MM_BASE_MODEM_CONNECTION, NULL,
|
MM_BINDABLE_CONNECTION, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
mm_obj_dbg (self, "unexported modem from path '%s'", path);
|
mm_obj_dbg (self, "unexported modem from path '%s'", path);
|
||||||
g_free (path);
|
g_free (path);
|
||||||
@@ -389,7 +390,7 @@ export_modem (MMDevice *self)
|
|||||||
path = g_strdup_printf (MM_DBUS_MODEM_PREFIX "/%d", mm_base_modem_get_dbus_id (self->priv->modem));
|
path = g_strdup_printf (MM_DBUS_MODEM_PREFIX "/%d", mm_base_modem_get_dbus_id (self->priv->modem));
|
||||||
g_object_set (self->priv->modem,
|
g_object_set (self->priv->modem,
|
||||||
"g-object-path", path,
|
"g-object-path", path,
|
||||||
MM_BASE_MODEM_CONNECTION, connection,
|
MM_BINDABLE_CONNECTION, connection,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
g_dbus_object_manager_server_export (self->priv->object_manager,
|
g_dbus_object_manager_server_export (self->priv->object_manager,
|
||||||
@@ -436,7 +437,7 @@ mm_device_initialize_modem (MMDevice *self)
|
|||||||
|
|
||||||
mm_obj_dbg (self, "modem initializing...");
|
mm_obj_dbg (self, "modem initializing...");
|
||||||
mm_base_modem_initialize (modem,
|
mm_base_modem_initialize (modem,
|
||||||
MM_BASE_MODEM_OPERATION_LOCK_REQUIRED,
|
MM_OPERATION_LOCK_REQUIRED,
|
||||||
(GAsyncReadyCallback)initialize_ready,
|
(GAsyncReadyCallback)initialize_ready,
|
||||||
g_object_ref (self));
|
g_object_ref (self));
|
||||||
}
|
}
|
||||||
@@ -459,14 +460,66 @@ clear_modem (MMDevice *self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
mm_device_remove_modem (MMDevice *self)
|
mm_device_remove_modem_finish (MMDevice *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error)
|
||||||
{
|
{
|
||||||
if (!self->priv->modem)
|
return g_task_propagate_boolean (G_TASK (res), error);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
teardown_ports_ready (MMBaseModem *modem,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GTask *task)
|
||||||
|
{
|
||||||
|
MMDevice *self;
|
||||||
|
GError *error = NULL;
|
||||||
|
gboolean success;
|
||||||
|
|
||||||
|
self = g_task_get_source_object (task);
|
||||||
|
|
||||||
|
success = mm_base_modem_teardown_ports_finish (modem, res, &error);
|
||||||
|
clear_modem (self);
|
||||||
|
|
||||||
|
if (!success)
|
||||||
|
g_task_return_error (task, error);
|
||||||
|
else
|
||||||
|
g_task_return_boolean (task, TRUE);
|
||||||
|
g_object_unref (task);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
mm_device_remove_modem (MMDevice *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
GTask *task;
|
||||||
|
|
||||||
|
task = g_task_new (self, NULL, callback, user_data);
|
||||||
|
if (!self->priv->modem) {
|
||||||
|
g_task_return_boolean (task, TRUE);
|
||||||
|
g_object_unref (task);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
unexport_modem (self);
|
unexport_modem (self);
|
||||||
clear_modem (self);
|
g_cancellable_cancel (mm_base_modem_peek_cancellable (self->priv->modem));
|
||||||
|
mm_base_modem_teardown_ports (self->priv->modem,
|
||||||
|
(GAsyncReadyCallback)teardown_ports_ready,
|
||||||
|
task);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Should only be used from testing code or when the hardware is no longer
|
||||||
|
* present and cannot be gracefully cleaned up.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
mm_device_remove_modem_quick (MMDevice *self)
|
||||||
|
{
|
||||||
|
if (self->priv->modem) {
|
||||||
|
unexport_modem (self);
|
||||||
|
clear_modem (self);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -491,6 +544,25 @@ reprobe (MMDevice *self)
|
|||||||
return G_SOURCE_REMOVE;
|
return G_SOURCE_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
modem_valid_remove_ready (MMDevice *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
MMBaseModem *modem)
|
||||||
|
{
|
||||||
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
|
if (!mm_device_remove_modem_finish (self, res, &error))
|
||||||
|
mm_obj_warn (self, "removing modem failed: %s", error->message);
|
||||||
|
|
||||||
|
if (mm_base_modem_get_reprobe (modem)) {
|
||||||
|
if (self->priv->reprobe_id)
|
||||||
|
g_source_remove (self->priv->reprobe_id);
|
||||||
|
self->priv->reprobe_id = g_timeout_add_seconds (REPROBE_SECS, (GSourceFunc)reprobe, self);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_object_unref (modem);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
modem_valid (MMBaseModem *modem,
|
modem_valid (MMBaseModem *modem,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
@@ -498,9 +570,9 @@ modem_valid (MMBaseModem *modem,
|
|||||||
{
|
{
|
||||||
if (!mm_base_modem_get_valid (modem)) {
|
if (!mm_base_modem_get_valid (modem)) {
|
||||||
/* Modem no longer valid */
|
/* Modem no longer valid */
|
||||||
mm_device_remove_modem (self);
|
mm_device_remove_modem (self,
|
||||||
if (mm_base_modem_get_reprobe (modem))
|
(GAsyncReadyCallback)modem_valid_remove_ready,
|
||||||
self->priv->reprobe_id = g_timeout_add_seconds (REPROBE_SECS, (GSourceFunc)reprobe, self);
|
g_object_ref (modem));
|
||||||
} else {
|
} else {
|
||||||
/* Modem now valid, export it, but only if we really have it around.
|
/* Modem now valid, export it, but only if we really have it around.
|
||||||
* It may happen that the initialization sequence fails because the
|
* It may happen that the initialization sequence fails because the
|
||||||
@@ -732,6 +804,19 @@ mm_device_inhibit_finish (MMDevice *self,
|
|||||||
return g_task_propagate_boolean (G_TASK (res), error);
|
return g_task_propagate_boolean (G_TASK (res), error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
inhibit_disable_modem_remove_ready (MMDevice *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GTask *task)
|
||||||
|
{
|
||||||
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
|
if (!mm_device_remove_modem_finish (self, res, &error))
|
||||||
|
mm_obj_warn (self, "removing modem failed: %s", error->message);
|
||||||
|
g_task_return_boolean (task, TRUE);
|
||||||
|
g_object_unref (task);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
inhibit_disable_ready (MMBaseModem *modem,
|
inhibit_disable_ready (MMBaseModem *modem,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
@@ -742,14 +827,15 @@ inhibit_disable_ready (MMBaseModem *modem,
|
|||||||
|
|
||||||
self = g_task_get_source_object (task);
|
self = g_task_get_source_object (task);
|
||||||
|
|
||||||
if (!mm_base_modem_disable_finish (modem, res, &error))
|
if (!mm_base_modem_disable_finish (modem, res, &error)) {
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
else {
|
g_object_unref (task);
|
||||||
g_cancellable_cancel (mm_base_modem_peek_cancellable (modem));
|
return;
|
||||||
mm_device_remove_modem (self);
|
|
||||||
g_task_return_boolean (task, TRUE);
|
|
||||||
}
|
}
|
||||||
g_object_unref (task);
|
|
||||||
|
mm_device_remove_modem (self,
|
||||||
|
(GAsyncReadyCallback)inhibit_disable_modem_remove_ready,
|
||||||
|
task);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -783,8 +869,8 @@ mm_device_inhibit (MMDevice *self,
|
|||||||
* an exclusive lock marked as override, so the modem object will not
|
* an exclusive lock marked as override, so the modem object will not
|
||||||
* allow any additional lock request any more. */
|
* allow any additional lock request any more. */
|
||||||
mm_base_modem_disable (self->priv->modem,
|
mm_base_modem_disable (self->priv->modem,
|
||||||
MM_BASE_MODEM_OPERATION_LOCK_REQUIRED,
|
MM_OPERATION_LOCK_REQUIRED,
|
||||||
MM_BASE_MODEM_OPERATION_PRIORITY_OVERRIDE,
|
MM_OPERATION_PRIORITY_OVERRIDE,
|
||||||
(GAsyncReadyCallback)inhibit_disable_ready,
|
(GAsyncReadyCallback)inhibit_disable_ready,
|
||||||
task);
|
task);
|
||||||
}
|
}
|
||||||
@@ -899,7 +985,7 @@ set_property (GObject *object,
|
|||||||
self->priv->plugin = g_value_dup_object (value);
|
self->priv->plugin = g_value_dup_object (value);
|
||||||
break;
|
break;
|
||||||
case PROP_MODEM:
|
case PROP_MODEM:
|
||||||
clear_modem (self);
|
g_assert (self->priv->modem == NULL);
|
||||||
self->priv->modem = g_value_dup_object (value);
|
self->priv->modem = g_value_dup_object (value);
|
||||||
break;
|
break;
|
||||||
case PROP_HOTPLUGGED:
|
case PROP_HOTPLUGGED:
|
||||||
|
|||||||
+10
-4
@@ -80,10 +80,16 @@ void mm_device_release_port_name (MMDevice *self,
|
|||||||
const gchar *subsystem,
|
const gchar *subsystem,
|
||||||
const gchar *name);
|
const gchar *name);
|
||||||
|
|
||||||
gboolean mm_device_create_modem (MMDevice *self,
|
gboolean mm_device_create_modem (MMDevice *self,
|
||||||
GError **error);
|
GError **error);
|
||||||
void mm_device_remove_modem (MMDevice *self);
|
void mm_device_remove_modem (MMDevice *self,
|
||||||
void mm_device_initialize_modem (MMDevice *self);
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean mm_device_remove_modem_finish (MMDevice *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
void mm_device_remove_modem_quick (MMDevice *self);
|
||||||
|
void mm_device_initialize_modem (MMDevice *self);
|
||||||
|
|
||||||
void mm_device_inhibit (MMDevice *self,
|
void mm_device_inhibit (MMDevice *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user