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 = {
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[] = {
} 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);