Aperi Source】 DWIN Screen et Android Phone Duo-modo Linkage Imperium Musica Playback

-From DWIN Developer Forum

Hic exitus tibi est ut causam conciliandae open-fontis repellas forum elit DWIN - DWIN screen et Android telephonum duo-modo nexus control musicae playback. Machinatores per modulum Bluetooth ad DWIN screen intelligentium et Android telephonicum commercium consequendum, utentes facile moderari telephonum Android, USB mico coegi in cantu fabulae, morae, cantus et occasus soni mutant, intelligentes screen et Android telephonum duo- modo opportunum imperium.

1.C51 Design
(1) T5L Vide portum interacts cum modulo Bluetooth ad statum playback modificare, pone volumen, et lege statum Bluetooth, pars relationis codice talis est:
int principalis (inanis)
{
INIT_CPU();
T2_Heat();
UART4_Init();
EA=1;
//UART4_SendStr("salve", sizeof("salve");
//WDT_ON();//Converte in Watchdog.
dum (I)
{
//WDT_RST();// Pedes canis
Process();
}
}
inanis UART4_Init (inanis)
{
// UART4 Baud rate setting;
//BODE2_DIV_H=CPU Mains frequency/(8*Baud rate) .
//206438400/8/115200=224=0xe0
//206438400/8/921600=28=0x1C
//206438400/8=25804800/230400=112=0×70
SCON2T=0×80;
SCON2R=0×80;
BODE2_DIV_H=0×00;//FCLK/(8*DV) 
BODE2_DIV_L=0xe0;// 921600 Baud rate
//BODE2_DIV_H=0×00;
//FCLK/(8*DIV))
//BODE2_DIV_L=0×70;
//ES3T=1;
ES2R=1;
EA=1;
}
inanis TenMsHandle (inanis)
{
si (! TenmsFlag)
remittere;
TenmsFlag=0;
SourcePress();//Tone generans
PlayCtrPress (); // Playback status mutatio
VolCtrSlider();// Volume mutatio
VolLogSlider();// Volume mutatio
ReadBtState (); // Read Bluetooth status
}
inanis SourcePress (inanis)
{
charTouchKey[2]={0,0};
u8Sdata[2];
read_dgusii_vp(0×3000,TouchKey,1);
if(TouchKey[1]==0)
remittere;
Sdata[1]=0;
switch(TouchKey[1])
{
case1/U orbis
Sdata[0]=1;
SendDataToBT(Write_Run_Mode,Sdata,1);
frangere;
case2: // Externi LineIn Input
Sdata[0]=2;
SendDataToBT(Write_Run_Mode,Sdata,1);
frangere;
case3://Bluetooth
Sdata[0]=3;
SendDataToBT(Write_Run_Mode,Sdata,1);
frangere;
}
write_dgusii_vp(0×3003,TouchKey,1);
memset(TouchKey,0,sizeof(TouchKey));
write_dgusii_vp(0×3000,TouchKey,1);
ReadBtStatecount=0;
}
inanis PlayCtrPress (inanis)
{
charTouchKey[2]={0,0};
u8Sdata[2];
read_dgusii_vp(0×3001,TouchKey,1);
if(TouchKey[1]==0)
remittere;
Sdata[1]=0;
switch(TouchKey[1])
{
case1/ Previous song
Sdata[0]=1;
SendDataToBT(Write_Next_Pre_PT,Sdata,1);
frangere;
case2: Playback Pause
Sdata[0]=2;
SendDataToBT(Write_Next_Pre_PT,Sdata,1);
frangere;
case3/ Next song
Sdata[0]=3;
SendDataToBT(Write_Next_Pre_PT,Sdata,1);
frangere;
}
memset(TouchKey,0,sizeof(TouchKey));
write_dgusii_vp(0×3001,TouchKey,1);
ReadBtStatecount=0;
}

