|
@@ -261,16 +261,17 @@ int main(int argc, char *argv[])
|
|
|
|
|
|
|
|
sendBroadcastFromQt("sleep");
|
|
sendBroadcastFromQt("sleep");
|
|
|
//启动铃声
|
|
//启动铃声
|
|
|
|
|
+ if(0)
|
|
|
{
|
|
{
|
|
|
- QMediaPlayer* m_ediaPlayer;
|
|
|
|
|
- QAudioOutput* m_audioOutput;
|
|
|
|
|
- m_ediaPlayer = new QMediaPlayer;
|
|
|
|
|
- m_audioOutput = new QAudioOutput;
|
|
|
|
|
- m_ediaPlayer->setAudioOutput(m_audioOutput);
|
|
|
|
|
- QUrl url = QUrl::fromLocalFile("assets:/assets/mp3/pwron.mp3");
|
|
|
|
|
- m_ediaPlayer->setSource(url.toLocalFile());
|
|
|
|
|
- m_audioOutput->setVolume(100);
|
|
|
|
|
- m_ediaPlayer->play();
|
|
|
|
|
|
|
+ QMediaPlayer* m_ediaPlayer;
|
|
|
|
|
+ QAudioOutput* m_audioOutput;
|
|
|
|
|
+ m_ediaPlayer = new QMediaPlayer;
|
|
|
|
|
+ m_audioOutput = new QAudioOutput;
|
|
|
|
|
+ m_ediaPlayer->setAudioOutput(m_audioOutput);
|
|
|
|
|
+ QUrl url = QUrl::fromLocalFile("assets:/assets/mp3/pwron.mp3");
|
|
|
|
|
+ m_ediaPlayer->setSource(url.toLocalFile());
|
|
|
|
|
+ m_audioOutput->setVolume(100);
|
|
|
|
|
+ m_ediaPlayer->play();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
QGuiApplication app(argc, argv);
|
|
QGuiApplication app(argc, argv);
|
|
@@ -314,21 +315,24 @@ int main(int argc, char *argv[])
|
|
|
if(!sqlConfig->isTableExist(param::table_mqtt)){
|
|
if(!sqlConfig->isTableExist(param::table_mqtt)){
|
|
|
sqlConfig->CreateTable(param::table_mqtt);
|
|
sqlConfig->CreateTable(param::table_mqtt);
|
|
|
//插入数据
|
|
//插入数据
|
|
|
- config_class.mqtt_db = {1,"bzy","8.136.98.49",61883,"yfkj6021","user","f335bf402c655ee5fd2b5300905124e","",0,60,"/yfkj/bzyH/s2c/","/yfkj/bzyH/c2s/","/yfkj/bzyH/offline/",10};
|
|
|
|
|
- config_class.mqtt_db.imei = param::imei;
|
|
|
|
|
|
|
+ config_class.mqtt_db = {1,"bzy","8.136.98.49",61883,"","user","f335bf402c655ee5fd2b5300905124e","",0,60,"/yfkj/bzyH/s2c/","/yfkj/bzyH/c2s/","/yfkj/bzyH/offline/",10};
|
|
|
sqlConfig->InsertData(config_class,param::table_mqtt);
|
|
sqlConfig->InsertData(config_class,param::table_mqtt);
|
|
|
//查询全部数据
|
|
//查询全部数据
|
|
|
sqlConfig->QueryAllData(param::table_mqtt);
|
|
sqlConfig->QueryAllData(param::table_mqtt);
|
|
|
}else{
|
|
}else{
|
|
|
sqlConfig->QueryAllData(param::table_mqtt);
|
|
sqlConfig->QueryAllData(param::table_mqtt);
|
|
|
- if(param::imei.isEmpty()){
|
|
|
|
|
- sendBroadcastFromQt("imei");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ if(param::imei.isEmpty()){
|
|
|
|
|
+ sendBroadcastFromQt("imei");
|
|
|
|
|
+ QTimer::singleShot(1000, [&]() {
|
|
|
|
|
+ sqlConfig->UpdateData(param::table_mqtt,"imei",param::imei);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
if(!sqlConfig->isTableExist(param::table_mqtt_other))
|
|
if(!sqlConfig->isTableExist(param::table_mqtt_other))
|
|
|
{
|
|
{
|
|
|
sqlConfig->CreateTable(param::table_mqtt_other);
|
|
sqlConfig->CreateTable(param::table_mqtt_other);
|
|
|
- config_class.mqtt_db = {1,"bzy","0.0.0.0",1883,"yfkj6021","uid","pwd","clientid",0,60,"/yfkj/bzy/s2c/","/yfkj/bzy/c2s/","/yfkj/bzy/offline/",10};
|
|
|
|
|
|
|
+ config_class.mqtt_db = {1,"bzy","0.0.0.0",1883,"","uid","pwd","clientid",0,60,"/yfkj/bzy/s2c/","/yfkj/bzy/c2s/","/yfkj/bzy/offline/",10};
|
|
|
sqlConfig->InsertData(config_class,param::table_mqtt_other);
|
|
sqlConfig->InsertData(config_class,param::table_mqtt_other);
|
|
|
//查询全部数据
|
|
//查询全部数据
|
|
|
sqlConfig->QueryAllData(param::table_mqtt_other);
|
|
sqlConfig->QueryAllData(param::table_mqtt_other);
|