EC600U_esp32_iap_uart/HiLinkSDK/adapter/hilink_open_config_adapter.c

115 lines
3.6 KiB
C
Raw Normal View History

2024-02-05 17:39:56 +08:00
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2019-2021. All rights reserved.
* Description: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD> (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>)
*/
#include "hilink_open_config_adapter.h"
#include "hilink_typedef.h"
/*
* <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1<EFBFBD><EFBFBD>ʾʧ<EFBFBD><EFBFBD>
*/
int HILINK_InitConfig(void)
{
return 0;
}
/*
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HiLink<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
* configType<EFBFBD><EFBFBD>ʾHiLink<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* HILINK_RUNNING_CONFIG HiLink<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* HILINK_TIMER_CONFIG HiLink<EFBFBD><EFBFB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HILINK_ConfigType configType, const unsigned char *buf, unsigned int len)
{
//int ret; //Quectel larson.li <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δʹ<CEB4><CAB9><EFBFBD><EFBFBD>ʱע<CAB1>͵<EFBFBD>
if (buf == NULL) {
return -1;
}
switch (configType) {
case HILINK_RUNNING_CONFIG:
/* HiLink<6E><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
break;
case HILINK_TIMER_CONFIG:
/* HiLink<6E><6B>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>Ҫ<EFBFBD><D2AA>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
case HILINK_BRIDGE_CONFIG:
/* HiLink<6E><6B><EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>ǰΪ<C7B0><CEAA><EFBFBD>豸ʱ<E8B1B8><CAB1>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
case HILINK_HKS_CONFIG:
/* <20>˵<EFBFBD><CBB5>˰<EFBFBD>ȫhichain<69><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><E6B4A2><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>Ҫ<EFBFBD>˵<EFBFBD><CBB5>˹<EFBFBD><CBB9><EFBFBD>ʱ<EFBFBD><CAB1>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
case HILINK_URL_CONFIG:
/* HiLink<6E><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
case HILINK_URL_BAK_CONFIG:
/* HiLink<6E><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
case HILINK_BRG_SUBDEV_NODE:
/* HiLink<6E><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>ʹ<EFBFBD><CAB9>meshͨ<68><CDA8><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><D8B9>ܵ<EFBFBD><DCB5><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
case HILINK_BRG_SUBDEV_MAP:
/* HiLink<6E><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸map<61><70><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>ʹ<EFBFBD><CAB9>meshͨ<68><CDA8><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><D8B9>ܵ<EFBFBD><DCB5><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
default:
return -1;
}
return 0;
}
/*
* <EFBFBD><EFBFBD>ȡHiLink<EFBFBD><EFB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EFBFBD>ʾHiLink<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1<EFBFBD><EFBFBD>ʾʧ<EFBFBD><EFBFBD>
*/
int HILINK_ReadConfig(enum HILINK_ConfigType configType, unsigned char *buf, unsigned int len)
{
if (buf == NULL) {
return -1;
}
switch (configType) {
case HILINK_RUNNING_CONFIG:
/* HiLink<6E><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
break;
case HILINK_TIMER_CONFIG:
/* HiLink<6E><6B>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>Ҫ<EFBFBD><D2AA>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
case HILINK_BRIDGE_CONFIG:
/* HiLink<6E><6B><EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>ǰΪ<C7B0><CEAA><EFBFBD>豸ʱ<E8B1B8><CAB1>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
case HILINK_HKS_CONFIG:
/* <20>˵<EFBFBD><CBB5>˰<EFBFBD>ȫhichain<69><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><E6B4A2><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>Ҫ<EFBFBD>˵<EFBFBD><CBB5>˹<EFBFBD><CBB9><EFBFBD>ʱ<EFBFBD><CAB1>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
case HILINK_URL_CONFIG:
/* HiLink<6E><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
case HILINK_URL_BAK_CONFIG:
/* HiLink<6E><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
case HILINK_BRG_SUBDEV_NODE:
/* HiLink<6E><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>ʹ<EFBFBD><CAB9>meshͨ<68><CDA8><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><D8B9>ܵ<EFBFBD><DCB5><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
case HILINK_BRG_SUBDEV_MAP:
/* HiLink<6E><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸map<61><70><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>ʹ<EFBFBD><CAB9>meshͨ<68><CDA8><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><D8B9>ܵ<EFBFBD><DCB5><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> */
break;
default:
return -1;
}
return 0;
}