Other_Define.H
上传用户:zanguozi01
上传日期:2014-02-19
资源大小:155k
文件大小:12k
源码类别:

GPS编程

开发平台:

Others

  1. /********************************************************
  2. * 文件名:  Other_Define.H
  3. * 创建时间:2005年3月22日
  4. * 创建人:  
  5. * 版本号:  V2.1
  6. * 功能:   有关方面的一些定义(具体可看详细细节)
  7. * 文件属性:公共文件
  8. * 修改历史:(每条详述)
  9. 补充说明:根据M22模块相关的一些管脚设置
  10. ********************************************************/
  11. #ifndef __Other_Define_H
  12. #define __Other_Define_H
  13. /*
  14. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  15. 一些控制管脚的定义
  16. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  17. */
  18. //版本V3.8
  19. #define WDI 0x01 //P6.0  out 喂狗操作,翻转外部看门狗的输入电平管脚
  20. #define POWER_ON_OFF 0x40 //P6.6  out 控制GPS,GSM电源开关
  21. #define STOP_Q1 0x20 //P6.5  out 执行制动的控制管脚1
  22. #define STOP_Q2 0x10 //P6.4  out 执行制动的控制管脚2
  23. #define ACC_TEST 0x01 //P3.0 in 检测车载ACC电平
  24. #define ARALM 0x40 //P2.6 in  检测是否有被劫报警的管脚
  25. #define DISP_TEST 0x08 //P6.3 in 检测是否允许发送显示凭数据的管脚
  26. #define SEL_MIC 0x80 //P6.7  out 选择语音通道
  27. #define MCU_STATUS 0x10 //P1.4 out
  28. #define RING_TEST 0x01 //P1.0 in 作为检测在TCP在线的状态下,是否有电话打入
  29. #define NL_CHK 0x10 //P2.7 in  空载/重载的检测线
  30. #define CHECK_ON_OFF 0x20 //P2.5 in  制动系统执行结果检测
  31. /*
  32. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  33. 16位针对下行带ACK的SMS,在需要响应上行的SMS中带上ACK的图表
  34. 数据存储在gSMS_ACK[]相应的数据中
  35. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  36. */
  37. #define TRACK_ASKECHO_ACK 0 //轨迹查询响应--定位数据的ACK
  38. #define ALARM_ACK 1 //车辆报警ACK
  39. #define RECORD_EQUIPMENT_ACK 2 //外接部件的ACK命令
  40. #define SET_PHONE_LIMIT_ECHO_ACK 3 //中心设置电话权限设置的响应的ACK
  41. /*
  42. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  43.     语音音量的档位分类
  44. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  45. */
  46. #define ONE 1
  47. #define TWO 2
  48. #define THREE 3
  49. #define FOUR 4
  50. /*
  51. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  52. 其他一些常量的定义
  53. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  54. */
  55. #define DIS_LON 28.67
  56. #define DIS_LAT 30.92
  57. #define OFF_TIME 15000 //关断2576的时间( 毫秒)
  58. #define DELAY_TIME 10000 //开启2576后的延迟时间(毫秒)
  59. #define M22_NULECHO_TIME 200 //G20 在200秒内无任何返回,则需要复位G20
  60. #define M22_LAND_TIME 30 //如果未成功收到下行的登陆信息,则每隔30秒进行登陆发送
  61. #define TCP_TEST_TIME 60 //在GPRS正常在线状态下,发送一个数据包(会有返回GPRS的数据包)的间隔(秒)
  62. #define ALARM_CIRCLE_TIME 60 //1分钟的报警周期
  63. #define GPS_INVALID_COUNT 3600  //gps数据如果超过个小时仍然是无效点,则需要将GPS模块进行复位操作
  64. #define NO_OUTPUT_TIME 40 //统计GPS无任何输出的时间量单位为秒
  65. #define GPS_LOW_TIME 10 //gps的RESET管脚持续低电平的时间(秒)
  66. #define STEAL_ALARM_COUNT 30 //满足被盗报警有速度大于3.6*4的连续点数的计数
  67. #define SEARCH_PASS_TIME 200 //在历史轨迹查询的过程中,需要间隔500毫秒进行的下一页的查询
  68. #define ROB_TIME 3000 //表示按下被劫报警开关的持续时间(单位为毫秒)
  69. #define HANDLE_OUT_TIME 130 //如果持续计时超过5分钟,无收到手柄的任何命令,则认为手柄处于被摘除状态
  70. #define DISP_OUT_TIME 130 //如果持续4分钟,无收到显示终端的下行命令,则认为显示终端处于关闭状态
  71. #define ALLOW_STOP_SPEED 3 //允许进行制动的速度
  72. #define OVER_TESTSMS_TIME 300 //测试SMS的发送的超过5分钟
  73. #define OVER_TCP_TIME 200 //超过200秒未接收到下行的握手数据
  74. #define GSM_CHECKCSQ_TIME 30 //在GSM工作方式下查询CSQ的时间间隔30秒
  75. #define  TCP_CHECKCSQ_TIME 200 //在TCP工作方式下查询CSQ的时间间隔200秒
  76. #define TCP_TRACK_MINTIME 1200 //如果TCP的行车轨迹是否长期在线的分水岭
  77. #define RING_TEST_TIME 220 //在TCP在线的状态下,检测电平的时间
  78. #define RELAND_TCP_TIME 180 //4分钟的时间间隔进行下一次的TCP的登陆
  79. #define TEST_ACC_TIME 5000 //持续检测ACC的检测时间
  80. #define ACC_LASTOFF_TIME 600//1800     //检测ACC关闭持续超过1小时则关闭两模块的工作
  81. #define ACC_CHANGEOFF_TIME 240 //检测ACC关闭超过20分钟,则改变行车轨迹的上传间隔
  82. #define ACCOFF_TRACK_TIME 1800 //作为ACC关闭后,需要转换行车轨迹上传点的分界点,半个小时一上传数据点
  83. #define DISTANCE_COMPASTATE 12 //作为暂时的GPS数据无效果,并且ACC处于开启状态下的里程统计的补偿
  84. #define INTER_ATRA_TEST 2 //作为检测区域报警的时间间隔
  85. #define ALLOW_PHONE_TIME 1800 //允许进行30分钟的通话
  86. //#define  GET_DRIVER_INFO_TIME 10 //如果没有成功记录仪的驾驶员信息,则需要周期发送的时间间隔(单位秒)
  87. //#define  WAIT_RETURNINFO_TIME 30 //向记录仪发送查询驾驶员信息后,等待响应的时间
  88. #define  READY_SENDINFO_TIME 5 //准备向显示屏发送驾驶员信息的等待时间
  89. #define  WAIT_DISPINFO_TIME 10 //
  90. #define RSET_GPS_TIME 60 //如果GPS超过60秒,输出格式不正确
  91. #define  OVER_RECORD_DATA_TIME 300 //超过300秒没有接收到记录仪的时间
  92. #define  MAX_TCP_DATA_LENGHT 1000 //最大发送TCP的数据的长度
  93. #define RLAOD_FLASH_TIME 36000 //10个小时不管处于什么状态,需要重新启动程序
  94. #define MAX_LING_DISTANCE 300 //线路偏离的最大限制距离(米)
  95. #define ALARM_COUNT 10 //允许通过SMS发送报警数据的次数
  96. #define HANGUP_COUNT 40 //如果40秒内无任何接听或者挂断命令处理,则主动挂断电话
  97. #define SMS_DATA_TIME 1800 //如果TCP不在线的,通过SMS方式上报数据的间隔20分钟
  98. #define CHECK_SYS_PAR_TIME 1800
  99. //与GSM操作有关的步骤变量
  100. #define GSM_PHONE 1 //与电话有关联的相关处理
  101. #define GSM_OTHER 2 //与其他如CLCC,CSQ,CSCA相关的处理
  102. #define GSM_SMS_IN 3 //与GSM接收数据有关的相关处理
  103. #define GSM_SMS_OUT 4 //与GSM发送数据有关的相关处理
  104. #define LAND_TCP_OPER 5 //与定期检查GPRS网络有关的相关处理
  105. #define GPRS_DATA_OPER 6 //与通过GPRS网络发送数据的相关处理
  106. /*
  107. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  108. 手柄状态的定义(M22的相关状态变量)
  109. unsigned char  gPhone_Status=0
  110. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  111. */
  112. #define  READY 0 //待机状态
  113. #define  INCOMING 1 //来电状态
  114. #define  DAILING 2 //正在拨号状态(包括手柄,和监听拨号状态)
  115. #define  ACTIVE_HANDLE 3 //手柄正在通话状态
  116. #define  ACTIVE_MONITOR 4 //监听状态
  117. /*
  118. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  119. 车载GPS与记录仪之间的通讯类型
  120. unsigned char  gStatus=0
  121. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  122. */
  123. #define NORMAL_TYPE 0 //处于正常车载GPS与记录仪通讯方式
  124. #define DISP_TYPE 2 //处于显示终端与记录仪通讯方式
  125. #define CENTER_TYPE 1 //处于中心下行与记录仪通讯方式
  126. //存储在buffer1的0x30---0x4f相关的关于手柄的AT指令的标志,存储在0x31
  127. #define H_DIAL 0x01 //ATD指令的标志
  128. #define H_ANSWER 0x02 //ATA指令的标志
  129. #define H_HUNGUP 0x03 //ATH指令的标志
  130. #define H_VOLADJ 0x04 //音量调节的标志
  131. #define H_DTMF 0x05 //DTMF的标志
  132. #define M_DIAL 0x06 //监听指令
  133. /*
  134. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  135. 报警类型的定义存储报警类型的变量gFlag 为char型,因为最高位被用做来表示
  136. GPS数据的有效和无效标志,则能表示报警类型的是后7位,故最多能表示127种类型的报警
  137. unsigned char gAlarm_Type=0
  138. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  139. */
  140. #define NOP_ALARM 0 //无任何报警信息
  141. #define ROB_ALARM 1 //被劫报警
  142. #define STEAL_ALARM 2 //被盗报警
  143. #define OVER_AREA_ALARM 3 //区域报警
  144. #define OVER_SPEED_ALARM 4 //超速报警
  145. #define OVER_TIRE_ALARM 10 //疲劳驾驶报警
  146. #define OVER_LINE_ALARM 5 //线路偏离报警
  147. /*
  148. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  149. 存储在Circle_Buffer[]中需要周期发送的数据的类型
  150. 变量:unsigned char gCycle_Send_Status=0
  151. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  152. */
  153. #define NOP_DATA 0 //不属于任何类型的数据
  154. #define TRACK_DATA_TIME 1 //属于按时间上传行车轨迹点的数据
  155. #define TRACK_DATA_DISTANCE 2 //属于按间隔距离上传轨迹点的数据
  156. #define ALARM_DATA 3 //属于报警数据
  157. #define WATCH_DATA 4 //属于监控数据
  158. #define PASS_DATA 5 //属于历史轨迹数据
  159. #define SAVE_DATA 6 //属于盲区补偿数据
  160. /*
  161. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  162. 表示监控的类型
  163. 变量:unsigned char gWatch_Type=0
  164. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  165. */
  166. #define WATCH_TYPE_NULL 0 //表示无任何类型的监控
  167. #define WATCH_TYPE_TIME  1 //表示定时监控类型
  168. #define WATCH_TYPE_COUNT 2 //表示定量监控类型
  169. /*
  170. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  171. 表示接收到TCP下行的进入/退出联网状态的下行命令
  172. 变量:unsigned char gTCP_Status_Temp=0
  173. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  174. */
  175. #define TCP_STATUS_READY 0 //表示未接收到此命令或者命令处理完之后的
  176. #define TCP_STATUS_LAND_ECHO 1 //表示接收到此命令后,需要开启登陆TCP的标志
  177. #define TCP_STATUS_QUIT_ECHO 2 //表示接收到此命令后,需要退出登陆的TCP标志
  178. #define TCP_STATUS_ALLOW_LAND 3
  179. #define TCP_STATUS_ALLOW_QUIT 4
  180. #define TCP_STATUS_QUIT_READY 5
  181. /*
  182. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  183. 表示设防状态的常量
  184. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  185. */
  186. #define DEFENCE_NO 0 //表示车载终端未处于设防状态
  187. #define DEFENCE_YES 1 //表示车载终端已经处于设防状态
  188. /*
  189. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  190. 表示命令返回ECHO的常量
  191. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  192. */
  193. #define COMMAND_ERROR 0 //表示命令处理返回不成功
  194. #define COMMAND_OK 1 //表示命令处理返回成功
  195. /*
  196. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  197. 表示M22当前状态的常量  gM22_Status
  198. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  199. */
  200. #define GSM_WORK 0 //M22处理GSM的工作方式下
  201. #define TCP_HANG_WORK 1 //M22处于TCP已经登陆上,但处于挂起状态
  202. #define TCP_ONLINE_WORK 2 //M22处于TCP已经登陆上,处于非挂起状态
  203. /*
  204. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  205. 表示M22当前状态的常量  gM22_Stop_Status
  206. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  207. */
  208. #define NOP_READY 0 //针对制动处于待机状态
  209. #define ALLOW_SET_STOP 1 //接收到下行的允许制动的命令后的状态
  210. #define ASK_SET_STOP 2 //执行制动后,检测制动结果的状态
  211. #define ALLOW_FREE_STOP 3 //接收到下行的允许解除制动的命令后的状态
  212. #define ASK_FREE_STOP 4 //执行解除制动后,检测解除制动结果后的状态
  213. #define STOP_STATUS 5 //车载设备已经处于正常的断油断电的状态
  214. /*
  215. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  216. 表示M22当前状态的常量  gDriver_Info
  217. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  218. */
  219. #define READY_READ_DRIVER_INFO 0
  220. #define WAIT_RETURN_DRIVER_INFO 1
  221. #define GET_DRIVER_INFO 2
  222. #define WAIT_SEND_DRIVER_INFO 3
  223. #define SEND_DRIVER_INFO_OK 4
  224. #endif