summaryrefslogtreecommitdiff
path: root/src/rust/uwb_uci_packets
AgeCommit message (Collapse)Author
2023-06-26CR490 Implementation: add tx_count to the DATA_TRANSFER_STATUS_NTFBhautik Ardeshana
Bug: 274711916 Test: Test data transfer Change-Id: Ieb2354fe4f10e79f3c2b01a6b39cf33ab4e795c4
2023-06-13Renaming ranging interval to ranging duration as per FiRa Consortium UCI ↵Bhautik Ardeshana
Generic Technical Specification v2.0.0_0.9r0 Bug: 281929045 Test: test two-way ranging, one-way ranging Change-Id: I2eafba597608f37bb94b5868a2f107cbd4c46f32
2023-06-09Merge "Add UWB test session support"Treehugger Robot
2023-06-09Add UWB test session supportAnte
Bug: 284390061 Test: atest libuwb_core_tests (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d3d94249e1f880839f591ef9713149fbc1ed73f0) Merged-In: I735c5a78c090a58566235047cecb33e969778cca Change-Id: I735c5a78c090a58566235047cecb33e969778cca Change-Id: I722a9258fb29bf28b03f6e2fbf8c805431c1f2d6
2023-06-09Merge "Updated Configs for get app config command"Treehugger Robot
2023-05-30Merge "Migrate pdl to external/rust/crates/pdl-compiler"Henri Chataing
2023-05-26Updated Configs for get app config commandBhautik Ardeshana
Bug: 283940047 Test: Test CCC ranging Change-Id: I2969ee935f4c66607fdd9afaab05415621404361
2023-05-24Migrate pdl to external/rust/crates/pdl-compilerHenri Chataing
Bug: 283153347 Test: m Change-Id: I46f82c3cd0fcbfad219cc4d33c4df2f8b5540a89
2023-05-23DataPacket Format changes in CR-518.Shreshta Manu
1) Remove the Source/Dest Endpoint fields. 2) Re-size the UCI Sequence Number field to 16-bits in both DATA_MESSAGE_SND and DATA_MESSAGE_RCV packets. 3) Changed the order of fields to match across the two Data packets. Bug: 282202731 Test: atest libuwb_core_test libuwb_uci_packet_tests libuwb_uci_jni_rust_tests ServiceUwbTests FrameworkUwbTests Change-Id: Ib44c6a8b677a8dccfb888d23f9c3d046e348a274
2023-05-18[uwb-uci] Fix reversed mac address in multicast notificationShreshta Manu
Bug: 283265066 Test: atest libuwb_core_tests Change-Id: I268140623076a0c0600ed3325ebf228b3b0c94d7
2023-05-12Fix endianness conversion for multicastAnte
Bug: 271901693 Test: make com.google.android.uwb Change-Id: I4a4928bd579d599cc960968c3ce8a69667e9cedd
2023-05-11Updated UWB Ranging Session Specific Status CodesBhautik Ardeshana
Bug: 281971889 Test: Test dltdoa ranging Change-Id: Ie6d8dd5d5095726e22c64e03751764c43a1c783b
2023-05-10[uwb-uci] gets the UWBS timeStampBhautik Ardeshana
Bug: 276825370 Test: GetTimestamp Change-Id: I325ee4b251a998a6fdf849b683f5987097389457
2023-05-08OwrAoa Measurements return standard status code.Ayush Jain
CR-1037 replaces the usage of specific status code values in an OwrAoa Ranging Measurement with the standard StatusCodes (and adds a new STATUS_CODE_UNKNOWN value earlier used in OwrAoa status code). Bug: 279974481 Test: libuwb_core_test libuwb_uci_packet_tests libuwb_uci_jni_rust_tests ServiceUwbTests FrameworkUwbTests Change-Id: I61508181acadb7782536600470d231b3563cb8b2
2023-05-01uwb(uci): Implement CR-461Roshan Pius
Switches most session UCI commands from using app provided session id to a UWBS generated session handle. Since UWB framework needs to be both 1.0 & 2.0 compatible, introduced a new `session_token` term to refer to session fields in UCI params that could either be session_id (FIRA 1.0) or session_handle (FIRA 2.0). The conversion from `session_id` to `session_handle` is managed inside uci_manager. JNI layer will continue to use the existing session_id as identified. However, since we share the same data structures across UCI core & JNI, there is some leakage of the terminology to the JNI layer. Bug: 270089497 Test: atest CtsUwbMultiDeviceTestCase_FiraRangingTests Test: atest libuwb_uci_packets libuwb_core_tests Change-Id: I93107a1d53b814053dfa1ad5b4425a4aba8509f2
2023-04-28Merge "Add new StatusCodes from CR-1021 and CR-272."Ayush Jain
2023-04-27DO NOT MERGE [uwb-uci] Rename Dt ranging rounds as per CR1080Shreshta Manu
Bug: 279669972 Test: Compiles Change-Id: I4c5b6a1bd4872da104449e1b1c0e5b7183667290 Merged-In: I4c5b6a1bd4872da104449e1b1c0e5b7183667290
2023-04-27Add new StatusCodes from CR-1021 and CR-272.Ayush Jain
1) CR-1021: STATUS_NOT_APPLICABLE (0x0B). 2) CR-272: STATUS_ERROR_UWB_INITIATION_TIME_TOO_OLD (0x1A). Test: libuwb_core_test libuwb_uci_packet_tests libuwb_uci_jni_rust_tests ServiceUwbTests FrameworkUwbTests Bug: 279669973, 276825370 Change-Id: I0b3d369b86af665a8a45212938f06d228d4f96fa
2023-04-25Update Bug number in TODO comments.Ayush Jain
Bug: 261886903 Test: None (only comment change) Change-Id: I86ab580199ed646a3a178b4b603cc036e4341b3d
2023-04-12Reformat uci packet moving values into vendor rangesHenri Chataing
This is more maintaineble long term since the range boundaries do not have to be updated for every new vendor value. Change-Id: If436c98889f1a8d42baa3bacc804d412cb4a671e
2023-04-12Merge "Vendor response packets support"Ayush Jain
2023-04-11[uwb] Add vendor specific range values in PDLShreshta Manu
Added vendor specific ranges for : 1. AppConfigTlvType 2. CapTlvType 3. ReasonCode 4. StatusCode Test: atest libuwb_uci_packet_tests, manual tests Bug: 272775225 Change-Id: I8c9b3b8276dc4194b24c05288d35bde6af3d4b75
2023-04-10Vendor response packets supportAyush Jain
Implement proper parsing of a Response packet received from the HAL, when a Raw UCI CMD was sent. We don't need to interpret the packet's payload bytes, and send only the GID/OID and all payload bytes (without the 4-byte UCI header) to the UWB Service layer. The code also handles receiving fragmented Response packets in response to the Raw UCI CMD. Bug: 272124924 Test: atest libuwb_core_test libuwb_uci_packet_tests libuwb_uci_jni_rust_tests ServiceUwbTests Test: Injected Raw UCI RSP packet (with TagId/SubTagId) parsed Test: Injected 2 Raw UCI RSP packet fragments (with PBF=1, PBF=0 and TagId/SubTagId) parsed Test: Injected Raw UCI NTF packet results in expected sendVendorUciMessage() error Test: Injected Raw UCI packet witb bad MessageType results in expected sendVendorUciMessage() error Change-Id: Ia171540a3484f03349a67528e121510f88327821
2023-04-05Update use of generated PDL enum typesHenri Chataing
- ToPrimitive and FromPrimitive are no longer derived, intead From<uN> and Into<uN> are implemented - The enum type is no longer a primitive type, type conversion needs to be done with uN::from Bug: 267339120 Test: cd src/rust/uwb_uci_packets && cargo build Change-Id: I3d3d14d11448ec6795ab08cff3ca25b55291302c Merged-In: I3d3d14d11448ec6795ab08cff3ca25b55291302c
2023-03-30Merge "uwb(uci): Added LAST_STS_INDEX_USED config into CCC open ranging params"Roshan Pius
2023-03-29uwb(uci): Added LAST_STS_INDEX_USED config into CCC open ranging paramsBhautik Ardeshana
Bug: 268762844 Test: test CCC Change-Id: Iae619b8cf659756515cf02fa34a24680c871b440
2023-03-29[uwb-core] Data transfer payload IE specification for in-band application ↵Bhautik Ardeshana
payload transfer -Implemented queryMaxData size method Bug: 251477752 Test: test DataTransfer Change-Id: I999de4d3608261b30fd5afe34a1597d55b7e1989
2023-03-21[uwb-uci] Add support for vendor data with new pdlShreshta Manu
Bug: 266976487 Test: atest libuwb_core_tests Change-Id: Ibd4d5179634cc76d9c823fcbfa3b9190272efcec
2023-03-17Merge "Integrate with the new PDL compiler"David Duarte
2023-03-15Merge "uwb_uci_packets: align missing capabilities"Treehugger Robot
2023-03-15uwb_uci_packets: align missing capabilitiesOthman BOUADJENAK
Adds UCI packets for capabilities CCC_SUPPORTED_MAX_RANGING_SESSION_NUMBER, SUPPORTED_MIN_SLOT_DURATION_RSTU and SUPPORTED_MAX_RANGING_SESSION_NUMBER. Bug: 273636122 Test: atest libuwb_uci_packet_tests Change-Id: I94c2b770d1e8a513d70332ca1f5650b44907105c
2023-03-14Parse all Rx SESSION_STATUS_NTF.ReasonCode(s).Ayush Jain
1) The SESSION_STATUS_NTF has a State Change with Reason Code field, which contains a Vendor specific space (0x80-0xFF). Currently packet parsing fails when a value is received in this range (as the value is not present in the PDL ReasonCode enum). 2) Add definitions for the new ReasonCode values defined in the UCI spec. Test: atest libuwb_core_test libuwb_uci_packet_tests libuwb_uci_jni_rust_tests, new unit test with ReasonCode value in Vendor Specific space passes. Bug: 270575596 Change-Id: I8a89db728271075683167d7c15cd573ce9913884
2023-03-14[uci] Add new reason code and new status code.ziyiw
Test: compile Bug: 272361935 Change-Id: I39665f54cc56457c357be5350f58bd9d498abd07
2023-03-10Integrate with the new PDL compilerMartin Geisler
The old bluetooth_packetgen compiler would add a “Packet” suffix to every PDL packet — the new compiler does not enforce this. Test: atest --host libuwb_core_tests libuwb_core_cargo_test libuwb_uci_packet_tests Change-Id: I1126eb3c8aea779109f7c5c934eb34c5b34f8832
2023-03-09[uwb-uci] Remove header when sending raw range data ntfShreshta Manu
Bug: 271534941 Test: atest libuwb_uci_packet_tests Change-Id: I76f9215b05a9fa0d80d58fa2c6c0b27cfef89ec6
2023-02-24Fixes for DATA_MESSAGE_SNDAyush Jain
1) Fix the UCI Data Packet header length extracted during fragmentation. 2) Fix the payload data size definition in the Data Message (SND/RCV) packets. It cannot be larger than the size defined in the UCI spec (even for an unfragmented packet). Test: atest Bug: 268567239 Change-Id: I274e37d2018348c9570b3eab006274d086988161
2023-02-16Change order of HAL Data/Control packet definitionAyush Jain
The UCI HAL Data packet has a constraint for the message_type field, while the UCI HAL Control packet deson't (because it covers multiple values). This leads to parsing errors for the UCI HAL data packet. The workaround for this issue is to switch the order of these definitions. This will result in packet bytes first being attempted to be parsed as a UCI HAL Data packet, and then as a Control packet. The code was tested by injecting Data packets in the UciManager (on a HAL Open), and verified that the UWBSessionManager.onDataReceived() is called. Tested for both unfragmented and fragmented data Rx packets (https://paste.googleplex.com/5893713451548672). Bug: 266016401, 269175546 Test: atest ServiceUwbTests FrameworkUwbTests Change-Id: I887c9c9f2918f62e0260a3d3b79b225e5591a131
2023-02-07[uwb-uci] change _payload_ in pdl to of type 8[]Shreshta Manu
_payload_ in pdl would pick the whole packet instead of the remaning items. change them to 8[] so that it picks only the remaining bytes after initial parsing. With this, raw_ntf should consist of all the bytes in ntf packet Bug: 266016401 Test: atest libuwb_uci_packet_tests Test: Manual testing Change-Id: I9f50366e2b14173e818901484b547e395729e6b3
2023-02-02Implement UCI Data Packet TxAyush Jain
[1] Implement UciManager code to send the data packet. [2] Implement flow control (based on DATA_CREDIT_NTF). [3] Use the DATA_TRANSFER_STATUS_NTF to complete the data packet send and return results to the UWB JNI code. This CL does not implement CR490 (DATA_REPITITION related changes for the data packet send flow), will do that in a follow-up CL. Change-Id: I087a7bfcc59877e00751e2131133787b40e6922d Bug: 261886903 Test: atest libuwb_core_test libuwb_uci_packet_tests libuwb_uci_jni_rust_tests ServiceUwbTests FrameworkUwbTests CtsUwbTestCases
2023-02-02Define the UCI packets for Data Tx notificationsAyush Jain
Define the UCI packets for DATA_CREDIT_NTF and DATA_TRANSFER_STATUS_NTF, both of which are notifications received by the host device, when it sends a UCI data packet to the UWBS. Bug: 261886903 Test: atest libuwb_core_test libuwb_uci_packet_tests Change-Id: Idf28355826375052514f7dedd0b8e76b3b8d2352
2023-01-31Implement the UCI CMD/RSP/NTF cleanup in CR-498Ayush Jain
The UCI spec v2.0.0_0.9r0 (released in Jan 2023) contains CR498 which does the following cleanup for UCI CMD/RSP/NTF: - Renames GID 0x02 from RANGING_CONTROL_GROUP to SESSION_CONTROL_GROUP, along with the UCI Commands/Responses/Notifications in the GID. - Moves DATA_CREDIT_NTF and DATA_TRANSFER_STATUS_NTF from GID 0x01 (SESSION_CONFIG) to 0x02 (SESSION_CONTROL). The CL does the PDL as well as corresponding Rust code changes. Bug: 267232898 Test: atest libuwb_core_test libuwb_uci_packet_tests libuwb_uci_jni_rust_tests ServiceUwbTests Change-Id: I7b8ee7bf003fcded545b81d8dcfd4173d0a42227
2023-01-27[uwb_core] Added CAP_SIZE_RANGE config to AppConfigTlvBhautik Ardeshana
Bug: 257223915 Test: check for contention based ranging Change-Id: Ieba5e50a9df07ad1ed917b9e395de388a468b49e
2023-01-20Uwb(service) Added missing configs to support DataTransfer, OWR, ULTDOABhautik Ardeshana
Bug: 251477752, 246678053, 251477118 Test: test DataTransfer, OWRAOA, ULTDOA Change-Id: I1542beb4caca43a782cd137e673eb568e62be41e
2023-01-10[uwb-core] Add support support for custom vendor message typeShreshta Manu
Vendor uci commands can now send messages with type testing_1 and testing_2 which are reserved for testing. FiRa CR-435. Bug: 261377401 Test: atest libuwb_core_tests, atest libuwb_uci_packet_tests Change-Id: I72cdcec5115e47a01e4e5a5f72af00ae2617eb4d
2022-12-28[uwb-core] Add ReasonCode for Ul-TDoAShreshta Manu
Bug: 251477118 Test: compiles Change-Id: I758616b1af382fda6c09608764cf8b88cc28cd5c
2022-12-27Merge "Resolve backward compatibility problem according to CR 511."Bob Wang
2022-12-21Log UCI Data_RCV PacketAyush Jain
Log the UCI DATA_RCV packet's header bytes, which includes the payload length. Bug: 261762781 Test: atest libuwb_core_test libuwb_uci_packet_tests ServiceUwbTests Change-Id: I89c67d6d7f580df0ecdcefbd5cd2858afe6dccb1
2022-12-21Resolve backward compatibility problem according to CR 511.ziyiw
Now we use Action to indicate whether message control field exists. [Ref link](https://groups.firaconsortium.org/wg/Technical/document/3159) Test: atest libuwb_core_tests, libuwb_uci_packet_tests Bug: 232453347 Change-Id: I1f05bb5e61481b71e028e6fce14b746c5dd6345d
2022-12-20UCI Data Rcv packet Processing (with de-frag)Ayush Jain
1) De-fragment the incoming UCI Data packet(s) and call the fn handle_data_rcv() to notify the higher layer about it. 2) Implement the type conversion method from UciPacketHalPacket to UciDataPacketPacket. This is used for de-fragmentation (Rx path). 3) Enhance the defragment method to also defrag Data packets and return either a {Control/Data} packet. Bug: 261762781 Test: atest libuwb_core_test libuwb_uci_packet_tests ServiceUwbTests Change-Id: Id4c4ec0a1c1e6cd160b4e1ef1ee172abb2b3486f
2022-12-16Define UCI Data packet formatRoshan Pius
1) Define the UCI Data (both fragment HAL and unfragmented) packets. 2) Fix the conversion between UciControlPacket and UciPacketHal, for fragmentation and de-fragmentation flows. This uses the UciControlPacketHal defined in PDL for ease. 3) Replace UciControlPacketHal with UciPacketHal as the latter is the incoming packet at the HAL interface. Bug: 261762781 Test: atest libuwb_core_test libuwb_uci_packet_tests Change-Id: I8a6c85ce63f644b41a043310599901f838af5c5f