[Fira-1037] corrections and clarifications on status codes

Bug: 285984668
Test: Unit tests
Change-Id: Ib3d11710ad106b7c052655bf0952b67063ec2203
diff --git a/src/rust/uwb_core/protos/uwb_service.proto b/src/rust/uwb_core/protos/uwb_service.proto
index 8867460..d7c4c38 100644
--- a/src/rust/uwb_core/protos/uwb_service.proto
+++ b/src/rust/uwb_core/protos/uwb_service.proto
@@ -76,6 +76,7 @@
   UCI_STATUS_UNKNOWN_OID = 8;
   UCI_STATUS_READ_ONLY = 9;
   UCI_STATUS_COMMAND_RETRY = 10;
+  UCI_STATUS_UNKNOWN = 11;
 
   UCI_STATUS_SESSION_NOT_EXIST = 17;
   UCI_STATUS_SESSION_DUPLICATE = 18;
diff --git a/src/rust/uwb_core/src/proto/mappings.rs b/src/rust/uwb_core/src/proto/mappings.rs
index 15e66f1..c10cf0e 100644
--- a/src/rust/uwb_core/src/proto/mappings.rs
+++ b/src/rust/uwb_core/src/proto/mappings.rs
@@ -116,6 +116,7 @@
             ProtoStatusCode::UCI_STATUS_UNKNOWN_OID => StatusCode::UciStatusUnknownOid,
             ProtoStatusCode::UCI_STATUS_READ_ONLY => StatusCode::UciStatusReadOnly,
             ProtoStatusCode::UCI_STATUS_COMMAND_RETRY => StatusCode::UciStatusCommandRetry,
+            ProtoStatusCode::UCI_STATUS_UNKNOWN => StatusCode::UciStatusUnknown,
             ProtoStatusCode::UCI_STATUS_SESSION_NOT_EXIST => StatusCode::UciStatusSessionNotExist,
             ProtoStatusCode::UCI_STATUS_SESSION_DUPLICATE => StatusCode::UciStatusSessionDuplicate,
             ProtoStatusCode::UCI_STATUS_SESSION_ACTIVE => StatusCode::UciStatusSessionActive,
@@ -199,6 +200,7 @@
             StatusCode::UciStatusUnknownOid => ProtoStatusCode::UCI_STATUS_UNKNOWN_OID,
             StatusCode::UciStatusReadOnly => ProtoStatusCode::UCI_STATUS_READ_ONLY,
             StatusCode::UciStatusCommandRetry => ProtoStatusCode::UCI_STATUS_COMMAND_RETRY,
+            StatusCode::UciStatusUnknown => ProtoStatusCode::UCI_STATUS_UNKNOWN,
             StatusCode::UciStatusSessionNotExist => ProtoStatusCode::UCI_STATUS_SESSION_NOT_EXIST,
             StatusCode::UciStatusSessionDuplicate => ProtoStatusCode::UCI_STATUS_SESSION_DUPLICATE,
             StatusCode::UciStatusSessionActive => ProtoStatusCode::UCI_STATUS_SESSION_ACTIVE,
diff --git a/src/rust/uwb_core/src/uci/notification.rs b/src/rust/uwb_core/src/uci/notification.rs
index 1de2bb7..d99f602 100644
--- a/src/rust/uwb_core/src/uci/notification.rs
+++ b/src/rust/uwb_core/src/uci/notification.rs
@@ -150,7 +150,7 @@
     pub session_token: SessionToken,
 
     /// The status of the data rx.
-    pub status: DataRcvStatusCode,
+    pub status: StatusCode,
 
     /// The sequence number of the data packet.
     pub uci_sequence_num: u16,
