From: luozheng <1732036298@qq.com> Date: Sat, 19 Jul 2025 03:54:03 +0000 (+0800) Subject: protocol文件夹合并提交 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~244 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=2b09edd23d4db34c61f9434f8810343ac1faab47;p=mirrors%2FFD230.git protocol文件夹合并提交 --- diff --git a/code/sdk/protocol/bt/host/bt/bts/bg_common/include/ahi_common/mpc_code_def.h b/code/sdk/protocol/bt/host/bt/bts/bg_common/include/ahi_common/mpc_code_def.h index e20f7e089..894930986 100644 --- a/code/sdk/protocol/bt/host/bt/bts/bg_common/include/ahi_common/mpc_code_def.h +++ b/code/sdk/protocol/bt/host/bt/bts/bg_common/include/ahi_common/mpc_code_def.h @@ -572,6 +572,7 @@ typedef enum { } mc_bt_pts_command_type; #define BT_SHIFT_BITS_8 8 +#define BT_INDEX_2 2 #define cmd_id_2_opcode(service_id, command_id) (((service_id) << BT_SHIFT_BITS_8) | (command_id)) #ifdef __cplusplus diff --git a/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_pan_service.c b/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_pan_service.c index 9c78b0b2a..d60bb297f 100644 --- a/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_pan_service.c +++ b/code/sdk/protocol/bt/host/bt/bts/bt_sample/br_profile/sample_pan_service.c @@ -65,9 +65,10 @@ static void sample_pan_net_state_callback(uint8_t net_state) bts_sample_log("sample pan net_state=%u\n", net_state); } -static void sample_pan_rpt_ethernet(uint8_t *packet, uint16_t packet_length) +static void sample_pan_rpt_ethernet(uint8_t *packet, uint16_t packet_length, uint16_t network_protocol) { - bts_sample_log("sample pan rpt ethernet length=%lu, first_byte=0x%x\n.", packet_length, *packet); + bts_sample_log("sample pan rpt ethernet network_protocol = 0x%x, length=%lu, first_byte=0x%x\n.", + network_protocol, packet_length, *packet); } static pan_callbacks_t g_sample_pan_callbacks_t = { @@ -103,8 +104,15 @@ static void sample_pan_write_data(const char **params, int32_t params_cnt) 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69 }; - int result = pan_service_write_data(ip_packet, 60); - bts_sample_log("sample pan write data result=%d.\n", result); + int result = pan_service_write_data(ip_packet, sizeof(ip_packet), + PAN_NETWORK_PROTOCOL_IPV4, PAN_PACKET_TYPE_DEST_ONLY_UNICAST); + bts_sample_log("sample pan write ipv4 data result=%d.\n", result); + result = pan_service_write_data(ip_packet, sizeof(ip_packet), + PAN_NETWORK_PROTOCOL_ARP, PAN_PACKET_TYPE_DEST_ONLY_BORADCAST); + bts_sample_log("sample pan write arp data result=%d.\n", result); + result = pan_service_write_data(ip_packet, sizeof(ip_packet), + PAN_NETWORK_PROTOCOL_IPV4, PAN_PACKET_TYPE_COMPRESSED); + bts_sample_log("sample pan write compressed data result=%d.\n", result); } btsrv_sample_cmd_hdl_info g_pan_sample_hdls[] = { diff --git a/code/sdk/protocol/bt/host/bt/bts/sdk/inc/stack_api/stack_pan_if.h b/code/sdk/protocol/bt/host/bt/bts/sdk/inc/stack_api/stack_pan_if.h index 3d5ae41b6..31afdaf14 100644 --- a/code/sdk/protocol/bt/host/bt/bts/sdk/inc/stack_api/stack_pan_if.h +++ b/code/sdk/protocol/bt/host/bt/bts/sdk/inc/stack_api/stack_pan_if.h @@ -22,7 +22,8 @@ typedef struct { } btsdkpan_cbk; int32_t btsdk_pan_write_filter_ipv4only(uint8_t *addr); -int32_t btsdk_pan_write_ethernet(uint8_t *addr, uint8_t *ip_packet, uint16_t packet_length); +int32_t btsdk_pan_write_ethernet(uint8_t *addr, uint8_t *ip_packet, uint16_t packet_length, + uint16_t network_protocol, uint8_t packet_type); void btsdk_pan_register_callback(const btsdkpan_cbk *callback); int32_t pan_register_cbk(void);