//
|
// Created by YY on 2020/1/7.
|
//
|
|
#ifndef MYAPPLICATION2_COMM_IF_H
|
#define MYAPPLICATION2_COMM_IF_H
|
|
#include <cstdint>
|
#include "../driver_test.h"
|
|
struct mcuBrief {
|
char version[70];
|
int selftest;
|
// int gpio;
|
// int speed;
|
// int engine;
|
char sn[20];
|
};
|
|
struct canBrief {
|
int gpio;
|
int rpm;
|
double speed;
|
double voltage;
|
};
|
|
struct carSensorBrief {
|
int odo;
|
int trip;
|
int tripTime;
|
double cellVolt;
|
double speed;
|
int engine;
|
int sas;
|
int key;
|
int gear;
|
int aps;
|
int door;
|
int seatBelt;
|
int clutch;
|
int horn;
|
int wiper;
|
int handBreak;
|
int mainBreak;
|
int leftTurnLamp;
|
int rightTurnLamp;
|
int clearanceLamp;
|
int dippedBeamLamp;
|
int mainBeamLamp;
|
int fogLamp;
|
int assBreak;
|
int surround1;
|
int surround2;
|
int surround3;
|
int surround4;
|
};
|
|
struct cardBrief {
|
int result;
|
char card[32];
|
};
|
|
struct gpsBrief {
|
char utc[32];
|
int sat_num;
|
int qf;
|
double latitude;
|
double longitude;
|
double altitude;
|
double speed;
|
double trackTure;
|
};
|
|
struct rtkBrief {
|
char utc[32];
|
int qf;
|
double coord_x;
|
char coord_x_dir;
|
double coord_y;
|
char coord_y_dir;
|
double heading;
|
double pitch;
|
double roll;
|
|
int sat_num;
|
double latitude;
|
double longitude;
|
double altitude;
|
double speed;
|
double trackTure;
|
};
|
|
struct carBrief {
|
char utc[32];
|
int qf;
|
int map_id;
|
int move;
|
double speed;
|
double heading;
|
double pitch;
|
double roll;
|
double main_ant[2];
|
int axial[2];
|
int left_front_tire[2];
|
int right_front_tire[2];
|
int left_rear_tire[2];
|
int right_rear_tire[2];
|
int *body;
|
int bodyNum;
|
double *point;
|
int pointNum;
|
};
|
|
struct roadStatusBrief {
|
int road_id;
|
int status;
|
};
|
|
struct crossingStatusBrief {
|
int road_id;
|
int crossing_index;
|
int status;
|
};
|
|
void MA_MainProcMsgEntry(int cmd, const char *value);
|
void MA_MainProcBinMsgEntry(int cmd, const uint8_t *value, int length);
|
|
void MA_Init(void);
|
void MA_NdkStart(void);
|
void MA_ReqRtkPlatformConfig(void);
|
void MA_RtkPlatformConnect(int conn, const char *ip, int port);
|
void MA_RtkPlatformRegister(int reg, const uint8_t *pwd, int length);
|
void MA_RtkPlatformLogin(int login);
|
void MA_ReadMap(void);
|
void MA_ReadCar(void);
|
void MA_ReadSensor(void);
|
void MA_SendExamStatus(int start, int errorCode);
|
void MA_SendCardBrief(const struct cardBrief *brief);
|
void MA_SendMcuBrief(const struct mcuBrief *brief);
|
void MA_SendCarSensorBrief(const struct carSensorBrief *brief);
|
void MA_SendGpsBrief(const struct gpsBrief *brief);
|
void MA_SendRtkBrief(const struct rtkBrief *brief);
|
void MA_SendCarPosition(const struct carBrief *brief);
|
void MA_SendExamWrong(vector<ExamFault> &ExamFaultList);
|
void MA_SendRtcmInd(int length);
|
void MA_SendDebugInfo(const char *str, ...);
|
void MA_EnterMap(int map_id, int type, int enter);
|
void MA_ExamLight(void);
|
|
void MA_SendDistance(double l, double r);
|
|
void MA_SendRoadStatus(const struct roadStatusBrief *brief);
|
void MA_SendCrossingStatus(const struct crossingStatusBrief *brief);
|
void MA_SendCanStatus(const struct canBrief *brief);
|
|
void MA_SendBlueStatus(int status);
|
|
#endif //MYAPPLICATION2_COMM_IF_H
|