(2) Involucrum programmatum MASCULINUS per QT scriptum est, maxime intellegens Bluetooth nexum et communicationis imperium cum screen captioso, pars relationis codice talis est:
ui->setupUi(this);
bluetooth_ble_Tool=new Bluetooth_ble_Tool("dwin_bt(BLE)");
ui->label_localBT_Name->setText(bluetooth_ble_Tool->getLocalName());
connect(bluetooth_ble_Tool,&Bluetooth_ble_Tool :: BlueSearchConnectState,
hoc,&BLE_PairPage::BlueSearchConnectState);
//btchat=new BtChat();
//btchat->set_ble_Tool(bluetooth_ble_Tool);
//btchat->init_Page();
//btchat->hide();
devicecommHandle=new DeviceComm();
devicecommHandle->set_ble_Tool(bluetooth_ble_Tool);
devicecommHandle->InitDevice();
mwin=new mainwin();
less-> hide();
connect(mwin,& mainwin: layChangeMode,
devicecommHandle, & DeviceComm: layChangeMode); // Write modus mutatio edita
connect(mwin,& mainwin:layCtrPreNextSt,
devicecommHandle,&DeviceComm:layCtrPreNextSt);// lit. scribere superiora et inferiora carminis
connect(mwin,& mainwin: layMusicVolChange,
devicecommHandle,&DeviceComm:layMusicVolChange);// Write volumen mutationem down
connect (devicecommHandle, & DeviceComm :: ReadPlayMode,
hoc,[=](int modus){// Ponendi modus current
qDebug() qDebug() B_Upan->setChecked(falsus);
mwin->B_AUX->setChecked(false);
mwin->B_BT->setChecked(falsus);
si (modus ==)
mwin-> B_Upan-> setChecked (verum);
si aliud (modus == II)
mwin->B_AUX->setChecked(verum);
alium, si (== modus III)
mwin->B_BT->setChecked(verum);
});
connect(devicecommHandle,&DeviceComm :: ReadPlayMusicVol,
hoc,[=](int vol){// Ponens Volumen Propono
mwin->QS_MainVol->setValue(vol);
});
connect(bluetooth_ble_Tool,&Bluetooth_ble_Tool :: BLE_Link_error,
hoc[=](){
this->show();
less-> hide();
devicecommHandle->TimerStopReadDeviceST();
this->ui->progressBar->setValue(0);
});
inanis BLE_PairPage :: on_pushButton_clicked (){
bluetooth_ble_Tool->SetOperUuidServer(QBluetoothUuid(serviceUuid));
//ui->label_localBT->clear();
//ui->label_localBT_Name->setText(bluetooth_ble_Tool->getLocalName());
bluetooth_ble_Tool->startFindConnectBle();
//bluetooth_ble_Tool->startStateprogressBar();
ui->pushButton->setEnabled(false);
ui->pushButton->setText("Exquisitione");
connect (bluetooth_ble_Tool, & Bluetooth_ble_Tool :: BlueBLE_FindDevicefinished,
hoc [=](bool ok){
ui-> pushButton->setEnabled( true);
ui - pushButton->setText("Start detecting connected Bluetooth");
si (ok == falsum) {
QMessageBox :: informationes (hoc, tr ("Status Inquisitionis"), "Fabulam indagari non potest, quaeso reprehendo si machinam iam invertitur, vel si alius telephonicus telephonicus cum eo conexus est?");} }); }
vacui BLE_PairPage ::BlueSearchConnectState(Bluetooth_ble_Tool :: startStateprogressBar_em Linkst, int progress){
ui->progressBar->setValue(progress);
sin(Linkst> = Bluetooth_ble_Tool ::Ble_OtherError){
QMessageBox :: information(hoc, tr ("connexionem promptum"), bluetooth_ble_Tool->getErrorinfo());
ui->label_tips->setText(bluetooth_ble_Tool->getErrorinfo());}
aliud si (Linkst> Bluetooth_ble_Tool :: Ble_Deconnect_device) {
QMessageBox :: information(hoc, tr("connexionem promptam"), "buggy");
ui->label_tips->setText("buggy");}
aliud si(Linkst==Bluetooth_ble_Tool ::Ble_Connect_characterOk){// QMessageBox :: information(
hoc, tr ("feliciter connexum), bluetooth_ble_Tool->getErrorinfo());
ui->label_tips->setText("feliciter connexus);
this->hide();
mwin->show();
devicecommHandle->TimerStartReadDeviceST(100);
//btchat->show();
// disconnect(bluetooth_ble_Tool,&Bluetooth_ble_Tool ::BlueSearchConnectState,
//hoc,&BLE_PairPage::BlueSearchConnectState); }
aliud{
ui->label_tips->setText("Quaerentes hospites); }


Post tempus: May-23-2024