diff --git a/src/rust/uwb_core/src/uci/response.rs b/src/rust/uwb_core/src/uci/response.rs
index d0f308e..d70f9f7 100644
--- a/src/rust/uwb_core/src/uci/response.rs
+++ b/src/rust/uwb_core/src/uci/response.rs
@@ -211,7 +211,9 @@
                 ))
             }
             SessionConfigResponseChild::SessionQueryMaxDataSizeRsp(evt) => {
-                Ok(UciResponse::SessionQueryMaxDataSize(Ok(evt.get_max_data_size())))
+                Ok(UciResponse::SessionQueryMaxDataSize(
+                    status_code_to_result(evt.get_status()).map(|_| evt.get_max_data_size()),
+                ))
             }
             SessionConfigResponseChild::SessionSetHybridConfigRsp(evt) => {
                 Ok(UciResponse::SessionSetHybridConfig(status_code_to_result(evt.get_status())))
diff --git a/src/rust/uwb_core/src/uci/uci_manager.rs b/src/rust/uwb_core/src/uci/uci_manager.rs
index 8db7b32..a1a97f1 100644
--- a/src/rust/uwb_core/src/uci/uci_manager.rs
+++ b/src/rust/uwb_core/src/uci/uci_manager.rs
@@ -2865,7 +2865,7 @@
         let app_data = vec![0x01, 0x02, 0x03];
         let data_rcv_payload = vec![
             0x05, 0x00, 0x00, 0x00, // SessionToken
-            0x00, // DataRcvStatusCode
+            0x00, // StatusCode
             0xa0, 0xb0, 0xc0, 0xd0, 0xa1, 0xb1, 0xc1, 0xd1, // MacAddress
             0x0a, 0x00, // UciSequenceNumber
             0x03, 0x00, // AppDataLen
@@ -2876,7 +2876,7 @@
         let data_packet_rcv = build_uci_packet(mt_data, pbf, dpf, oid, data_rcv_payload);
         let expected_data_rcv_notification = DataRcvNotification {
             session_token: session_id,
-            status: DataRcvStatusCode::UciStatusSuccess,
+            status: StatusCode::UciStatusOk,
             uci_sequence_num,
             source_address,
             payload: app_data,
@@ -2925,7 +2925,7 @@
         let app_data_fragment_1_len = 200;
         let mut data_rcv_payload_fragment_1: Vec<u8> = vec![
             0x05, 0x00, 0x00, 0x00, // SessionToken
-            0x00, // DataRcvStatusCode
+            0x00, // StatusCode
             0xa0, 0xb0, 0xc0, 0xd0, 0xa1, 0xb1, 0xc1, 0xd1, // MacAddress
             0x0a, 0x00, // UciSequenceNumber
             0x2c, 0x01, // AppData Length (300)
@@ -2947,7 +2947,7 @@
             build_uci_packet(mt_data, pbf_fragment_2, dpf, oid, data_rcv_payload_fragment_2);
         let expected_data_rcv_notification = DataRcvNotification {
             session_token: session_id,
-            status: DataRcvStatusCode::UciStatusSuccess,
+            status: StatusCode::UciStatusOk,
             uci_sequence_num,
             source_address,
             payload: app_data,
diff --git a/src/rust/uwb_uci_packets/uci_packets.pdl b/src/rust/uwb_uci_packets/uci_packets.pdl
index f507a8e..1f3969c 100644
--- a/src/rust/uwb_uci_packets/uci_packets.pdl
+++ b/src/rust/uwb_uci_packets/uci_packets.pdl
@@ -176,6 +176,7 @@
     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,
+    UCI_DATA_TRANSFER_STATUS_INVALID_FORMAT = 0x07,
 }
 
 enum ResetConfig : 8 {
@@ -536,7 +537,7 @@
 
 packet UciDataRcv : UciDataPacket (data_packet_format = DATA_RCV, message_type = DATA) {
     session_token: 32, // Session ID or Session Handle (based on UWBS version)
-    status: DataRcvStatusCode,
+    status: StatusCode,
     source_mac_address: 64,
     uci_sequence_number: 16,
     _size_(data): 16,
@@ -1026,11 +1027,12 @@
 
 packet SessionQueryMaxDataSizeRsp : SessionConfigResponse (opcode = 0xB) { //QUER_MAX_DATA_SIZE
     session_token: 32, // Session ID or Session Handle (based on UWBS version)
+    status: StatusCode,
     max_data_size: 16,
 }
 
 test SessionQueryMaxDataSizeRsp {
-  "\x41\x0B\x00\x06\x00\x00\x00\x00\x0E7\0x07",
+  "\x41\x0B\x00\x06\x00\x00\x00\x00\x00\x0E7\0x07",
 }
 
 packet SessionStartCmd : SessionControlCommand (opcode = 0x0) { //RANGE_START