mirror of
https://github.com/CTCaer/jc_toolkit
synced 2026-11-26 09:08:07 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf23460442 | ||
|
|
03288fd6e3 | ||
|
|
dee3c6557f |
No files matched your search
+192
-79
@@ -80,8 +80,8 @@ namespace CppWinFormJoy {
|
||||
this->textBoxDbg_subcmd->Validating += gcnew CancelEventHandler(this, &FormJoy::textBoxDbg_subcmd_Validating);
|
||||
this->textBoxDbg_subcmd->Validated += gcnew EventHandler(this, &FormJoy::textBoxDbg_subcmd_Validated);
|
||||
|
||||
this->textBoxDbg_SubcmdArg->Validating += gcnew CancelEventHandler(this, &FormJoy::textBoxDbg_Validating);
|
||||
this->textBoxDbg_SubcmdArg->Validated += gcnew EventHandler(this, &FormJoy::textBoxDbg_Validated);
|
||||
this->textBoxDbg_SubcmdArg->Validating += gcnew CancelEventHandler(this, &FormJoy::textBoxDbg_SubcmdArg_Validating);
|
||||
this->textBoxDbg_SubcmdArg->Validated += gcnew EventHandler(this, &FormJoy::textBoxDbg_SubcmdArg_Validated);
|
||||
|
||||
this->textBoxDbg_lfamp->Validating += gcnew CancelEventHandler(this, &FormJoy::textBoxDbg_Validating);
|
||||
this->textBoxDbg_lfamp->Validated += gcnew EventHandler(this, &FormJoy::textBoxDbg_Validated);
|
||||
@@ -100,6 +100,13 @@ namespace CppWinFormJoy {
|
||||
|
||||
this->toolTip1->SetToolTip(this->label_sn, "Click here to change your S/N");
|
||||
|
||||
//Initialise locations on start for easy designing
|
||||
this->menuStrip1->Size = System::Drawing::Size(485, 24);
|
||||
this->groupRst->Location = System::Drawing::Point(494, 36);
|
||||
this->groupBox_chg_sn->Location = System::Drawing::Point(494, 36);
|
||||
this->ClientSize = System::Drawing::Size(485, 449);
|
||||
|
||||
//Done drawing!
|
||||
send_rumble(handle);
|
||||
}
|
||||
|
||||
@@ -180,6 +187,7 @@ namespace CppWinFormJoy {
|
||||
private: System::Windows::Forms::Label^ label13;
|
||||
private: System::Windows::Forms::Label^ label_sn_change_warning;
|
||||
private: System::Windows::Forms::ToolTip^ toolTip1;
|
||||
public: System::Windows::Forms::TextBox^ textBoxDbg_sent;
|
||||
public: System::Windows::Forms::TextBox^ textBoxDbg_reply;
|
||||
private: System::ComponentModel::IContainer^ components;
|
||||
|
||||
@@ -235,6 +243,7 @@ namespace CppWinFormJoy {
|
||||
this->label4 = (gcnew System::Windows::Forms::Label());
|
||||
this->groupDbg = (gcnew System::Windows::Forms::GroupBox());
|
||||
this->textBoxDbg_reply = (gcnew System::Windows::Forms::TextBox());
|
||||
this->textBoxDbg_sent = (gcnew System::Windows::Forms::TextBox());
|
||||
this->label12 = (gcnew System::Windows::Forms::Label());
|
||||
this->label11 = (gcnew System::Windows::Forms::Label());
|
||||
this->label10 = (gcnew System::Windows::Forms::Label());
|
||||
@@ -630,7 +639,7 @@ namespace CppWinFormJoy {
|
||||
this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) { this->menuToolStripMenuItem });
|
||||
this->menuStrip1->Location = System::Drawing::Point(0, 0);
|
||||
this->menuStrip1->Name = L"menuStrip1";
|
||||
this->menuStrip1->Size = System::Drawing::Size(485, 24);
|
||||
this->menuStrip1->Size = System::Drawing::Size(1217, 24);
|
||||
this->menuStrip1->TabIndex = 0;
|
||||
this->menuStrip1->Text = L"menuStrip1";
|
||||
//
|
||||
@@ -678,11 +687,11 @@ namespace CppWinFormJoy {
|
||||
this->label1->AutoSize = true;
|
||||
this->label1->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(251)), static_cast<System::Int32>(static_cast<System::Byte>(251)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(251)));
|
||||
this->label1->Location = System::Drawing::Point(13, 178);
|
||||
this->label1->Location = System::Drawing::Point(13, 129);
|
||||
this->label1->Name = L"label1";
|
||||
this->label1->Size = System::Drawing::Size(119, 17);
|
||||
this->label1->Size = System::Drawing::Size(124, 17);
|
||||
this->label1->TabIndex = 15;
|
||||
this->label1->Text = L"Subcmd Argument:";
|
||||
this->label1->Text = L"Subcmd arguments:";
|
||||
//
|
||||
// textBoxDbg_SubcmdArg
|
||||
//
|
||||
@@ -690,12 +699,14 @@ namespace CppWinFormJoy {
|
||||
this->textBoxDbg_SubcmdArg->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(85)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(85)), static_cast<System::Int32>(static_cast<System::Byte>(85)));
|
||||
this->textBoxDbg_SubcmdArg->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
|
||||
this->textBoxDbg_SubcmdArg->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(250)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(250)), static_cast<System::Int32>(static_cast<System::Byte>(250)));
|
||||
this->textBoxDbg_SubcmdArg->Location = System::Drawing::Point(169, 170);
|
||||
this->textBoxDbg_SubcmdArg->MaxLength = 2;
|
||||
this->textBoxDbg_SubcmdArg->CharacterCasing = System::Windows::Forms::CharacterCasing::Upper;
|
||||
this->textBoxDbg_SubcmdArg->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(255)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(188)), static_cast<System::Int32>(static_cast<System::Byte>(0)));
|
||||
this->textBoxDbg_SubcmdArg->Location = System::Drawing::Point(16, 149);
|
||||
this->textBoxDbg_SubcmdArg->MaxLength = 50;
|
||||
this->textBoxDbg_SubcmdArg->Multiline = true;
|
||||
this->textBoxDbg_SubcmdArg->Name = L"textBoxDbg_SubcmdArg";
|
||||
this->textBoxDbg_SubcmdArg->Size = System::Drawing::Size(35, 25);
|
||||
this->textBoxDbg_SubcmdArg->Size = System::Drawing::Size(188, 40);
|
||||
this->textBoxDbg_SubcmdArg->TabIndex = 25;
|
||||
this->textBoxDbg_SubcmdArg->Text = L"00";
|
||||
this->textBoxDbg_SubcmdArg->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
|
||||
@@ -710,7 +721,7 @@ namespace CppWinFormJoy {
|
||||
this->btnDbg_send_cmd->Font = (gcnew System::Drawing::Font(L"Segoe UI Semibold", 10));
|
||||
this->btnDbg_send_cmd->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(255)), static_cast<System::Int32>(static_cast<System::Byte>(188)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(0)));
|
||||
this->btnDbg_send_cmd->Location = System::Drawing::Point(73, 207);
|
||||
this->btnDbg_send_cmd->Location = System::Drawing::Point(73, 202);
|
||||
this->btnDbg_send_cmd->Name = L"btnDbg_send_cmd";
|
||||
this->btnDbg_send_cmd->Size = System::Drawing::Size(75, 34);
|
||||
this->btnDbg_send_cmd->TabIndex = 17;
|
||||
@@ -723,31 +734,31 @@ namespace CppWinFormJoy {
|
||||
this->label2->AutoSize = true;
|
||||
this->label2->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(251)), static_cast<System::Int32>(static_cast<System::Byte>(251)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(251)));
|
||||
this->label2->Location = System::Drawing::Point(13, 23);
|
||||
this->label2->Location = System::Drawing::Point(13, 98);
|
||||
this->label2->Name = L"label2";
|
||||
this->label2->Size = System::Drawing::Size(71, 17);
|
||||
this->label2->Size = System::Drawing::Size(38, 17);
|
||||
this->label2->TabIndex = 18;
|
||||
this->label2->Text = L"Command:";
|
||||
this->label2->Text = L"Cmd:";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this->label3->AutoSize = true;
|
||||
this->label3->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(251)), static_cast<System::Int32>(static_cast<System::Byte>(251)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(251)));
|
||||
this->label3->Location = System::Drawing::Point(13, 138);
|
||||
this->label3->Location = System::Drawing::Point(106, 98);
|
||||
this->label3->Name = L"label3";
|
||||
this->label3->Size = System::Drawing::Size(91, 17);
|
||||
this->label3->Size = System::Drawing::Size(58, 17);
|
||||
this->label3->TabIndex = 19;
|
||||
this->label3->Text = L"Subcommand:";
|
||||
this->label3->Text = L"Subcmd:";
|
||||
//
|
||||
// textBoxDbg_cmd
|
||||
//
|
||||
this->textBoxDbg_cmd->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(85)), static_cast<System::Int32>(static_cast<System::Byte>(85)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(85)));
|
||||
this->textBoxDbg_cmd->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
|
||||
this->textBoxDbg_cmd->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(250)), static_cast<System::Int32>(static_cast<System::Byte>(250)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(250)));
|
||||
this->textBoxDbg_cmd->Location = System::Drawing::Point(169, 21);
|
||||
this->textBoxDbg_cmd->CharacterCasing = System::Windows::Forms::CharacterCasing::Upper;
|
||||
this->textBoxDbg_cmd->ForeColor = System::Drawing::Color::White;
|
||||
this->textBoxDbg_cmd->Location = System::Drawing::Point(64, 96);
|
||||
this->textBoxDbg_cmd->MaxLength = 2;
|
||||
this->textBoxDbg_cmd->Name = L"textBoxDbg_cmd";
|
||||
this->textBoxDbg_cmd->Size = System::Drawing::Size(35, 25);
|
||||
@@ -761,9 +772,10 @@ namespace CppWinFormJoy {
|
||||
this->textBoxDbg_subcmd->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(85)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(85)), static_cast<System::Int32>(static_cast<System::Byte>(85)));
|
||||
this->textBoxDbg_subcmd->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
|
||||
this->textBoxDbg_subcmd->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(250)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(250)), static_cast<System::Int32>(static_cast<System::Byte>(250)));
|
||||
this->textBoxDbg_subcmd->Location = System::Drawing::Point(169, 136);
|
||||
this->textBoxDbg_subcmd->CharacterCasing = System::Windows::Forms::CharacterCasing::Upper;
|
||||
this->textBoxDbg_subcmd->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(9)), static_cast<System::Int32>(static_cast<System::Byte>(255)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(206)));
|
||||
this->textBoxDbg_subcmd->Location = System::Drawing::Point(169, 96);
|
||||
this->textBoxDbg_subcmd->MaxLength = 2;
|
||||
this->textBoxDbg_subcmd->Name = L"textBoxDbg_subcmd";
|
||||
this->textBoxDbg_subcmd->Size = System::Drawing::Size(35, 25);
|
||||
@@ -785,6 +797,7 @@ namespace CppWinFormJoy {
|
||||
// groupDbg
|
||||
//
|
||||
this->groupDbg->Controls->Add(this->textBoxDbg_reply);
|
||||
this->groupDbg->Controls->Add(this->textBoxDbg_sent);
|
||||
this->groupDbg->Controls->Add(this->label12);
|
||||
this->groupDbg->Controls->Add(this->label11);
|
||||
this->groupDbg->Controls->Add(this->label10);
|
||||
@@ -816,22 +829,44 @@ namespace CppWinFormJoy {
|
||||
//
|
||||
this->textBoxDbg_reply->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(70)), static_cast<System::Int32>(static_cast<System::Byte>(70)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(70)));
|
||||
this->textBoxDbg_reply->BorderStyle = System::Windows::Forms::BorderStyle::None;
|
||||
this->textBoxDbg_reply->Font = (gcnew System::Drawing::Font(L"Lucida Console", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
|
||||
static_cast<System::Byte>(161)));
|
||||
this->textBoxDbg_reply->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(255)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(188)), static_cast<System::Int32>(static_cast<System::Byte>(0)));
|
||||
this->textBoxDbg_reply->Location = System::Drawing::Point(16, 247);
|
||||
this->textBoxDbg_reply->Location = System::Drawing::Point(12, 320);
|
||||
this->textBoxDbg_reply->Multiline = true;
|
||||
this->textBoxDbg_reply->Name = L"textBoxDbg_reply";
|
||||
this->textBoxDbg_reply->ReadOnly = true;
|
||||
this->textBoxDbg_reply->Size = System::Drawing::Size(188, 138);
|
||||
this->textBoxDbg_reply->TabIndex = 32;
|
||||
this->textBoxDbg_reply->Size = System::Drawing::Size(196, 69);
|
||||
this->textBoxDbg_reply->TabIndex = 33;
|
||||
this->textBoxDbg_reply->Text = L"Reply text";
|
||||
this->textBoxDbg_reply->Visible = false;
|
||||
//
|
||||
// textBoxDbg_sent
|
||||
//
|
||||
this->textBoxDbg_sent->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(70)), static_cast<System::Int32>(static_cast<System::Byte>(70)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(70)));
|
||||
this->textBoxDbg_sent->BorderStyle = System::Windows::Forms::BorderStyle::None;
|
||||
this->textBoxDbg_sent->Font = (gcnew System::Drawing::Font(L"Lucida Console", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
|
||||
static_cast<System::Byte>(161)));
|
||||
this->textBoxDbg_sent->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(255)), static_cast<System::Int32>(static_cast<System::Byte>(188)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(0)));
|
||||
this->textBoxDbg_sent->Location = System::Drawing::Point(12, 247);
|
||||
this->textBoxDbg_sent->Multiline = true;
|
||||
this->textBoxDbg_sent->Name = L"textBoxDbg_sent";
|
||||
this->textBoxDbg_sent->ReadOnly = true;
|
||||
this->textBoxDbg_sent->Size = System::Drawing::Size(196, 62);
|
||||
this->textBoxDbg_sent->TabIndex = 32;
|
||||
this->textBoxDbg_sent->Text = L"Sent text";
|
||||
this->textBoxDbg_sent->Visible = false;
|
||||
//
|
||||
// label12
|
||||
//
|
||||
this->label12->AutoSize = true;
|
||||
this->label12->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(200)), static_cast<System::Int32>(static_cast<System::Byte>(200)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(200)));
|
||||
this->label12->Location = System::Drawing::Point(114, 104);
|
||||
this->label12->Location = System::Drawing::Point(114, 66);
|
||||
this->label12->Name = L"label12";
|
||||
this->label12->Size = System::Drawing::Size(47, 17);
|
||||
this->label12->TabIndex = 31;
|
||||
@@ -842,7 +877,7 @@ namespace CppWinFormJoy {
|
||||
this->label11->AutoSize = true;
|
||||
this->label11->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(200)), static_cast<System::Int32>(static_cast<System::Byte>(200)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(200)));
|
||||
this->label11->Location = System::Drawing::Point(114, 74);
|
||||
this->label11->Location = System::Drawing::Point(114, 42);
|
||||
this->label11->Name = L"label11";
|
||||
this->label11->Size = System::Drawing::Size(50, 17);
|
||||
this->label11->TabIndex = 30;
|
||||
@@ -853,7 +888,7 @@ namespace CppWinFormJoy {
|
||||
this->label10->AutoSize = true;
|
||||
this->label10->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(200)), static_cast<System::Int32>(static_cast<System::Byte>(200)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(200)));
|
||||
this->label10->Location = System::Drawing::Point(13, 104);
|
||||
this->label10->Location = System::Drawing::Point(13, 66);
|
||||
this->label10->Name = L"label10";
|
||||
this->label10->Size = System::Drawing::Size(46, 17);
|
||||
this->label10->TabIndex = 29;
|
||||
@@ -864,7 +899,7 @@ namespace CppWinFormJoy {
|
||||
this->label9->AutoSize = true;
|
||||
this->label9->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(200)), static_cast<System::Int32>(static_cast<System::Byte>(200)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(200)));
|
||||
this->label9->Location = System::Drawing::Point(13, 74);
|
||||
this->label9->Location = System::Drawing::Point(13, 42);
|
||||
this->label9->Name = L"label9";
|
||||
this->label9->Size = System::Drawing::Size(49, 17);
|
||||
this->label9->TabIndex = 28;
|
||||
@@ -874,13 +909,14 @@ namespace CppWinFormJoy {
|
||||
//
|
||||
this->textBoxDbg_lfamp->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(85)), static_cast<System::Int32>(static_cast<System::Byte>(85)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(85)));
|
||||
this->textBoxDbg_lfamp->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
|
||||
this->textBoxDbg_lfamp->BorderStyle = System::Windows::Forms::BorderStyle::None;
|
||||
this->textBoxDbg_lfamp->CharacterCasing = System::Windows::Forms::CharacterCasing::Upper;
|
||||
this->textBoxDbg_lfamp->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(250)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(250)), static_cast<System::Int32>(static_cast<System::Byte>(250)));
|
||||
this->textBoxDbg_lfamp->Location = System::Drawing::Point(169, 102);
|
||||
this->textBoxDbg_lfamp->Location = System::Drawing::Point(169, 66);
|
||||
this->textBoxDbg_lfamp->MaxLength = 2;
|
||||
this->textBoxDbg_lfamp->Name = L"textBoxDbg_lfamp";
|
||||
this->textBoxDbg_lfamp->Size = System::Drawing::Size(35, 25);
|
||||
this->textBoxDbg_lfamp->Size = System::Drawing::Size(35, 18);
|
||||
this->textBoxDbg_lfamp->TabIndex = 23;
|
||||
this->textBoxDbg_lfamp->Text = L"40";
|
||||
this->textBoxDbg_lfamp->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
|
||||
@@ -889,13 +925,14 @@ namespace CppWinFormJoy {
|
||||
//
|
||||
this->textBoxDbg_lfreq->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(85)), static_cast<System::Int32>(static_cast<System::Byte>(85)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(85)));
|
||||
this->textBoxDbg_lfreq->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
|
||||
this->textBoxDbg_lfreq->BorderStyle = System::Windows::Forms::BorderStyle::None;
|
||||
this->textBoxDbg_lfreq->CharacterCasing = System::Windows::Forms::CharacterCasing::Upper;
|
||||
this->textBoxDbg_lfreq->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(250)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(250)), static_cast<System::Int32>(static_cast<System::Byte>(250)));
|
||||
this->textBoxDbg_lfreq->Location = System::Drawing::Point(64, 102);
|
||||
this->textBoxDbg_lfreq->Location = System::Drawing::Point(64, 66);
|
||||
this->textBoxDbg_lfreq->MaxLength = 2;
|
||||
this->textBoxDbg_lfreq->Name = L"textBoxDbg_lfreq";
|
||||
this->textBoxDbg_lfreq->Size = System::Drawing::Size(35, 25);
|
||||
this->textBoxDbg_lfreq->Size = System::Drawing::Size(35, 18);
|
||||
this->textBoxDbg_lfreq->TabIndex = 22;
|
||||
this->textBoxDbg_lfreq->Text = L"40";
|
||||
this->textBoxDbg_lfreq->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
|
||||
@@ -904,13 +941,14 @@ namespace CppWinFormJoy {
|
||||
//
|
||||
this->textBoxDbg_hamp->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(85)), static_cast<System::Int32>(static_cast<System::Byte>(85)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(85)));
|
||||
this->textBoxDbg_hamp->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
|
||||
this->textBoxDbg_hamp->BorderStyle = System::Windows::Forms::BorderStyle::None;
|
||||
this->textBoxDbg_hamp->CharacterCasing = System::Windows::Forms::CharacterCasing::Upper;
|
||||
this->textBoxDbg_hamp->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(250)), static_cast<System::Int32>(static_cast<System::Byte>(250)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(250)));
|
||||
this->textBoxDbg_hamp->Location = System::Drawing::Point(169, 72);
|
||||
this->textBoxDbg_hamp->Location = System::Drawing::Point(169, 42);
|
||||
this->textBoxDbg_hamp->MaxLength = 2;
|
||||
this->textBoxDbg_hamp->Name = L"textBoxDbg_hamp";
|
||||
this->textBoxDbg_hamp->Size = System::Drawing::Size(35, 25);
|
||||
this->textBoxDbg_hamp->Size = System::Drawing::Size(35, 18);
|
||||
this->textBoxDbg_hamp->TabIndex = 21;
|
||||
this->textBoxDbg_hamp->Text = L"01";
|
||||
this->textBoxDbg_hamp->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
|
||||
@@ -919,13 +957,14 @@ namespace CppWinFormJoy {
|
||||
//
|
||||
this->textBoxDbg_hfreq->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(85)), static_cast<System::Int32>(static_cast<System::Byte>(85)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(85)));
|
||||
this->textBoxDbg_hfreq->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
|
||||
this->textBoxDbg_hfreq->BorderStyle = System::Windows::Forms::BorderStyle::None;
|
||||
this->textBoxDbg_hfreq->CharacterCasing = System::Windows::Forms::CharacterCasing::Upper;
|
||||
this->textBoxDbg_hfreq->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(250)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(250)), static_cast<System::Int32>(static_cast<System::Byte>(250)));
|
||||
this->textBoxDbg_hfreq->Location = System::Drawing::Point(64, 72);
|
||||
this->textBoxDbg_hfreq->Location = System::Drawing::Point(64, 42);
|
||||
this->textBoxDbg_hfreq->MaxLength = 2;
|
||||
this->textBoxDbg_hfreq->Name = L"textBoxDbg_hfreq";
|
||||
this->textBoxDbg_hfreq->Size = System::Drawing::Size(35, 25);
|
||||
this->textBoxDbg_hfreq->Size = System::Drawing::Size(35, 18);
|
||||
this->textBoxDbg_hfreq->TabIndex = 20;
|
||||
this->textBoxDbg_hfreq->Text = L"00";
|
||||
this->textBoxDbg_hfreq->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
|
||||
@@ -935,7 +974,7 @@ namespace CppWinFormJoy {
|
||||
this->label8->AutoSize = true;
|
||||
this->label8->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(251)), static_cast<System::Int32>(static_cast<System::Byte>(251)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(251)));
|
||||
this->label8->Location = System::Drawing::Point(13, 51);
|
||||
this->label8->Location = System::Drawing::Point(13, 21);
|
||||
this->label8->Name = L"label8";
|
||||
this->label8->Size = System::Drawing::Size(64, 17);
|
||||
this->label8->TabIndex = 23;
|
||||
@@ -952,7 +991,7 @@ namespace CppWinFormJoy {
|
||||
this->groupRst->Controls->Add(this->btnLoadBackup);
|
||||
this->groupRst->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(9)), static_cast<System::Int32>(static_cast<System::Byte>(255)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(206)));
|
||||
this->groupRst->Location = System::Drawing::Point(494, 36);
|
||||
this->groupRst->Location = System::Drawing::Point(736, 38);
|
||||
this->groupRst->Name = L"groupRst";
|
||||
this->groupRst->Size = System::Drawing::Size(220, 399);
|
||||
this->groupRst->TabIndex = 24;
|
||||
@@ -1119,7 +1158,7 @@ namespace CppWinFormJoy {
|
||||
this->groupBox_chg_sn->Controls->Add(this->textBox_chg_sn);
|
||||
this->groupBox_chg_sn->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(9)), static_cast<System::Int32>(static_cast<System::Byte>(255)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(206)));
|
||||
this->groupBox_chg_sn->Location = System::Drawing::Point(494, 36);
|
||||
this->groupBox_chg_sn->Location = System::Drawing::Point(979, 38);
|
||||
this->groupBox_chg_sn->Name = L"groupBox_chg_sn";
|
||||
this->groupBox_chg_sn->Size = System::Drawing::Size(220, 399);
|
||||
this->groupBox_chg_sn->TabIndex = 25;
|
||||
@@ -1179,7 +1218,7 @@ namespace CppWinFormJoy {
|
||||
this->textBox_chg_sn->Name = L"textBox_chg_sn";
|
||||
this->textBox_chg_sn->Size = System::Drawing::Size(186, 25);
|
||||
this->textBox_chg_sn->TabIndex = 0;
|
||||
this->textBox_chg_sn->Text = L"WWWWWWWWWWWWWWW";
|
||||
this->textBox_chg_sn->Text = L"";
|
||||
//
|
||||
// FormJoy
|
||||
//
|
||||
@@ -1187,7 +1226,7 @@ namespace CppWinFormJoy {
|
||||
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
|
||||
this->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(70)), static_cast<System::Int32>(static_cast<System::Byte>(70)),
|
||||
static_cast<System::Int32>(static_cast<System::Byte>(70)));
|
||||
this->ClientSize = System::Drawing::Size(485, 449);
|
||||
this->ClientSize = System::Drawing::Size(1217, 449);
|
||||
this->Controls->Add(this->groupBox_chg_sn);
|
||||
this->Controls->Add(this->groupRst);
|
||||
this->Controls->Add(this->groupDbg);
|
||||
@@ -1210,9 +1249,10 @@ namespace CppWinFormJoy {
|
||||
this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon")));
|
||||
this->MainMenuStrip = this->menuStrip1;
|
||||
this->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
|
||||
this->MaximizeBox = false;
|
||||
this->Name = L"FormJoy";
|
||||
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
|
||||
this->Text = L"Joy-Con Toolkit v1.5.1";
|
||||
this->Text = L"Joy-Con Toolkit v1.5.2";
|
||||
this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &FormJoy::Form1_FormClosing);
|
||||
this->groupBoxColor->ResumeLayout(false);
|
||||
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBoxBattery))->EndInit();
|
||||
@@ -1382,7 +1422,7 @@ namespace CppWinFormJoy {
|
||||
}
|
||||
|
||||
System::IO::MemoryStream^ ms = gcnew System::IO::MemoryStream(10000000);
|
||||
ms->Write(imagebytes, 0, imagebytes->LongLength);
|
||||
ms->Write(imagebytes, 0, imagebytes->Length);
|
||||
Bitmap^ MyImage = dynamic_cast<Bitmap^>(Image::FromStream(ms));
|
||||
|
||||
float color_coeff = 0.0;
|
||||
@@ -1603,6 +1643,7 @@ namespace CppWinFormJoy {
|
||||
this->ClientSize = System::Drawing::Size(485, 449);
|
||||
this->groupRst->Visible = false;
|
||||
this->groupBox_chg_sn->Visible = false;
|
||||
this->textBoxDbg_sent->Visible = false;
|
||||
this->textBoxDbg_reply->Visible = false;
|
||||
this->groupDbg->Visible = false;
|
||||
debug_is_on = 0;
|
||||
@@ -1616,8 +1657,8 @@ namespace CppWinFormJoy {
|
||||
}
|
||||
|
||||
msclr::interop::marshal_context context;
|
||||
unsigned char test[7];
|
||||
memset(test, 0, 7);
|
||||
unsigned char test[31];
|
||||
memset(test, 0, sizeof(test));
|
||||
|
||||
std::stringstream ss_cmd;
|
||||
std::stringstream ss_hfreq;
|
||||
@@ -1625,14 +1666,14 @@ namespace CppWinFormJoy {
|
||||
std::stringstream ss_lfreq;
|
||||
std::stringstream ss_lamp;
|
||||
std::stringstream ss_subcmd;
|
||||
std::stringstream ss_subarg;
|
||||
std::stringstream ss_arguments;
|
||||
int i_cmd;
|
||||
int i_hfreq;
|
||||
int i_hamp;
|
||||
int i_lfreq;
|
||||
int i_lamp;
|
||||
int i_subcmd;
|
||||
int i_subarg;
|
||||
char i_getarg;
|
||||
|
||||
ss_cmd << std::hex << context.marshal_as<std::string>(this->textBoxDbg_cmd->Text);
|
||||
ss_hfreq << std::hex << context.marshal_as<std::string>(this->textBoxDbg_hfreq->Text);
|
||||
@@ -1640,7 +1681,6 @@ namespace CppWinFormJoy {
|
||||
ss_lfreq << std::hex << context.marshal_as<std::string>(this->textBoxDbg_lfreq->Text);
|
||||
ss_lamp << std::hex << context.marshal_as<std::string>(this->textBoxDbg_lfamp->Text);
|
||||
ss_subcmd << std::hex << context.marshal_as<std::string>(this->textBoxDbg_subcmd->Text);
|
||||
ss_subarg << std::hex << context.marshal_as<std::string>(this->textBoxDbg_SubcmdArg->Text);
|
||||
|
||||
ss_cmd >> i_cmd;
|
||||
ss_hfreq >> i_hfreq;
|
||||
@@ -1648,7 +1688,6 @@ namespace CppWinFormJoy {
|
||||
ss_lfreq >> i_lfreq;
|
||||
ss_lamp >> i_lamp;
|
||||
ss_subcmd >> i_subcmd;
|
||||
ss_subarg >> i_subarg;
|
||||
|
||||
test[0] = i_cmd;
|
||||
test[1] = i_hfreq;
|
||||
@@ -1656,9 +1695,38 @@ namespace CppWinFormJoy {
|
||||
test[3] = i_lfreq;
|
||||
test[4] = i_lamp;
|
||||
test[5] = i_subcmd;
|
||||
test[6] = i_subarg;
|
||||
|
||||
u8 get_i =0;
|
||||
ss_arguments << std::hex << context.marshal_as<std::string>(this->textBoxDbg_SubcmdArg->Text);
|
||||
|
||||
//Get Low nibble if odd number of characters
|
||||
if (ss_arguments.tellp() % 2 ){
|
||||
ss_arguments.get(i_getarg);
|
||||
if (i_getarg >= 'A' && i_getarg <= 'F')
|
||||
test[6] = (i_getarg - '7') & 0xF;
|
||||
else if (i_getarg <= '9' && i_getarg >= '0')
|
||||
test[6] = (i_getarg - '0') & 0xF;
|
||||
get_i++;
|
||||
}
|
||||
|
||||
while (ss_arguments.get(i_getarg)) {
|
||||
//Get High nibble
|
||||
if (i_getarg >= 'A' && i_getarg <= 'F')
|
||||
test[6 + get_i] = ((i_getarg - '7') << 4) & 0xF0;
|
||||
else if (i_getarg <= '9' && i_getarg > '0')
|
||||
test[6 + get_i] = ((i_getarg - '0') << 4) &0xF0;
|
||||
//Get Low nibble
|
||||
ss_arguments.get(i_getarg);
|
||||
if (i_getarg >= 'A' && i_getarg <= 'F')
|
||||
test[6 + get_i] += (i_getarg - '7') & 0xF;
|
||||
else if (i_getarg <= '9' && i_getarg >= '0')
|
||||
test[6 + get_i] += (i_getarg - '0') & 0xF;
|
||||
get_i++;
|
||||
|
||||
}
|
||||
|
||||
send_custom_command(handle, test);
|
||||
this->textBoxDbg_sent->Visible = true;
|
||||
this->textBoxDbg_reply->Visible = true;
|
||||
}
|
||||
|
||||
@@ -1667,6 +1735,7 @@ namespace CppWinFormJoy {
|
||||
this->groupDbg->Visible = false;
|
||||
this->groupRst->Visible = true;
|
||||
this->groupBox_chg_sn->Visible = false;
|
||||
this->textBoxDbg_sent->Visible = false;
|
||||
this->textBoxDbg_reply->Visible = false;
|
||||
this->ClientSize = System::Drawing::Size(738, 449);
|
||||
debug_is_on = 2;
|
||||
@@ -1681,14 +1750,15 @@ namespace CppWinFormJoy {
|
||||
}
|
||||
|
||||
private: System::Void btnLoadBackup_Click(System::Object^ sender, System::EventArgs^ e) {
|
||||
int validation_check = 1;
|
||||
int mac_check = 1;
|
||||
allow_full_restore = 1;
|
||||
bool validation_check = true;
|
||||
bool mac_check = true;
|
||||
allow_full_restore = true;
|
||||
bool ota_exists = true;
|
||||
//Bootloader, device type, FW DS1, FW DS2
|
||||
array<byte>^ validation_magic = { 0x01, 0x08, 0x00, 0xF0, 0x00, 0x00, 0x62, 0x08, 0xC0, 0x5D, 0x89, 0xFD, 0x04, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x06,
|
||||
(u8)handle_ok, 0xA0,
|
||||
0x0A, 0x4A, 0x00, 0x00, 0x02, 0x0D,
|
||||
0x0A, 0xFB, 0x00, 0x00, 0x02, 0x0D };
|
||||
0x0A, 0xFB, 0x00, 0x00, 0x02, 0x0D,
|
||||
0xAA, 0x55, 0xF0, 0x0F, 0x68, 0xE5, 0x97, 0xD2 };
|
||||
Stream^ fileStream;
|
||||
String^ str_dev_type;
|
||||
String^ str_backup_dev_type;
|
||||
@@ -1732,7 +1802,7 @@ namespace CppWinFormJoy {
|
||||
//Backup Validation
|
||||
for (int i = 0; i < 20; i++) {
|
||||
if (validation_magic[i] != this->backup_spi[i]) {
|
||||
validation_check = 0;
|
||||
validation_check = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1750,29 +1820,35 @@ namespace CppWinFormJoy {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (handle_ok == 1 || handle_ok == 2) {
|
||||
for (int i = 28; i < 36; i++) {
|
||||
if (validation_magic[i] != this->backup_spi[0x1FF4 + i - 22])
|
||||
{
|
||||
ota_exists = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ota_exists) {
|
||||
for (int i = 22; i < 28; i++) {
|
||||
if (validation_magic[i] != this->backup_spi[0x10000 + i - 22]) {
|
||||
validation_check = 0;
|
||||
if (validation_magic[i] != this->backup_spi[0x10000 + i - 22] && i != 23) {
|
||||
validation_check = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 28; i < 34; i++) {
|
||||
if (validation_magic[i] != this->backup_spi[0x28000 + i - 28]) {
|
||||
validation_check = 0;
|
||||
if (validation_magic[i] != this->backup_spi[0x28000 + i - 22] && i != 23) {
|
||||
validation_check = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (handle_ok == 3) {
|
||||
for (int i = 28; i < 34; i++) {
|
||||
if (validation_magic[i] != this->backup_spi[0x10000 + i - 28]) {
|
||||
validation_check = 0;
|
||||
else {
|
||||
for (int i = 22; i < 28; i++) {
|
||||
if (validation_magic[i] != this->backup_spi[0x10000 + i - 22] && i != 23) {
|
||||
validation_check = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (validation_check == 0) {
|
||||
if (!validation_check) {
|
||||
MessageBox::Show(L"The SPI backup is corrupted!\n\nPlease try another backup.", L"Corrupt backup!", MessageBoxButtons::OK, MessageBoxIcon::Stop);
|
||||
this->textBox2->Text = L"No file loaded";
|
||||
this->label7->Visible = false;
|
||||
@@ -1789,10 +1865,10 @@ namespace CppWinFormJoy {
|
||||
|
||||
for (int i = 4; i < 10; i++) {
|
||||
if (mac_addr[i] != this->backup_spi[0x1A - i + 4]) {
|
||||
mac_check = 0;
|
||||
mac_check = false;
|
||||
}
|
||||
}
|
||||
if (mac_check == 0) {
|
||||
if (!mac_check) {
|
||||
if (MessageBox::Show(L"The SPI backup is from another \"" + str_dev_type + "\".\n\nDo you want to continue?", L"Different BT MAC address!", MessageBoxButtons::YesNo, MessageBoxIcon::Warning) == System::Windows::Forms::DialogResult::Yes)
|
||||
{
|
||||
this->textBox2->Text = String::Format("{0:x2}:{1:x2}:{2:x2}:{3:x2}:{4:x2}:{5:x2}", this->backup_spi[0x1A], this->backup_spi[0x19], this->backup_spi[0x18], this->backup_spi[0x17], this->backup_spi[0x16], this->backup_spi[0x15]);
|
||||
@@ -1800,7 +1876,7 @@ namespace CppWinFormJoy {
|
||||
this->comboBox1->Visible = true;
|
||||
this->btn_restore->Visible = true;
|
||||
this->btn_restore->Enabled = true;
|
||||
allow_full_restore = 0;
|
||||
allow_full_restore = false;
|
||||
}
|
||||
else {
|
||||
this->textBox2->Text = L"No file loaded";
|
||||
@@ -1897,7 +1973,7 @@ namespace CppWinFormJoy {
|
||||
this->label7->Visible = true;
|
||||
this->label7->Size = System::Drawing::Size(188, 230);
|
||||
this->label7->Text = L"This basically restores the Factory Configuration\nand the User Calibration. It restores the only 2 4KB sectors that are usable in the writable 40KB region.\n\nTo preserve the factory configuration from accidental overwrite the full restore is disabled if the backup does not match your device.";
|
||||
if (allow_full_restore == 0)
|
||||
if (!allow_full_restore)
|
||||
this->btn_restore->Enabled = false;
|
||||
}
|
||||
}
|
||||
@@ -2132,6 +2208,42 @@ namespace CppWinFormJoy {
|
||||
this->errorProvider2->SetError(test, String::Empty);
|
||||
}
|
||||
|
||||
private: System::Void textBoxDbg_SubcmdArg_Validating(System::Object^ sender, CancelEventArgs^ e)
|
||||
{
|
||||
TextBox^ test = (TextBox^)sender;
|
||||
bool cancel = false;
|
||||
int number = -1;
|
||||
array<Char>^ mn_str_sn = test->Text->ToCharArray();
|
||||
|
||||
for (int i = 0; i < mn_str_sn->Length; i++) {
|
||||
if ((u8)(mn_str_sn[i] >> 8) == 0x00)
|
||||
{
|
||||
if (('0' <= (u8)mn_str_sn[i] && (u8)mn_str_sn[i] <= '9') || ('A' <= (u8)mn_str_sn[i] && (u8)mn_str_sn[i] <= 'F')) {
|
||||
cancel = false;
|
||||
}
|
||||
else {
|
||||
cancel = true;
|
||||
this->errorProvider1->SetError(test, "The input must be a valid HEX number!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cancel = true;
|
||||
this->errorProvider1->SetError(test, "The input must be a valid HEX number!");
|
||||
}
|
||||
if (cancel)
|
||||
break;
|
||||
}
|
||||
e->Cancel = cancel;
|
||||
}
|
||||
private: System::Void textBoxDbg_SubcmdArg_Validated(System::Object^ sender, System::EventArgs^ e)
|
||||
{
|
||||
//Control has validated, clear any error message.
|
||||
TextBox^ test = (TextBox^)sender;
|
||||
//this->btnChangeSn->Enabled = true;
|
||||
this->errorProvider1->SetError(test, String::Empty);
|
||||
}
|
||||
|
||||
private: System::Void textBox_chg_sn_Validating(System::Object^ sender, CancelEventArgs^ e)
|
||||
{
|
||||
TextBox^ test = (TextBox^)sender;
|
||||
@@ -2209,6 +2321,7 @@ namespace CppWinFormJoy {
|
||||
private: System::Void label_sn_Click(System::Object^ sender, System::EventArgs^ e) {
|
||||
if (debug_is_on == 0 || debug_is_on == 1 || debug_is_on == 2) {
|
||||
this->ClientSize = System::Drawing::Size(738, 449);
|
||||
this->textBoxDbg_sent->Visible = false;
|
||||
this->textBoxDbg_reply->Visible = false;
|
||||
this->groupRst->Visible = false;
|
||||
this->groupBox_chg_sn->Visible = true;
|
||||
|
||||
+30
-17
@@ -11,7 +11,6 @@
|
||||
|
||||
using namespace CppWinFormJoy;
|
||||
|
||||
//#pragma comment(lib, "hid")
|
||||
#pragma comment(lib, "SetupAPI")
|
||||
|
||||
#pragma pack(push, 1)
|
||||
@@ -411,10 +410,10 @@ int send_rumble(hid_device *handle) {
|
||||
|
||||
int send_custom_command(hid_device *handle, u8* arg) {
|
||||
int res;
|
||||
u8 buf_cmd[12];
|
||||
u8 buf[0x170];
|
||||
u8 buf_cmd[36];
|
||||
u8 buf_reply[0x170];
|
||||
memset(buf_cmd, 0, sizeof(buf_cmd));
|
||||
memset(buf, 0, sizeof(buf));
|
||||
memset(buf_reply, 0, sizeof(buf_reply));
|
||||
|
||||
buf_cmd[0] = arg[0];
|
||||
buf_cmd[1] = timming_byte;
|
||||
@@ -425,28 +424,45 @@ int send_custom_command(hid_device *handle, u8* arg) {
|
||||
timming_byte++;
|
||||
if (timming_byte > 0xF)
|
||||
timming_byte = 0x0;
|
||||
|
||||
buf_cmd[10] = arg[5];
|
||||
buf_cmd[11] = arg[6];
|
||||
|
||||
String^ output_report_sys = String::Format(L"Cmd: {0:X2} Subcmd: {1:X2}\r\n", buf_cmd[0], buf_cmd[10]);
|
||||
int byte8_2 = 1;
|
||||
for (int i = 6; i < 31; i++) {
|
||||
buf_cmd[5 + i] = arg[i];
|
||||
output_report_sys += String::Format(L"{0:X2} ", buf_cmd[5 + i]);
|
||||
if (byte8_2 == 4)
|
||||
output_report_sys += L" ";
|
||||
if (byte8_2 == 8)
|
||||
{
|
||||
|
||||
byte8_2 = 0;
|
||||
output_report_sys += L"\r\n";
|
||||
}
|
||||
byte8_2++;
|
||||
}
|
||||
FormJoy::myform1->textBoxDbg_sent->Text = output_report_sys;
|
||||
|
||||
|
||||
//Packet size header + subcommand and uint8 argument
|
||||
res = hid_write(handle, buf_cmd, sizeof(buf_cmd));
|
||||
|
||||
res = hid_read_timeout(handle, buf, sizeof(buf), 200);
|
||||
res = hid_read_timeout(handle, buf_reply, sizeof(buf_reply), 200);
|
||||
|
||||
String^ input_report_sys;
|
||||
|
||||
int byte8 = 2;
|
||||
|
||||
if (res > 12) {
|
||||
if (buf[0] == 0x21 || buf[0] == 0x30 || buf[0] == 0x33 || buf[0] == 0x31) {
|
||||
input_report_sys += String::Format(L"ID: {0:X2} ", buf[0]);
|
||||
input_report_sys += String::Format(L"Batt: {0:X} Subcmd reply:\r\n", buf[2] >> 4);
|
||||
if (buf_reply[0] == 0x21 || buf_reply[0] == 0x30 || buf_reply[0] == 0x33 || buf_reply[0] == 0x31) {
|
||||
input_report_sys += String::Format(L"ID: {0:X2} Subcmd Reply:\r\n", buf_reply[0]);
|
||||
int len = 49;
|
||||
if (buf[0] == 0x33 || buf[0] == 0x31)
|
||||
if (buf_reply[0] == 0x33 || buf_reply[0] == 0x31)
|
||||
len = 362;
|
||||
byte8 = 1;
|
||||
for (int i = 13; i < len; i++) {
|
||||
input_report_sys += String::Format(L"{0:X2} ", buf[i]);
|
||||
input_report_sys += String::Format(L"{0:X2} ", buf_reply[i]);
|
||||
if (byte8 == 4)
|
||||
input_report_sys += L" ";
|
||||
if (byte8 == 8)
|
||||
@@ -459,15 +475,15 @@ int send_custom_command(hid_device *handle, u8* arg) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
input_report_sys += String::Format(L"ID: {0:X2} Subcmd reply:\r\n", buf[0]);
|
||||
input_report_sys += String::Format(L"ID: {0:X2} Subcmd reply:\r\n", buf_reply[0]);
|
||||
|
||||
for (int i = 13; i < res; i++)
|
||||
input_report_sys += String::Format(L"{0:X2} ", buf[i]);
|
||||
input_report_sys += String::Format(L"{0:X2} ", buf_reply[i]);
|
||||
}
|
||||
}
|
||||
else if (res > 0){
|
||||
for (int i = 0; i < res; i++)
|
||||
input_report_sys += String::Format(L"{0:X2} ", buf[i]);
|
||||
input_report_sys += String::Format(L"{0:X2} ", buf_reply[i]);
|
||||
}
|
||||
else {
|
||||
input_report_sys += L"No reply";
|
||||
@@ -595,7 +611,6 @@ int usb_deinit(hid_device *handle) {
|
||||
memset(buf_cmd, 0, sizeof(buf_cmd));
|
||||
memset(buf_cmd2, 0, sizeof(buf_cmd2));
|
||||
|
||||
//buf_cmd[0] = 1;
|
||||
Sleep(16);
|
||||
buf_cmd[0] = 0x80;
|
||||
buf_cmd[1] = 0x05;
|
||||
@@ -653,8 +668,6 @@ int usb_command(hid_device *handle) {
|
||||
res = hid_write(handle, buf_cmd, sizeof(buf_cmd));
|
||||
res = hid_read(handle, buf_cmd2, 0);
|
||||
|
||||
Sleep(4000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ extern int send_custom_command(hid_device *handle, u8* arg);
|
||||
extern int device_connection();
|
||||
extern int set_led_busy();
|
||||
int handle_ok;
|
||||
int allow_full_restore;
|
||||
bool allow_full_restore;
|
||||
hid_device *handle;
|
||||
hid_device *handle_l;
|
||||
int handler_close;
|
||||
|
||||
Reference in new issue
Block a user