60 lines
2.0 KiB
C
60 lines
2.0 KiB
C
/****************************************************************************
|
|
|
|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
|
|
|
|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
|
|
be copied by any method or incorporated into another program without
|
|
the express written consent of Aerospace C.Power. This Information or any portion
|
|
thereof remains the property of Aerospace C.Power. The Information contained herein
|
|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
|
|
liability for its use in any way and conveys no license or title under
|
|
any patent or copyright and makes no representation or warranty that this
|
|
Information is free from patent or copyright infringement.
|
|
|
|
****************************************************************************/
|
|
#include "os_types.h"
|
|
#include "os_mem.h"
|
|
|
|
|
|
#include "iot_io_api.h"
|
|
#include "iot_cli.h"
|
|
#include "cli_rf_ic_tool_def.h"
|
|
#include "cli_rf_ic_tool.h"
|
|
#include "cli_plc_ic_tool.h"
|
|
#include "iot_ftm_msg.h"
|
|
#include "iot_ftm_internal.h"
|
|
#include "iot_cli_msg_id_definition.h"
|
|
#include "iot_config.h"
|
|
|
|
#if IOT_CLI_IC_TOOL_EN
|
|
|
|
#include "phy_bb.h"
|
|
#include "phy_phase.h"
|
|
#include "phy_ada_dump.h"
|
|
#include "phy_tools.h"
|
|
#include "hw_phy_init.h"
|
|
#include "mac_reset.h"
|
|
|
|
|
|
extern uint32_t phy_ada_dump_entry(uint32_t dump_addr, uint32_t dump_len);
|
|
|
|
void cli_plc_ada_dump_handler(iot_pkt_t *buffer, uint32_t len)
|
|
{
|
|
cli_kl_cmd_ack ack = { 0 };
|
|
uint32_t dump_addr;
|
|
uint32_t buf_len;
|
|
|
|
cli_plc_ada_dump *ada_dump = (cli_plc_ada_dump *)iot_pkt_data(buffer);
|
|
buf_len = phy_ada_dump_addr_get(&dump_addr);
|
|
IOT_ASSERT(ada_dump->dump_len <= buf_len);
|
|
os_mem_set((uint32_t *)dump_addr, 0, ada_dump->dump_len);
|
|
iot_printf("plc dump addr:%x len:%d\n", dump_addr, ada_dump->dump_len);
|
|
phy_ada_dump_entry(dump_addr, ada_dump->dump_len);
|
|
|
|
ack.result = 0;
|
|
|
|
cli_send_module_msg(CLI_MODULEID_FTM,
|
|
CLI_MSGID_FTM_PLC_ADA_DUMP, (uint8_t *)&ack, sizeof(ack));
|
|
}
|
|
|
|
#endif /* IOT_CLI_IC_TOOL_EN */ |