diff options
author | Ayush Jain <ayushjain@google.com> | 2023-01-19 03:29:11 +0000 |
---|---|---|
committer | Ayush Jain <ayushjain@google.com> | 2023-02-02 06:42:03 +0000 |
commit | 00a27e61d6e14f1002a3c951b06dbf8eaeed6cb7 (patch) | |
tree | cbb30ebea2edca268ecd2cf31cabd347c63adacb /src/rust/uwb_uci_packets | |
parent | ef8969252495aaeccd032ce03996bfb5003c82ff (diff) | |
download | uwb-00a27e61d6e14f1002a3c951b06dbf8eaeed6cb7.tar.gz |
Define the UCI packets for Data Tx notifications
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
Diffstat (limited to 'src/rust/uwb_uci_packets')
-rw-r--r-- | src/rust/uwb_uci_packets/uci_packets.pdl | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/src/rust/uwb_uci_packets/uci_packets.pdl b/src/rust/uwb_uci_packets/uci_packets.pdl index 81a090e..c47bd34 100644 --- a/src/rust/uwb_uci_packets/uci_packets.pdl +++ b/src/rust/uwb_uci_packets/uci_packets.pdl @@ -152,6 +152,22 @@ enum DataRcvStatusCode : 8 { UCI_STATUS_UNKNOWN = 0x02, } +enum CreditAvailability : 8 { + CREDIT_NOT_AVAILABLE = 0, + CREDIT_AVAILABLE = 1, +} + +// The UCI spec defines these status codes for a DATA_TRANSFER_STATUS_NTF packet. +enum DataTransferNtfStatusCode : 8 { + UCI_DATA_TRANSFER_STATUS_REPETITION_OK = 0x00, + UCI_DATA_TRANSFER_STATUS_OK = 0x01, + UCI_DATA_TRANSFER_STATUS_ERROR_DATA_TRANSFER = 0x02, + UCI_DATA_TRANSFER_STATUS_ERROR_NO_CREDIT_AVAILABLE = 0x03, + UCI_DATA_TRANSFER_STATUS_ERROR_REJECTED = 0x04, + UCI_DATA_TRANSFER_STATUS_SESSION_TYPE_NOT_SUPPORTED = 0x05, + UCI_DATA_TRANSFER_STATUS_ERROR_DATA_TRANSFER_IS_ONGOING = 0x06, +} + enum FiraComponent : 8 { UWBS = 0x00, HOST = 0x01, @@ -423,7 +439,7 @@ packet UciDataPacket { _payload_, } -packet UciDataSnd : UciDataPacket (data_packet_format = DATA_SND) { +packet UciDataSnd : UciDataPacket (data_packet_format = DATA_SND, message_type = DATA) { session_id: 32, dest_mac_address: 64, dest_fira_component: FiraComponent, @@ -432,7 +448,7 @@ packet UciDataSnd : UciDataPacket (data_packet_format = DATA_SND) { data: 8[] } -packet UciDataRcv : UciDataPacket (data_packet_format = DATA_RCV) { +packet UciDataRcv : UciDataPacket (data_packet_format = DATA_RCV, message_type = DATA) { session_id: 32, status: DataRcvStatusCode, uci_sequence_number: 32, @@ -503,8 +519,6 @@ packet AndroidNotification : UciNotification (group_id = VENDOR_ANDROID) { _body_, } -// TODO(b/261886903): Define the DATA_CREDIT_NTF and DATA_STATUS_NTF packets. - // TODO: b/202760099: Use the correspnding opcode enum instead of the raw value in the |opcode| field. packet DeviceResetCmd : CoreCommand (opcode = 0x0) { //CORE_DEVICE_RESET reset_config: ResetConfig, @@ -849,6 +863,26 @@ test SessionUpdateControllerMulticastListNtf { "\x61\x07\x00\x06\x00\x00\x00\x00\x01\x02\x03\x04\x00", } +packet DataCreditNtf : SessionControlNotification (opcode = 0x04) { // SESSION_DATA_CREDIT_NTF + session_id: 32, + credit_availability: CreditAvailability, +} + +test DataCreditNtf { + "\x62\x04\x00\x05\x00\x00\x00\x00\x00\x00\x01\x01", +} + +packet DataTransferStatusNtf : SessionControlNotification (opcode = 0x05) { // SESSION_DATA_TRANSFER_STATUS_NTF + session_id: 32, + uci_sequence_number: 8, + status: DataTransferNtfStatusCode, + // TODO(b/261886903): Add the tx_count field for implementing the DATA_REPETITION added in CR490. +} + +test DataTransferStatusNtf { + "\x62\x05\x00\x06\x00\x00\x00\x00\x00\x00\x01\x01\x00", +} + packet SessionStartCmd : SessionControlCommand (opcode = 0x0) { //RANGE_START session_id: 32, } |