blob: 8e4414f3407bf4e9d00ac3780619bf2da1cc0b66 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/**
2 *
3 * @file amt.h
4 * @brief
5 * This file is part of FTM.
6 * AMT´úÀíÓ¦Óòã
7 *
8 * @details
9 * @author Tools Team.
10 * @email
11 * @copyright Copyright (C) 2013 Sanechips Technology Co., Ltd.
12 * @warning
13 * @date 2019/02/02
14 * @version 1.1
15 * @pre
16 * @post
17 *
18 * @par
19 * Change History :
20 * ---------------------------------------------------------------------------
21 * date version author description
22 * ---------------------------------------------------------------------------
23 * 2015/04/28 1.0 lu.xieji Create file
24 * 2019/02/02 1.1 jiang.fenglin ÐÞ¸Ä×¢ÊÍ·½Ê½Îªdoxygen
25 * ---------------------------------------------------------------------------
26 *
27 *
28 */
29
30#ifndef _AMT_H
31#define _AMT_H
32
33
34#define AMT_INFO "<AMT><INFO>"
35#define AMT_ERROR "<AMT><ERROR>"
36#define AmtPrintf(...) fprintf(stderr, __VA_ARGS__)
37//#define AmtPrintf(...) printf(__VA_ARGS__)
38
39#define AMT_USB_DEV "/dev/ttyGS0"
40#define AMT_CP_CHANNEL "/dev/rpm9"
lh758261d2023-07-13 05:52:04 -070041#ifdef USE_CAP_SUPPORT
42#define AMT_CAP_DEV "/dev/rpmsg15"
43#endif
lh9ed821d2023-04-07 01:36:19 -070044
45
46#define AMT_DETECT_USB_OFFLINE "offline@/devices/platform/zx29_hsotg.0/gadget/tty/ttyGS0"
47#define AMT_DETECT_USB_ONLINE "online@/devices/platform/zx29_hsotg.0/gadget/tty/ttyGS0"
48#define AMT_DETECT_USB_HOTREMOVE "remove@/dwc_usb/usbconfig"
49
50
51#define MAX_PACKET_LENGTH (128 * 1024)
52
53/**
54 * ºê¶¨Òå
55 */
56#define FID_WIFI_CMD_NORTN (0xC0 + 1)
57#define FID_WIFI_CMD_RTN (0xC0 + 2)
58#define FID_WIFI_CMD_GETVERSION (0xC0 + 3)
59#define FID_WIFI_CMD_GETCOUNTERS (0xC0 + 4)
60#define FID_WIFI_CMD_END (0xC0 + 7)
61
62#define MSG_DEVICETEST_START (0x0500)
63#define MSG_DEVICETEST_END (0x0FFF)
64#define FID_EX_COMMON_SETBOOTMODE (0x1000)
65#define FID_GET_CHIP_PLATFORM (0x1004)
66#define FID_GPS_MODULE_TEST (0x100d)
67#define FID_GPS_MODULE_CLOSE (0x100e)
68#define FID_GPS_CMD_END (0x1015)
69//¼ì²é¶ùͯÊÖ±íÈí¼þ¹·¼ÓÃÜÇøÊý¾ÝÊÇ·ñΪȫ0»òÈ«F
70#define FID_CHECK_SOFTDOG_CIPHER_TEXT (0x1080)
71//ÉèÖÃµç³Ø¼ì²â±ê־λ
72#define FID_SET_BAT_DET_FLAG (0x1081)
73//¶Áµç³Ø¼ì²â±ê־λ
74#define FID_GET_BAT_DET_FLAG (0x1082)
75#define FID_AMT_SYN (0x00C0)
76#define FID_AMT_START (0x00C0)
77#define FID_AMT_END (0x1FFE)
78#define FID_AMT_EXIT (0x1FFF)
79
80#define FID_CUSTOM_START (0x8000)
81#define FID_CUSTOM_END (0xFFFF)
82//¶ÁдÄÚ²¿ºÍÍⲿ°æ±¾ºÅ
83#define FID_RINISOFTVERSION (0xd1)
84#define FID_ROUTSOFTVERSION (0xd3)
85//´®¿Ú²âÊÔ
86#define FID_FUN_TEST_START 0x1016
87#define FID_FUN_TEST_END 0x107F
88#define FID_OPEN_UART (FID_FUN_TEST_START + 6)
89#define FID_CLOSE_UART (FID_FUN_TEST_START + 7)
90
lh758261d2023-07-13 05:52:04 -070091#ifdef USE_CAP_SUPPORT
92//ÐèÒª·¢Ë͵½capºË´¦ÀíµÄÏûÏ¢·¶Î§
93#define FID_CAP_TEST_START 0x2000
94#define FID_CAP_TEST_END 0x2400
95#endif
96
xf.libe704612024-05-28 19:09:12 -070097#define FID_LTEA_PHY_MSG (0x5F)
lh9ed821d2023-04-07 01:36:19 -070098
99#define min(X, Y) \
100 ({ typeof (X) __x = (X); \
101 typeof (Y) __y = (Y); \
102 (__x < __y) ? __x : __y; })
103
104#define max(X, Y) \
105 ({ typeof (X) __x = (X); \
106 typeof (Y) __y = (Y); \
107 (__x > __y) ? __x : __y; })
108
109#ifndef UNUSED
110#define UNUSED(x) (void)(x)
111#endif
112
113int Amt_CreateResponse(unsigned int msg_id, unsigned char* buf, unsigned int buf_len);
114int Amt_ExecuteCmd(char *pcmd, char *pbuffer, int len);
115
116#endif
117