lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /**
|
| 2 | *
|
| 3 | * @file amt_agent_devicetest.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 | * 2016/12/12 1.0 lu.xieji Create file
|
| 24 | * 2019/02/02 1.1 jiang.fenglin ÐÞ¸Ä×¢ÊÍ·½Ê½Îªdoxygen
|
| 25 | * ---------------------------------------------------------------------------
|
| 26 | *
|
| 27 | *
|
| 28 | */
|
| 29 |
|
| 30 | #ifndef _AMT_AGENT_DEVICETEST_H
|
| 31 | #define _AMT_AGENT_DEVICETEST_H
|
| 32 | //#include "zcore_type.h"
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 | //#include "amt_agent_ref.h"
|
| 37 |
|
| 38 | // TestItem: 1~100
|
| 39 | #define TEST_COMMON 0
|
| 40 | #define TEST_INFO 1
|
| 41 | #define TEST_KEYBOARD 2
|
| 42 | #define TEST_LCD 3
|
| 43 | #define TEST_LCDBACKLIGHT 4
|
| 44 | #define TEST_VIBRATOR 5
|
| 45 | #define TEST_SIM 6
|
| 46 | #define TEST_SD 7
|
| 47 | #define TEST_BATTERY 8
|
| 48 | #define TEST_KEYBACKLIGHT 9
|
| 49 | #define TEST_CAMERA_BACK 10
|
| 50 | #define TEST_CAMERA_FRONT 11
|
| 51 | #define TEST_AUDIO 12
|
| 52 | #define TEST_TP 13
|
| 53 | #define TEST_GSENSOR 14
|
| 54 | #define TEST_CHARGER 15
|
| 55 | #define TEST_FLASH_LIGHT 16
|
| 56 | #define TEST_WIFI 17
|
| 57 |
|
| 58 |
|
| 59 | // Common
|
| 60 | #define MSG_DEVICETEST_STATUS_IDLE (MSG_DEVICETEST_START + 0x00)
|
| 61 | #define MSG_DEVICETEST_TESTINIT (MSG_DEVICETEST_START + 0x01)
|
| 62 |
|
| 63 | // Test info
|
| 64 | #define MSG_DEVICETEST_TESTINFO (MSG_DEVICETEST_START + 0x20)
|
| 65 | // Keyboard
|
| 66 | #define MSG_DEVICETEST_KEYBOARD_START (MSG_DEVICETEST_START + 0x30)
|
| 67 | #define MSG_DEVICETEST_KEYBOARD_STOP (MSG_DEVICETEST_START + 0x31)
|
| 68 | #define MSG_DEVICETEST_KEYBOARD_READ (MSG_DEVICETEST_START + 0x32)
|
| 69 |
|
| 70 | // LCD
|
| 71 | #define MSG_DEVICETEST_LCD_START (MSG_DEVICETEST_START + 0x40)
|
| 72 | #define MSG_DEVICETEST_LCD_STOP (MSG_DEVICETEST_START + 0x41)
|
| 73 | //µ¥°åLCD²âÊÔ
|
| 74 | #define MSG_DEVICETEST_LCD_BOARD (MSG_DEVICETEST_START + 0x42)
|
| 75 |
|
| 76 | // LCD backlight
|
| 77 | #define MSG_DEVICETEST_LCDBACKLIGHT_START (MSG_DEVICETEST_START + 0x50)
|
| 78 | #define MSG_DEVICETEST_LCDBACKLIGHT_STOP (MSG_DEVICETEST_START + 0x51)
|
| 79 | // Vibrator
|
| 80 | #define MSG_DEVICETEST_VIBRATOR_START (MSG_DEVICETEST_START + 0x60)
|
| 81 | #define MSG_DEVICETEST_VIBRATOR_STOP (MSG_DEVICETEST_START + 0x61)
|
| 82 | // SIM
|
| 83 | #define MSG_DEVICETEST_SIM_READ (MSG_DEVICETEST_START + 0x70)
|
| 84 | // SD
|
| 85 | #define MSG_DEVICETEST_SD_READ (MSG_DEVICETEST_START + 0x80)
|
| 86 | // Battery&charger
|
| 87 | #define MSG_DEVICETEST_BATTERY_VOLTAGE (MSG_DEVICETEST_START + 0x90)
|
| 88 | #define MSG_DEVICETEST_BATTERY_TEMPERATURE (MSG_DEVICETEST_START + 0x91)
|
| 89 | #define MSG_DEVICETEST_CHARGER_STATUS (MSG_DEVICETEST_START + 0x92)
|
| 90 | // Keybacklight
|
| 91 | #define MSG_DEVICETEST_KEYBACKLIGHT_START (MSG_DEVICETEST_START + 0xA0)
|
| 92 | #define MSG_DEVICETEST_KEYBACKLIGHT_STOP (MSG_DEVICETEST_START + 0xA1)
|
| 93 | // Camera
|
| 94 | #define MSG_DEVICETEST_CAMERA_BACK_START (MSG_DEVICETEST_START + 0xB0)
|
| 95 | #define MSG_DEVICETEST_CAMERA_BACK_SNAPSHOT (MSG_DEVICETEST_START + 0xB1)
|
| 96 | #define MSG_DEVICETEST_CAMERA_BACK_STOP (MSG_DEVICETEST_START + 0xB2)
|
| 97 | //µ¥°åÉãÏñÍ·²âÊÔ
|
| 98 | #define MSG_DEVICETEST_CAMERA_BOARD (MSG_DEVICETEST_START + 0xB3)
|
| 99 | // Audio
|
| 100 | #define MSG_DEVICETEST_AUDIO_MIC_RECEIVER (MSG_DEVICETEST_START + 0xC0)
|
| 101 | #define MSG_DEVICETEST_AUDIO_MIC_SPEAKER (MSG_DEVICETEST_START + 0xC1)
|
| 102 | #define MSG_DEVICETEST_AUDIO_HEADSET_HEADSET (MSG_DEVICETEST_START + 0xC2)
|
| 103 | //È˹¤²âÊÔÀ®°ÈºÍÂó¿ËÌí¼ÓÍ£Ö¹²âÊÔÏûÏ¢
|
| 104 | #define MSG_DEVICETEST_AUDIO_MIC_RECEIVER_STOP (MSG_DEVICETEST_START + 0xC3)
|
| 105 | #define MSG_DEVICETEST_AUDIO_MIC_SPEAKER_STOP (MSG_DEVICETEST_START + 0xC4)
|
| 106 | // Flashlight
|
| 107 | #define MSG_DEVICETEST_FLASHLIGHT_START (MSG_DEVICETEST_START + 0xD0)
|
| 108 | #define MSG_DEVICETEST_FLASHLIGHT_STOP (MSG_DEVICETEST_START + 0xD1)
|
| 109 | // TP´¥ÃþÆÁ
|
| 110 | #define MSG_DEVICETEST_TP_START (MSG_DEVICETEST_START + 0xE0)
|
| 111 | #define MSG_DEVICETEST_TP_STOP (MSG_DEVICETEST_START + 0xE1)
|
| 112 | //µ¥°åTP²âÊÔ
|
| 113 | #define MSG_DEVICETEST_TP_BOARD (MSG_DEVICETEST_START + 0xE2)
|
| 114 | // G-Sensor
|
| 115 | #define MSG_DEVICETEST_GSENSOR_START (MSG_DEVICETEST_START + 0xF0)
|
| 116 | #define MSG_DEVICETEST_GSENSOR_STOP (MSG_DEVICETEST_START + 0xF1)
|
| 117 | //µ¥°åG-Sensor²âÊÔ
|
| 118 | #define MSG_DEVICETEST_GSENSOR_BOARD (MSG_DEVICETEST_START + 0xF2)
|
| 119 | //WiFi²âÊÔ(ËÑÈȵã)
|
| 120 | #define MSG_DEVICETEST_WIFI (MSG_DEVICETEST_START + 0x100)
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 | #define AMT_SUCCESS_RET (0)
|
| 125 | #define AMT_ERROR_RET (-1)
|
| 126 |
|
| 127 | //µ¥°å¹¦ÄܲâÊÔʹÓõÄһЩÉ豸·¾¶
|
| 128 | #define TP_MODE_PATH "/sys/class/input/input2/tp_mode"
|
| 129 | #define DEVICE_GSENSOR "/dev/mir3da"
|
| 130 | #define DEVICE_CAMERA "/dev/camera_device"
|
| 131 | #define BATTERY_TEMPERATURE_PATH "/sys/class/power_supply/battery/temp"
|
| 132 | #define CHARGER_STATUS_PATH "/sys/class/power_supply/charger/status"
|
| 133 | #define DEVICE_LCD "/dev/fb0"
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 | typedef int (*process_func)(unsigned int msg_id, unsigned char *msg_buf, unsigned int msg_len);
|
| 139 |
|
| 140 | typedef struct
|
| 141 | {
|
| 142 | unsigned int item_id;
|
| 143 | unsigned int msg_id;
|
| 144 | process_func fun;
|
| 145 | char *test_name;
|
| 146 | } T_COMMAND;
|
| 147 |
|
| 148 | enum
|
| 149 | {
|
| 150 | LCD_COLOR_WHITE = 0,
|
| 151 | LCD_COLOR_RED,
|
| 152 | LCD_COLOR_GREEN,
|
| 153 | LCD_COLOR_BLUE,
|
| 154 | LCD_COLOR_BLACK,
|
| 155 | MAX_LCD_COLOR_NUM
|
| 156 | };
|
| 157 |
|
| 158 | typedef struct
|
| 159 | {
|
| 160 | int result;
|
| 161 | int length;
|
| 162 | } T_DeviceTest_Header;
|
| 163 | /*
|
| 164 | typedef struct
|
| 165 | {
|
| 166 | SINT32 keyValue;
|
| 167 | BOOL keyFlag;
|
| 168 | SINT32 staticID;
|
| 169 | }T_ZWndEm_CheckKey;
|
| 170 | */
|
| 171 |
|
| 172 | /**
|
| 173 | * @brief AMTÍâÉè²âÊÔ³õʼ»¯
|
| 174 | * @return ³É¹¦·µ»Ø0, ʧ°Ü·µ»Ø-1
|
| 175 | * @note
|
| 176 | * @see
|
| 177 | */
|
| 178 | int Amt_DeviceTest_Init(void);
|
| 179 |
|
| 180 | /**
|
| 181 | * @brief AMTÍâÉèÏûÏ¢´¦Àíº¯Êý
|
| 182 | * @param[in] msg_id FID
|
| 183 | * @param[in] msg_buf ½ÓÊÕÊý¾Ýbuffer
|
| 184 | * @param[in] msg_len ½ÓÊÕÊý¾Ýbuffer³¤¶È
|
| 185 | * @return ³É¹¦·µ»Ø0, ʧ°Ü·µ»Ø-1
|
| 186 | * @note
|
| 187 | * @see
|
| 188 | */
|
| 189 | int Amt_DeviceTest_ProcessMsg(unsigned int msg_id, unsigned char *msg_buf, unsigned int msg_len);
|
| 190 |
|
| 191 | /**
|
| 192 | * @brief AMTÍâÉèÏûÏ¢·´À¡¸øPC
|
| 193 | * @param[in] msg_id FID
|
| 194 | * @param[in] result ״̬Âë
|
| 195 | * @param[in] msg_buf ½ÓÊÕÊý¾Ýbuffer
|
| 196 | * @param[in] msg_len ½ÓÊÕÊý¾Ýbuffer³¤¶È
|
| 197 | * @return ³É¹¦·µ»Ø0, ʧ°Ü·µ»Ø-1
|
| 198 | * @note
|
| 199 | * @see
|
| 200 | */
|
| 201 | int Amt_DeviceTest_SendMsg(unsigned int msg_id, int result, unsigned char *msg_buf, unsigned int msg_len);
|
| 202 |
|
| 203 | #endif
|
| 204 |
|