marklin-users.net community | Forum
Wish to join the discussion?! Login to your marklin-users.net community | Forum accountor Register a new forum account. Or Connect via Facebook
void __fastcall TMainForm::SendButtonClick(TObject *Sender) { struct Can { byte Prio; byte Command; short int Hash; byte Dlc; byte D[8]; }; Can c; c.Prio = 0; c.Command = StrToInt(eCmd->Text); c.Hash = StrToInt(eHash->Text); c.Dlc = spDlc->Value; c.D[0] = StrToInt(eD0->Text); c.D[1] = StrToInt(eD1->Text); c.D[2] = StrToInt(eD2->Text); c.D[3] = StrToInt(eD3->Text); c.D[4] = StrToInt(eD4->Text); c.D[5] = StrToInt(eD5->Text); c.D[6] = StrToInt(eD6->Text); c.D[7] = StrToInt(eD7->Text); WSocket->Proto = "udp"; WSocket->Addr = "255.255.255.255"; WSocket->Port = PortEdit->Text; WSocket->Connect(); WSocket->Send(&c, 13); WSocket->Close(); }