blob: 10e7c23718dd46c4a298487918d3e1d0f469df30 [file] [log] [blame]
/**
*
* @file amt.h
* @brief
* This file is part of FTM.
* AMT´úÀíÓ¦Óòã
*
* @details
* @author Tools Team.
* @email
* @copyright Copyright (C) 2013 Sanechips Technology Co., Ltd.
* @warning
* @date 2019/02/02
* @version 1.1
* @pre
* @post
*
* @par
* Change History :
* ---------------------------------------------------------------------------
* date version author description
* ---------------------------------------------------------------------------
* 2015/04/28 1.0 lu.xieji Create file
* 2019/02/02 1.1 jiang.fenglin ÐÞ¸Ä×¢ÊÍ·½Ê½Îªdoxygen
* ---------------------------------------------------------------------------
*
*
*/
#ifndef _AMT_H
#define _AMT_H
#define AMT_INFO "<AMT><INFO>"
#define AMT_ERROR "<AMT><ERROR>"
#define AmtPrintf(...) fprintf(stderr, __VA_ARGS__)
//#define AmtPrintf(...) printf(__VA_ARGS__)
#define AMT_USB_DEV "/dev/ttyGS0"
#define AMT_CP_CHANNEL "/dev/rpm9"
#ifdef USE_CAP_SUPPORT
#define AMT_CAP_DEV "/dev/rpmsg15"
#endif
#define AMT_DETECT_USB_OFFLINE "offline@/devices/platform/zx29_hsotg.0/gadget/tty/ttyGS0"
#define AMT_DETECT_USB_ONLINE "online@/devices/platform/zx29_hsotg.0/gadget/tty/ttyGS0"
#define AMT_DETECT_USB_HOTREMOVE "remove@/dwc_usb/usbconfig"
#define MAX_PACKET_LENGTH (128 * 1024)
/**
* ºê¶¨Òå
*/
#define FID_WIFI_CMD_NORTN (0xC0 + 1)
#define FID_WIFI_CMD_RTN (0xC0 + 2)
#define FID_WIFI_CMD_GETVERSION (0xC0 + 3)
#define FID_WIFI_CMD_GETCOUNTERS (0xC0 + 4)
#define FID_WIFI_CMD_END (0xC0 + 7)
#define MSG_DEVICETEST_START (0x0500)
#define MSG_DEVICETEST_END (0x0FFF)
#define FID_EX_COMMON_SETBOOTMODE (0x1000)
#define FID_GET_CHIP_PLATFORM (0x1004)
#define FID_GPS_MODULE_TEST (0x100d)
#define FID_GPS_MODULE_CLOSE (0x100e)
#define FID_GPS_CMD_END (0x1015)
//¼ì²é¶ùͯÊÖ±íÈí¼þ¹·¼ÓÃÜÇøÊý¾ÝÊÇ·ñΪȫ0»òÈ«F
#define FID_CHECK_SOFTDOG_CIPHER_TEXT (0x1080)
//ÉèÖÃµç³Ø¼ì²â±ê־λ
#define FID_SET_BAT_DET_FLAG (0x1081)
//¶Áµç³Ø¼ì²â±ê־λ
#define FID_GET_BAT_DET_FLAG (0x1082)
#define FID_AMT_SYN (0x00C0)
#define FID_AMT_START (0x00C0)
#define FID_AMT_END (0x1FFE)
#define FID_AMT_EXIT (0x1FFF)
#define FID_CUSTOM_START (0x8000)
#define FID_CUSTOM_END (0xFFFF)
//¶ÁдÄÚ²¿ºÍÍⲿ°æ±¾ºÅ
#define FID_RINISOFTVERSION (0xd1)
#define FID_ROUTSOFTVERSION (0xd3)
//´®¿Ú²âÊÔ
#define FID_FUN_TEST_START 0x1016
#define FID_FUN_TEST_END 0x107F
#define FID_OPEN_UART (FID_FUN_TEST_START + 6)
#define FID_CLOSE_UART (FID_FUN_TEST_START + 7)
#ifdef USE_CAP_SUPPORT
//ÐèÒª·¢Ë͵½capºË´¦ÀíµÄÏûÏ¢·¶Î§
#define FID_CAP_TEST_START 0x2000
#define FID_CAP_TEST_END 0x2400
#endif
#define min(X, Y) \
({ typeof (X) __x = (X); \
typeof (Y) __y = (Y); \
(__x < __y) ? __x : __y; })
#define max(X, Y) \
({ typeof (X) __x = (X); \
typeof (Y) __y = (Y); \
(__x > __y) ? __x : __y; })
#ifndef UNUSED
#define UNUSED(x) (void)(x)
#endif
int Amt_CreateResponse(unsigned int msg_id, unsigned char* buf, unsigned int buf_len);
int Amt_ExecuteCmd(char *pcmd, char *pbuffer, int len);
#endif