feat: 添加杰理 JL7016 SOC 代码生成模板

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-19 16:05:36 +08:00
co-authored by Cursor
parent 0eda925f58
commit 16bffd16b2
914 changed files with 254709 additions and 45 deletions
@@ -0,0 +1,99 @@
/**
* \file tuya_ble_event_handler.h
*
* \brief
*/
/*
* Copyright (C) 2014-2019, Tuya Inc., All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of tuya ble sdk
*/
#ifndef TUYA_BLE_EVENT_HANDLER_H__
#define TUYA_BLE_EVENT_HANDLER_H__
#include "tuya_ble_type.h"
#ifdef __cplusplus
extern "C" {
#endif
void tuya_ble_handle_device_info_update_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_dp_data_reported_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_dp_data_with_time_reported_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_dp_data_with_time_string_reported_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_dp_data_with_flag_reported_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_dp_data_with_flag_and_time_reported_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_dp_data_with_flag_and_time_string_reported_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_dp_data_send_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_dp_data_with_time_send_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_device_unbind_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_factory_reset_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_ota_response_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_bulk_data_evt(tuya_ble_evt_param_t *p_evt);
void tuya_ble_handle_data_passthrough_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_data_prod_test_response_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_uart_cmd_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_ble_cmd_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_net_config_response_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_time_request_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_extend_time_request_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_unbound_response_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_anomaly_unbound_response_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_device_reset_response_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_connect_change_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_ble_data_evt(uint8_t *buf, uint16_t len);
void tuya_ble_handle_connecting_request_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_link_update_evt(tuya_ble_evt_param_t *evt);
void tuya_ble_handle_weather_data_request_evt(tuya_ble_evt_param_t *evt);
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,74 @@
/**
* \file tuya_ble_secure.h
*
* \brief
*/
/*
* Copyright (C) 2014-2019, Tuya Inc., All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of tuya ble sdk
*/
#ifndef TUYA_BLE_SECURE_H_
#define TUYA_BLE_SECURE_H_
#include "tuya_ble_type.h"
#ifdef __cplusplus
extern "C" {
#endif
enum {
ENCRYPTION_MODE_NONE,
ENCRYPTION_MODE_KEY_1,
ENCRYPTION_MODE_KEY_2,
ENCRYPTION_MODE_KEY_3,
ENCRYPTION_MODE_KEY_4,
ENCRYPTION_MODE_SESSION_KEY,
ENCRYPTION_MODE_ECDH_KEY,
ENCRYPTION_MODE_FTM_KEY,
ENCRYPTION_MODE_MAX,
};
bool tuya_ble_register_key_generate(uint8_t *output, tuya_ble_parameters_settings_t *current_para);
uint8_t tuya_ble_encryption(uint16_t protocol_version, uint8_t encryption_mode, uint8_t *iv, uint8_t *in_buf, uint32_t in_len, uint32_t *out_len, uint8_t *out_buf, tuya_ble_parameters_settings_t *current_para_data, uint8_t *dev_rand);
uint8_t tuya_ble_encrypt_old_with_key(uint8_t *key, uint8_t *in_buf, uint8_t in_len, uint8_t *out_buf);
bool tuya_ble_device_id_encrypt(uint8_t *key_in, uint16_t key_len, uint8_t *input, uint16_t input_len, uint8_t *output);
bool tuya_ble_device_id_decrypt(uint8_t *key_in, uint16_t key_len, uint8_t *input, uint16_t input_len, uint8_t *output);
bool tuya_ble_device_id_encrypt_v4(uint8_t *key_in, uint16_t key_len, uint8_t *input, uint16_t input_len, uint8_t *output);
uint8_t tuya_ble_decryption(uint16_t protocol_version, uint8_t const *in_buf, uint32_t in_len, uint32_t *out_len, uint8_t *out_buf, tuya_ble_parameters_settings_t *current_para_data, uint8_t *dev_rand);
bool tuya_ble_server_cert_data_verify(const uint8_t *p_data, uint16_t data_len, const uint8_t *p_sig);
bool tuya_ble_sig_data_verify(const uint8_t *p_pk, const uint8_t *p_data, uint16_t data_len, const uint8_t *p_sig);
void tuya_ble_event_process(tuya_ble_evt_param_t *tuya_ble_evt);
#ifdef __cplusplus
}
#endif
#endif // TUYA_BLE_SECURE_H_