Age | Commit message (Collapse) | Author |
|
tm-dev
|
|
Three of seven notifications are fuzzed. Additionally, fixed the bug
that calling Enable and Disable commends would cause panic.
Test: manual
Bug: 202531943
Change-Id: I9a40f6aaa797646f3bccab9650f37dde67273760
|
|
GID should be 0x1 for session commands.
Bug: 231223218
Change-Id: I49a80c1254cfe7b496a227da7317fe5a2eeeb625
Test: atest libuwb_uci_packet_tests
|
|
libuwb_uci_packet" into tm-dev
|
|
A specific device only configuration is not needed since all existing
tests can be ran on the host.
Bug: 216784920
Test: atest --host libuwb_uci_packet_tests
Test: atest --host libuwb_uci_rust_tests
Change-Id: Ia58586c984abe1523ac786de6d59a86544e219d6
|
|
|
|
|
|
* changes:
uwb_core: polish the struct of the ranging data notification
uwb_core: add update_controller_multicast_list() method
|
|
|
|
This CL groups the enum UciNotification into 3 sub-group: core,
session, and vendor. UciManager will send the notifications through 3
channels in the future.
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: I28bc5bd4b14d7455f8541865fd5a7bb28e37c049
|
|
This CL adds the sender of SessionRangeData at SessionManager's
init_session() method. The SessionManager's caller could use the
channel to receive the SessionRangeData.
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: Ie435a2e578bafd379e431ea86349806a52045aa9
|
|
Originally, we missed several fields of RANGE_DATA_NTF when converting
the packet to the UciNotification enum. This CL adds all of the fields
properly.
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: Ia6007befca5cc2f25eb5d6005bf2d714afcce56b
|
|
This CL adds update_controller_multicast_list() method at
SessionManager. It calls UciManager's
session_update_controller_multicast_list() method, and waits for the
notification of the multicast list update status.
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: Ifba9819a85ed25adb13e22803484f64527c311ad
|
|
Added a LogFileFactory to create new real file and mock file.
Test: atest libuwb_uci_rust_tests
Bug: 216512326
Change-Id: I9aaa90b2bc95a600b75b58604777bb8b977d2745
|
|
This CL adds reconfigure() method at SessionManager. Using this
method, the caller could reconfigure the app configuration after
initializing the session.
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: I7ee293ec866c0b3cc6806f75a656b4e55d4d3bca
|
|
SessionId and SessionType derives Copy trait, so we don't need
explicit clone.
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: I4905b2033502aad9d12b3cbde9b13434ed2f5959
|
|
This CL adds start_ranging() and stop_ranging methods at
SessionManager. The methods call UciManager's methods and wait for the
session status notification.
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: I6ff52eb00544e8595962db051c0aac431426eb4c
|
|
If the UciManager doesn't send session status notification when
initializing session, UwbSession's initialize() method will be stuck
forever. This CL handles this kind of situation by adding timeout.
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: Ic5841254b5a4f2f5026550f37923317c943ca3e6
|
|
This CL completes the flow of session initialization:
1. call session_init()
2. wait for SessionStatusInit notifcation
3. call session_set_app_config()
4. wait for SessionStatusIdle notifcation
In order to wait for the notification during the initialization
process, this CL adds UwbSession struct and delegates the process to
another tokio task. Then use tokio::sync::watch to pass the session
status to UwbSession.
Bug: 228136039
Test: cargo test
Change-Id: I10b46d4d02b42bb94d0da308dfd3943ebbb55007
|
|
Two list of TLV with the same items but different order should be
considered equal. This CL verifies the equalilty of AppConfigTlv and
DeviceConfigTlv list by converting the list to HashMap, then comparing
the HashMap.
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: Ib8f86bce0b9520ce1c3c30f29d68f58cffa77345
|
|
At ag/17750782, FiraAppConfigParams supports to generate the updated
tlvs from the difference of the old parameters. To avoid the
difference algorithm doesn't handle the situation that a key was set
before but unset after, this CL makes FiraAppConfigParams generate
tlvs for every field. With this CL, the set of keys are always the
same, so we won't encounter the situation.
Bug: 228136039
Test: cargo test
Change-Id: I623adf61ed5866fe1cd2e6aedd07fc5fdde6b0a8
|
|
When updating the AppConfig, we only need to generate the different
parameters. This CL adds generate_updated_tlvs() methods that only
generates the tlvs that value is different from the previous one.
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: Id4fea8115d025106c1783362b275443031319bee
|
|
* changes:
uwb_core: FiraAppConfigParams generate TLV list via HashMap
uwb_core: Fix the range of uwb_initiation_time_ms field
|
|
At the following CL we need to generate the difference of the TLV
list. Using HashMap is easier to find out the difference. So this CL
generates the result as HashMap first, then convert it to the Vec.
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: Ie83857bdc74b4c2f465b4609ffdd08d7c31ba34e
|
|
This CL fixes the range of uwb_initiation_time_ms field from 1~10000
to 0~10000.
Bug: 228136039
Test: cargo test
Change-Id: Ia0821a0138e1f5173f253dbc76727b7ebbc3238d
|
|
i. Move all Mocks to separate files.
ii. Add #cfg(tests) or #cfg(tests, fuzzing) for all mocks.
Bug: 229275354
Test: make uwb_uci_rust_fuzzer libuwb_uci_rust_tests
Change-Id: Id6bc6631d034112a7f0aa603b120184a01da046d
|
|
Otherwise, this leads to race conditions in the lower layers since they
might still be cleaning up (from the toggle off) when we reinitializae
(for the toggle on).
Also,
i. Removed JNICommand::Exit since we don't need an explicit message to
exit the looper.
ii. Make Disable non-blocking since we are anyway waiting for the
close_cplt callback from doDeinitialize().
iii. Changed unit tests to assert on failures instead of returning
Result.
iv. Remove redundant setup_dispatcher helper method in unit tests.
Bug: 228347909
Test: atest libuwb_uci_rust_tests
Test: Manual tests
Change-Id: I3cb1b7b7cff7840a19c14c1fa07c03dd1f3e89ef
|
|
Len of app_configs should be checked against the parsed tlv len, not
|no_of_params|.
Bug: 229246228
Test: Manual Tests
Change-Id: I20d1e7711be076327a2ef8b8b9aa1dfcc7deb914
|
|
"presubmit-am-bb24494caaa74180a118ff2dad220600", "presubmit-am-e3733b1685264f2f9dbcdd3bbc71e8ae" into tm-dev
* changes:
uwb_core: add builder_field macro to generate the setter method
uwb_core: add unit test for FiraAppConfigParams
uwb_core: validate the Android-specific fields at FiraAppConfigParams
|
|
"presubmit-am-91d751cbe97a4d929b3ec27913f6c8e4" into tm-dev
* changes:
Set the max buffer size to 10 kb.
Handle file permissions to avoid symlink attack.
|
|
crash." into tm-dev
|
|
When the buffer size reaches its limit, flush the contents to to file to
save memory.
Test: UwbManagerTest, manual
Bug: 224891049
Change-Id: I3c37f0a1763e5f4959faa6333263b2c363a72a0e
|
|
Test: atest UwbManagerTest, manual
Bug: 224891049
Change-Id: I4bba0676f6b491e581762fc85e7153e098b5d9c1
|
|
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: Iaa442f922b2a01852611959863bb1616e130652b
|
|
This CL adds a test case that successfully builds a
FiraAppConfigParams from the FiraAppConfigParamsBuilder. Then verify
the TLV generated from the params instance.
Besides, this CL has some minor changes:
- Move the default value of each field to constants
- Rename the struct "RangingDeviceRole" to "DeviceRole" for consistency
- Make the builder's setter method accepts T instead of Option<T>
Bug: 228136039
Test: none
Change-Id: I7d7f20ccc5dbb298e69bd56e61697d63b7262431
|
|
This CL ports FiraOpenSessionParams.java's checkInterleavingRatio()
method that validates the Android-specific fields.
Bug: 228136039
Test: cargo test
Test: cargo clippy
Change-Id: Ic05a1717f763107e1b4c1cebc8550e987aa60adc
|
|
This CL adds FiraAppConfigParamsBuilder for building the
FiraAppConfigParams using the builder pattern. The builder guarantee
that the client could only generate a valid FiraAppConfigParams.
Bug: 228136039
Test: cargo test -p uwb_core
Change-Id: Ifd3f50c783291d1190994bc09ceb8028a7214897
|
|
This CL generates the TLV data, which is needed by the UCI stack, from
the FiraAppConfigParams.
Bug: 228136039
Test: cargo test -p uwb_core
Change-Id: I7dd83afd0f3748c2c018fbb3a4d04ee6cd93d7b9
|
|
"presubmit-am-44283d6f4c91442d99cae8465c26c99a", "presubmit-am-a00970ec4dfa4e4eb9367981af69fcbf" into tm-dev
* changes:
uwb_core: add FiraAppConfigParams
uwb_core: UciManager close UciHal when dropped
uwb_core: verify the mock instance at the current thread
|
|
Also,
i. Fixed some errors in the PDL unit tests (which were not caught
before some reason!)
ii. Initialized logging for each test to ensure that we can get erorr
logs for debugging unit test failures.
iii. Send notification before response in MockUwbAdapatation to prevent
races.
Bug: 216552887
Test: atest libuwb_uci_rust_tests
Change-Id: Ib6d929f315a5623f2fa0280e65fe2e9cafabcf6c
|
|
This CL adds the FiraAppConfigParams struct. It contains all of the
fields defined at the FiRa UCI spec "Application Configuration
Parameters" section, and the Android-specific parameters.
Bug: 228136039
Test: cargo test -p uwb_core
Change-Id: Ifbb69c82a6672e25ee358157d2956f976556bb02
|
|
Test: manual
Bug: 202531943
Change-Id: Iefa68905ec3a7fe4899c48a27682807f66ae2e3e
|
|
"presubmit-am-76e01c792533415fbce3709f84f2e776", "presubmit-am-ec4b83d1ba994f918fd924ae0f90dd9c" into tm-dev
* changes:
uwb(uci-rust): Add more unit tests
uwb(uci-rust): Cleanup MockUwbAdaption
uwb(uci-rust): Add more unit tests
|
|
This CL makes UciManager to close the UciHal if the UciHal is opened
when UciManager is dropped. With this CL, we could guarantee the
UciHal must be closed when dropped because UciManager is the only
owner of UciHal.
Bug: 227264247
Test: cargo test -p uwb_core
Change-Id: Id7fff42117f78886874b7d50573517be90505409
|
|
Originally, we verify the mock instance that all the expected calls
are called when the mock instance is dropped. However, the mock
instance are dropped at different thread. The panic doesn't propagate
to the testing thread correctly.
This CL changes the expected calls to Arc<Mutex<T>>, and adds
MockInstanceVerifier struct to share the expected callls. With this
struct, we could verify the mock instance at the current thread.
Bug: 228136039
Test: cargo test -p uwb_core
Test: Add unnecessary expected calls and make sure "cargo test" fails
Change-Id: I7f4579a4f9ca2fb3007791bfc7e466741c49ad1a
|
|
"presubmit-am-502c507ca1394544bebf3885b52f2896", "presubmit-am-e54a8a9f31be4632af4e50dd9811d424" into tm-dev
* changes:
uwb_core: remove module prefix from Error and Result type
uwb_core: Add UwbService
uwb_core: add session module
|
|
Bug: 216552887
Test: atest libuwb_uci_rust_tests
Change-Id: Ic5dad51d246f43aba76e905b26c75f03f960a649
|
|
Clients using mocks should ideally be only dealing with the interface
exposed by the corresponding module. The current impl of
MockUwbAdaptation needs clients to dig into the internals of
UwbClientCallback.
For ex: Uci module tests have to deal with packet fragmentation inside
UwbClientCallback impl which should be hidden from unit tests of
clients.
Bug: 216552887
Test: atest libuwb_uci_rust_tests
Change-Id: I071daedd7b1f92089ac4db28707c44baf7a1598e
|
|
Bug: 216552887
Test: atest libuwb_uci_rust_tests
Change-Id: Ib218bf868f9f6fa6636f8d7d8f9d5b15acbd8f50
|
|
|