You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RaceSubCar/VoiceReportCommand.h

77 lines
1.8 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// VoiceRepotCommand.h
#ifndef _VOICEREPORTCOMMAND_h
#define _VOICEREPORTCOMMAND_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
#include "CommandEncoder.h"
/*
* 关于语音播报标志物:
* 1. 数据的查询:数据查询的结果会被返回到主车而不是从车。
* 2. 语音合成从车的ZigBee限制了8位带校验和数据导致此功能无法实现。
*/
class VoiceReportCommand : private CommandEncoder
{
private:
const byte RT_VoiceCommand = 0x01;
const byte RT_DateCommand = 0x02;
const byte RT_TimeCommand = 0x03;
const byte RT_WeatherTempCommand = 0x04;
public:
enum class VoiceCmd
{
Fu_Qiang_Lu_Zhan = 0x00, //富强路站
Min_Zhu_Lu_Zhan = 0x01, //民主路站
Wen_Ming_Lu_Zhan = 0x02, //文明路站
He_Xie_Lu_Zhan = 0x03, //和谐路站
Ai_Guo_Lu_Zhan = 0x04, //爱国路站
Jing_Ye_Lu_Zhan = 0x05, //敬业路站
You_Shan_Lu_Zhan = 0x06 //友善路站
};
enum class WeatherCmd
{
Wind = 0x00, //大风
Cloudy = 0x01, //多云
Sunny = 0x02, //晴
Snow = 0x03, //小雪
Rain = 0x04, //小雨
Overcast = 0x05 //阴天
};
enum class TextEncoding
{
GB2312 = 0x00,
GBK = 0x01,
BIG5 = 0x02,
Unicode = 0x03
};
public:
VoiceReportCommand();
public:
byte* CMD_ReportSpecVoice(VoiceCmd type);
byte* CMD_ReportRandomVoice();
byte* CMD_SetRTCStartDate(uint16_t year, byte month, byte day);
byte* CMD_ReadRTCDate();
byte* CMD_SetRTCStartTime(byte hour, byte minute, byte second);
byte* CMD_ReadRTCTime();
byte* CMD_SetWeatherAndTemperature(WeatherCmd weather, byte temp);
byte* CMD_QueryWeatherAndTemperator();
public:
bool IsVoiceCommand(byte* cmd);
bool IsVoiceAvailable(byte* cmd);
bool ReadRTCDate(byte* cmd, uint16_t& year, byte& month, byte& day);
bool ReadRTCTime(byte* cmd, byte& hour, byte& minute, byte& second);
bool ReadWeatherAndTemperature(byte* cmd, WeatherCmd& weather, byte& temp);
};
#endif