51 lines
1009 B
C
51 lines
1009 B
C
#pragma once
|
|
|
|
#define CLS_HEARTBEAT_INTERVAL_MS 1000
|
|
|
|
#include "cls_device.pb.h"
|
|
|
|
typedef cls_device_Type CLS_Type_t;
|
|
|
|
typedef cls_device_Position CLS_Position_Option_t;
|
|
|
|
typedef struct CLS_Position {
|
|
CLS_Position_Option_t p0:4;
|
|
CLS_Position_Option_t p1:4;
|
|
} CLS_Position_t;
|
|
|
|
|
|
typedef struct CLS_HeatbeatData
|
|
{
|
|
struct
|
|
{
|
|
uint8_t major;
|
|
uint8_t minor;
|
|
uint8_t patch;
|
|
uint8_t count;
|
|
}firmware_version;
|
|
|
|
CLS_Type_t type;
|
|
uint8_t id;
|
|
uint8_t counter;
|
|
CLS_Position_t position;
|
|
} CLS_HeatbeatData_t;
|
|
|
|
|
|
typedef struct CLS_VehicleStatus {
|
|
uint8_t k15;
|
|
uint8_t headlight;
|
|
uint8_t engine;
|
|
uint8_t speed;
|
|
uint8_t unlocked;
|
|
uint8_t reserved[3];
|
|
} CLS_VehicleStatus_t;
|
|
|
|
extern uint8_t gCLS_DEVICE_ADDRESS;
|
|
|
|
|
|
void CLS_Init(void);
|
|
void CLS_SendEventChangeTypePostion(uint16_t canid, CLS_Type_t newType, CLS_Position_t newPostion);
|
|
|
|
const CLS_VehicleStatus_t * CLS_GetVehicleStatus(void);
|
|
|
|
void CLS_VehicleHeatbeat(void *argument); |