lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /**
|
| 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"
|
| 41 |
|
| 42 |
|
| 43 | #define AMT_DETECT_USB_OFFLINE "offline@/devices/platform/zx29_hsotg.0/gadget/tty/ttyGS0"
|
| 44 | #define AMT_DETECT_USB_ONLINE "online@/devices/platform/zx29_hsotg.0/gadget/tty/ttyGS0"
|
| 45 | #define AMT_DETECT_USB_HOTREMOVE "remove@/dwc_usb/usbconfig"
|
| 46 |
|
| 47 |
|
| 48 | #define MAX_PACKET_LENGTH (128 * 1024)
|
| 49 |
|
| 50 | /**
|
| 51 | * ºê¶¨Òå
|
| 52 | */
|
| 53 | #define FID_WIFI_CMD_NORTN (0xC0 + 1)
|
| 54 | #define FID_WIFI_CMD_RTN (0xC0 + 2)
|
| 55 | #define FID_WIFI_CMD_GETVERSION (0xC0 + 3)
|
| 56 | #define FID_WIFI_CMD_GETCOUNTERS (0xC0 + 4)
|
| 57 | #define FID_WIFI_CMD_END (0xC0 + 7)
|
| 58 |
|
| 59 | #define MSG_DEVICETEST_START (0x0500)
|
| 60 | #define MSG_DEVICETEST_END (0x0FFF)
|
| 61 | #define FID_EX_COMMON_SETBOOTMODE (0x1000)
|
| 62 | #define FID_GET_CHIP_PLATFORM (0x1004)
|
| 63 | #define FID_GPS_MODULE_TEST (0x100d)
|
| 64 | #define FID_GPS_MODULE_CLOSE (0x100e)
|
| 65 | #define FID_GPS_CMD_END (0x1015)
|
| 66 | //¼ì²é¶ùͯÊÖ±íÈí¼þ¹·¼ÓÃÜÇøÊý¾ÝÊÇ·ñΪȫ0»òÈ«F
|
| 67 | #define FID_CHECK_SOFTDOG_CIPHER_TEXT (0x1080)
|
| 68 | //ÉèÖÃµç³Ø¼ì²â±ê־λ
|
| 69 | #define FID_SET_BAT_DET_FLAG (0x1081)
|
| 70 | //¶Áµç³Ø¼ì²â±ê־λ
|
| 71 | #define FID_GET_BAT_DET_FLAG (0x1082)
|
| 72 | #define FID_AMT_SYN (0x00C0)
|
| 73 | #define FID_AMT_START (0x00C0)
|
| 74 | #define FID_AMT_END (0x1FFE)
|
| 75 | #define FID_AMT_EXIT (0x1FFF)
|
| 76 |
|
| 77 | #define FID_CUSTOM_START (0x8000)
|
| 78 | #define FID_CUSTOM_END (0xFFFF)
|
| 79 | //¶ÁдÄÚ²¿ºÍÍⲿ°æ±¾ºÅ
|
| 80 | #define FID_RINISOFTVERSION (0xd1)
|
| 81 | #define FID_ROUTSOFTVERSION (0xd3)
|
| 82 | //´®¿Ú²âÊÔ
|
| 83 | #define FID_FUN_TEST_START 0x1016
|
| 84 | #define FID_FUN_TEST_END 0x107F
|
| 85 | #define FID_OPEN_UART (FID_FUN_TEST_START + 6)
|
| 86 | #define FID_CLOSE_UART (FID_FUN_TEST_START + 7)
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 | #define min(X, Y) \
|
| 91 | ({ typeof (X) __x = (X); \
|
| 92 | typeof (Y) __y = (Y); \
|
| 93 | (__x < __y) ? __x : __y; })
|
| 94 |
|
| 95 | #define max(X, Y) \
|
| 96 | ({ typeof (X) __x = (X); \
|
| 97 | typeof (Y) __y = (Y); \
|
| 98 | (__x > __y) ? __x : __y; })
|
| 99 |
|
| 100 | #ifndef UNUSED
|
| 101 | #define UNUSED(x) (void)(x)
|
| 102 | #endif
|
| 103 |
|
| 104 | int Amt_CreateResponse(unsigned int msg_id, unsigned char* buf, unsigned int buf_len);
|
| 105 | int Amt_ExecuteCmd(char *pcmd, char *pbuffer, int len);
|
| 106 |
|
| 107 | #endif
|
| 108 |
|