Conversation
39ad88d to
0fefb61
Compare
| } | ||
|
|
||
| memcpy(bt_addr.addr, addr->a.val, sizeof(bt_address_t)); | ||
| cs_msg_t* msg = cs_msg_new(CAPBLITIES_RECEIVED_EVT, &bt_addr); |
There was a problem hiding this comment.
Record address type as well.
BTW, cs_msg_t and CAPBLITIES_RECEIVED_EVT are not defined in this patch. We need to ensure each patch performs at least some function without critical issues.
There was a problem hiding this comment.
Alternatively, make message definition as the very first commit, followed by SAL interface definitions.
There was a problem hiding this comment.
This policy didn't exist during development; such detailed breakdowns were too manpower-intensive.
There was a problem hiding this comment.
The cs uses le for addr, and modifying this would involve significant changes. A separate section will be provided later to standardize the use of le addr.
| memcpy(bt_addr.addr, addr->a.val, sizeof(bt_address_t)); | ||
| cs_msg_t* msg = cs_msg_new(CAPBLITIES_RECEIVED_EVT, &bt_addr); | ||
| bt_srv_conn_le_cs_capabilities_t *capabilities = malloc(sizeof(bt_srv_conn_le_cs_capabilities_t)); | ||
| memcpy(capabilities, params, sizeof(bt_srv_conn_le_cs_capabilities_t)); |
There was a problem hiding this comment.
bt_srv_conn_le_cs_capabilities_tis not defined in this commit.- There should be a converson from
struct bt_conn_le_cs_capabilitiestobt_srv_conn_le_cs_capabilities_t. We can not ensure these two structure always the same.
There was a problem hiding this comment.
- This policy didn't exist during development; such detailed breakdowns were too manpower-intensive.
- done
| } | ||
|
|
||
| memcpy(bt_addr.addr, addr->a.val, sizeof(bt_address_t)); | ||
| cs_msg_t* msg = cs_msg_new(PROCEDURE_DONE_EVT, &bt_addr); |
There was a problem hiding this comment.
cs_msg_t* msg = cs_msg_new(PROCEDURE_DONE_EVT, (bt_address_t*)addr->a.val);
No need to copy the address one more time.
There was a problem hiding this comment.
bt_addr_le_t is defined in zephyr, bt_address_t is defined in vela, It is not recommended to send the address directly.
| /** Number of antenna paths used during the phase measurement stage. | ||
| */ | ||
| uint8_t num_antenna_paths; | ||
| /** Number of CS steps in the subevent. |
There was a problem hiding this comment.
num_steps_reported should be enough to describe the data contained in step_data_buf,
Why do we need an abort_step?
There was a problem hiding this comment.
Step number, on which the subevent was aborted
| uint8_t abort_step; | ||
| } header; | ||
|
|
||
| uint16_t len; |
There was a problem hiding this comment.
Is there only one step_data_buf in each sal_cs_subevent_result_t?
If so, num_steps_reported and len are redundant;
If not, we need multiple len + step_data_buf
There was a problem hiding this comment.
num_steps_reported and len are not the same thing.
|
|
||
| uint16_t len; | ||
| uint8_t *step_data_buf; | ||
| } sal_cs_subevent_result_t; |
There was a problem hiding this comment.
Do we have Num_Antenna_Paths, Step_Mode[i], Step_Channel[i]?
|
|
||
| bt_status_t bt_sal_cs_read_remote_supported_capabilities(bt_controller_id_t id, bt_address_t* addr); | ||
| bt_status_t bt_sal_cs_set_default_settings(bt_controller_id_t id, bt_address_t* addr, | ||
| bt_le_srv_cs_set_default_settings_param_t* params); |
There was a problem hiding this comment.
Add const for all the pointers, they should not be modified at SAL
There was a problem hiding this comment.
I don't think it's necessary; other documents do the same.
|
|
||
| CS_DBG_EVENT(sm, &cs_sm->addr, event); | ||
| switch (event) { | ||
| case CONNECTED_EVT: |
There was a problem hiding this comment.
Which event should be received when distance measure finished? CONNECTED_EVT?
There was a problem hiding this comment.
PROCEDURE_DONE_EVT
There was a problem hiding this comment.
There is no PROCEDURE_DONE_EVT in started_process_event
|
|
||
| /** Procedure done status */ | ||
| typedef enum { | ||
| GATTS_LE_CS_PROCEDURE_COMPLETE = 0x0, |
There was a problem hiding this comment.
These events are not belongs to GATT.
|
|
||
| static bt_srv_conn_le_cs_capabilities_t* zblue_convert_cs_capabilities_to_service(struct bt_conn_le_cs_capabilities* params) | ||
| { | ||
|
|
| memcpy(bt_addr.addr, addr->a.val, sizeof(bt_address_t)); | ||
| msg = cs_msg_new(CAPABILITIES_RECEIVED_EVT, &bt_addr); | ||
| capabilities = zblue_convert_cs_capabilities_to_service(params); | ||
| msg->cs_data.data = (void*)capabilities; |
There was a problem hiding this comment.
Actually nobody is using this data?
There was a problem hiding this comment.
Leave it to the future
|
|
||
| SAL_CHECK_RET_WITH_CONN(bt_le_cs_read_local_supported_capabilities(capabilities), 0, conn); | ||
|
|
||
| convert_cs_capabilities_to_service(params, capabilities); |
There was a problem hiding this comment.
bt_le_cs_read_local_supported_capabilities is assigned directly.
service->zephyr->service
There was a problem hiding this comment.
Modified by jialu later
01be3bc to
dd6177e
Compare
bug: v/80281 Rootcause: CS needs to report config, subevent, and other callbacks. Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
bug: v/80281 Rootcause: Add control interfaces such as CS config to the SAL layer. Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
dd6177e to
19b95bd
Compare
bug: v/80281 Rootcuase: add cs state machine to manager cs procedure. Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
bug: v/80281 Rootcause: Add a CS service to manage CS. Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
bug: v/80281 Rootcuase: this file used for ras server. Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
bug: v/80281 Rootcause: Add a socket server and client to enable communication between the user and Bluetooth. Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
bug: v/80281 Rootcause: Add bttool to test CS functionality Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
bug: v/80281 Rootcause: Add CS configuration and makefile to manage CS compilation. Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
19b95bd to
6882688
Compare
No description provided.