| | |
| | | #include "sn74hc595.h" |
| | | void bind_reset(void) |
| | | { |
| | | g_com_map[BIND_DEV_ID]=0x00;//重置默认下发ID保存 |
| | | save_com_map_to_flash(); |
| | | g_com_map[BIND_DEV_ID]=0x00;//重置默认下发ID保存 |
| | | save_com_map_to_flash(); |
| | | } |
| | | void message_construct() |
| | | { |
| | | //sprintf(send_buf,"$message,%d,%d,%d,%d,%d,%d,%%f,%lf,%lf,%lf,%lf,%d,%d",Commend_SendDate.messgetype,Commend_SendDate.tagId,Commend_SendDate.bindState, |
| | | //Commend_SendDate.gunLableId,Commend_SendDate.alarmType,Commend_SendDate.power,Commend_SendDate.warnDistance,Commend_SendDate.alarmDistance,Commend_SendDate.lng,Commend_SendDate.lat |
| | | //Commend_SendDate.applyId,Commend_SendDate.result); |
| | | |
| | | //send 4G |
| | | //Commend_SendDate.gunLableId,Commend_SendDate.alarmType,Commend_SendDate.power,Commend_SendDate.warnDistance,Commend_SendDate.alarmDistance,Commend_SendDate.lng,Commend_SendDate.lat |
| | | //Commend_SendDate.applyId,Commend_SendDate.result); |
| | | |
| | | //send 4G |
| | | } |
| | | void message_from_4G_Handler(void) |
| | | { |
| | | |
| | | |
| | | //sscanf(4G_api_buf,"$%*[^,],%d,%d,%d,%d,%lf,%lf,%d",Commend_Datestruct.type,Commend_Datestruct.applyID,Commend_Datestruct.tagId, |
| | | //Commend_Datestruct.gunLableId,Commend_Datestruct.warnDistance,Commend_Datestruct.alarmDistance,Commend_Datestruct.frequency); |
| | | /*根据指令去执行 |
| | | switch(Commend_Datestruct.type) |
| | | case BIND_SUCCESS: |
| | | { |
| | | g_com_map[DEV_ID]=Commend_Datestruct.tagId; |
| | | g_com_map[BIND_DEV_ID]=Commend_Datestruct.gunLableId; |
| | | g_com_map[STATIONARY_TIME]=Commend_Datestruct.warnDistance; |
| | | g_com_map[ALARM_DISTANCE2]=Commend_Datestruct.alarmDistance;//这个距离double和uint格式不符 |
| | | g_com_map[SEND_4G_FREQUENCY]=1000/Commend_Datestruct.frequency; |
| | | } |
| | | break; |
| | | case UNBIND: |
| | | bind_resetbreak(); |
| | | case OPEN_GNSS: |
| | | gnss_forceopen(); |
| | | case CLOSE_VIBRATION: |
| | | vibration_close(); |
| | | case QUARY_INFORMATION: |
| | | //?? |
| | | case CHANGE_POLL_FREQUENCY: |
| | | g_com_map[SEND_4G_FREQUENCY]=Commend_Datestruct.frequency; |
| | | break; |
| | | |
| | | save_com_map_to_flash(); |
| | | */ |
| | | //Commend_Datestruct.gunLableId,Commend_Datestruct.warnDistance,Commend_Datestruct.alarmDistance,Commend_Datestruct.frequency); |
| | | /*根据指令去执行 |
| | | switch(Commend_Datestruct.type) |
| | | case BIND_SUCCESS: |
| | | { |
| | | g_com_map[DEV_ID]=Commend_Datestruct.tagId; |
| | | g_com_map[BIND_DEV_ID]=Commend_Datestruct.gunLableId; |
| | | g_com_map[STATIONARY_TIME]=Commend_Datestruct.warnDistance; |
| | | g_com_map[ALARM_DISTANCE2]=Commend_Datestruct.alarmDistance;//这个距离double和uint格式不符 |
| | | g_com_map[SEND_4G_FREQUENCY]=1000/Commend_Datestruct.frequency; |
| | | } |
| | | break; |
| | | case UNBIND: |
| | | bind_resetbreak(); |
| | | case OPEN_GNSS: |
| | | gnss_forceopen(); |
| | | case CLOSE_VIBRATION: |
| | | vibration_close(); |
| | | case QUARY_INFORMATION: |
| | | //?? |
| | | case CHANGE_POLL_FREQUENCY: |
| | | g_com_map[SEND_4G_FREQUENCY]=Commend_Datestruct.frequency; |
| | | break; |
| | | |
| | | save_com_map_to_flash(); |
| | | */ |
| | | } |
| | | |
| | | void gnss_forceopen(void) |
| | | { |
| | | gps_air780_power_change(1, air780_power_state); |
| | | gps_air780_power_change(1, air780_power_state); |
| | | } |