AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Cross-Platform-Entwicklung Komponente Android Daten USB senden/empfangen
Thema durchsuchen
Ansicht
Themen-Optionen

Komponente Android Daten USB senden/empfangen

Ein Thema von Bierwut-Tom · begonnen am 8. Jan 2016 · letzter Beitrag vom 24. Mär 2016
Antwort Antwort
Seite 1 von 2  1 2      
DonAlfredo

Registriert seit: 13. Mai 2010
19 Beiträge
 
#1

AW: Komponente Android Daten USB senden/empfangen

  Alt 21. Mär 2016, 08:13
Here the author.
What Delphi version are you using ?
If I check with XE8 and XE10, all is ok !

Edit:

Sorry, I see: XE6.

Unfortunately, I do not have XE6.

But I will be interested to know what is needed to get things going under XE6 !
Alfred

Geändert von DonAlfredo (21. Mär 2016 um 08:15 Uhr)
  Mit Zitat antworten Zitat
wschrabi

Registriert seit: 16. Jan 2005
456 Beiträge
 
#2

AW: Komponente Android Daten USB senden/empfangen

  Alt 21. Mär 2016, 14:38
The problem was that I had the FIle in UTF8 format.
I had to convert it to ANSI then I could deploy it.
Thanks for your help
Walter
  Mit Zitat antworten Zitat
wschrabi

Registriert seit: 16. Jan 2005
456 Beiträge
 
#3

AW: Komponente Android Daten USB senden/empfangen

  Alt 22. Mär 2016, 08:24
HI
also ich hab die USb componenten von https://github.com/LongDirtyAnimAlf/...ndroid-USB-HID installiert. Klar kann man eine SERIAL vom HID USB Device auslesen, doch fehlt die GET_REPORT Methode. bei den JVCL Libraries https://github.com/project-jedi/jvclgibt es auch eine HIDCOntroller componete, aber hier gibt es die GetINputReport Methode.

ich hätte noch eine FRAGE:
Bieten Sie auch eine Delphi Componente die auf ANDROID API wi unter https://github.com/LongDirtyAnimAlf/...ndroid-USB-HID auf baut an?
Leider finde ich in dieser github lib nicht die Methode GetINputReport.
Die WIndows API Componente https://github.com/project-jedi/jvcl , die unter WIndows HID Devices zu steueren erlaubt, hat diese Methode GetINputReport drin.
Zwar hat Android API eine ReadWrite Methode, mit der man zb die Device Serial Number auslesen kann.
Meine Zweite Frage: Das Commando zum Auslesen der Serial ist lt. Program
> type
> TCommands = (
> CMD_get_serial=100,
> CMD_set_serial=101,
> );

wissen Sie vielleicht, ob Get_report auch so eine Bitfolge als Commando hat?
Vielleicht kann man einfach das Command anpassen und bekommt dann den Report?
Danke für Ihre INfo.

Kann wer helfen?
Danke

English:
In the USB componentes at https://github.com/LongDirtyAnimAlf/...ndroid-USB-HID there is the GET_REPORT Method missing. In the JVCL Library https://github.com/project-jedi/jvcl there is also a HIDController componente included. But there there is the GetINputReport Methode included. Can anyone here give my an advice?

Geändert von wschrabi (22. Mär 2016 um 08:39 Uhr)
  Mit Zitat antworten Zitat
DonAlfredo

Registriert seit: 13. Mai 2010
19 Beiträge
 
#4

AW: Komponente Android Daten USB senden/empfangen

  Alt 22. Mär 2016, 11:27
Nop !
No GET_REPORT.

I wrote this library to communicate with some Microchip USB mcu's.
HID interrupt only. No reports. Yet.

This:
TCommands = (
CMD_get_serial=100,
CMD_set_serial=101,
);
are just internal commands for my mcu's.
They slipped into the demo not seen by me.

At the moment I am very busy.
If time is available again, I will look into it.

But you could give it a try to do it yourself.
Because the basic code is just a copy of the original JVCL code.
So, perhaps, a copy of the original GET_REPORT code will also work in this library.

Later, I will look into it !.
Alfred
  Mit Zitat antworten Zitat
wschrabi

Registriert seit: 16. Jan 2005
456 Beiträge
 
#5

AW: Komponente Android Daten USB senden/empfangen

  Alt 22. Mär 2016, 17:18
Nop !

Because the basic code is just a copy of the original JVCL code.
So, perhaps, a copy of the original GET_REPORT code will also work in this library.

Later, I will look into it !.
Don, I have analysed the WIN JVCL code and they use the Get_Report methode via the DLL from windwos.
you will find in HID.pas of the JVCL LIb:

Zitat:
{$IFDEF WINXP}

// (rom) new XP functions

function HidD_GetInputReport(HidDeviceObject: THandle;
Buffer: Pointer; BufferLength: ULONG): LongBool; stdcall;

function HidD_SetOutputReport(HidDeviceObject: THandle;
Buffer: Pointer; BufferLength: ULONG): LongBool; stdcall;

{$ENDIF WINXP}

function HidP_GetCaps(PreparsedData: PHIDPPreparsedData;
var Capabilities: THIDPCaps): NTSTATUS; stdcall;
So far as I can say, I am not sure if I can adapt the JVCL LIb with the ANDROID API as the ANDROID API have less commands.
Thanks a lot for your reply.

Walter

Geändert von wschrabi (22. Mär 2016 um 21:02 Uhr)
  Mit Zitat antworten Zitat
DonAlfredo

Registriert seit: 13. Mai 2010
19 Beiträge
 
#6

AW: Komponente Android Daten USB senden/empfangen

  Alt 23. Mär 2016, 06:22
Yep. It will need (a lot) more work to implement reports.
And if that is the case, you will have to have a little patience.
Sorry for that. I will report back.
Alfred
  Mit Zitat antworten Zitat
DonAlfredo

Registriert seit: 13. Mai 2010
19 Beiträge
 
#7

AW: Komponente Android Daten USB senden/empfangen

  Alt 23. Mär 2016, 08:16
I just had a quick look on how to send/get a report.
You need to do a controltransfer.
I you look at: function TJvHidDevice.GetDeviceString(Idx: Byte): string;
You will find an example on how to do a controltransfer.
It could give you a start.
Alfred
  Mit Zitat antworten Zitat
wschrabi

Registriert seit: 16. Jan 2005
456 Beiträge
 
#8

AW: Komponente Android Daten USB senden/empfangen

  Alt 23. Mär 2016, 08:38
I just had a quick look on how to send/get a report.
You need to do a controltransfer.
I you look at: function TJvHidDevice.GetDeviceString(Idx: Byte): string;
You will find an example on how to do a controltransfer.
It could give you a start.
thanks , that is a help. I will investigate.
I would be thankful if I can ask you (many) more.
thanks

PS: One more question:
Would this be a way to make the prg debugable?
My Device is connected to the ANdroid usb OTG. So I can not debug via Delphi and the device is connected.
So My idea:
Wo make the same way with WIN API with the control transfer, as my device can be connected to WINDOWS and so
I can debug the prg too.
When It works on win I copy it to my Android program.
Would this a way to start the investigation?

I tried: But I do not get an aquivalent function in the WIN API (Hid.dll) for
Code:
 FUsbDeviceConnection.controlTransfer
.
How can I make a controltransfer with win api wihtout using the ready made GEt_Report.
Any ideas?

Thanks

Geändert von wschrabi (23. Mär 2016 um 09:02 Uhr)
  Mit Zitat antworten Zitat
wschrabi

Registriert seit: 16. Jan 2005
456 Beiträge
 
#9

AW: Komponente Android Daten USB senden/empfangen

  Alt 23. Mär 2016, 08:36
Yep. It will need (a lot) more work to implement reports.
And if that is the case, you will have to have a little patience.
Sorry for that. I will report back.
thanks don, I am not soo sophisticated than you are, and now it is clear that I need not to break my minds.
But generally, it could be implementated with Android API to make REPORTs, right?
If so, I need someone how makes it.

Moreover, I have done the firmware for my device. Its like a mouse. Maybe it is easier to change the
mouse firmware (which is not interruped) into a HID with interupes.
Do you know what I have generally to change ? The mouse firmware I have done step by step according a how-to manual. It transfers only 12 BYTES when I hit one DIP switch.

In My WIN Prg I poll by getting reports the device and get the 12 Bytes which are interpreted than.

If it would be done by interuppes, I just could use the OnData Handler and it would be quite easy with
the JVCL Lib.

Thanks for help
Walter
  Mit Zitat antworten Zitat
wschrabi

Registriert seit: 16. Jan 2005
456 Beiträge
 
#10

AW: Komponente Android Daten USB senden/empfangen

  Alt 22. Mär 2016, 14:59
Here the author.
What Delphi version are you using ?
If I check with XE8 and XE10, all is ok !

Edit:

Sorry, I see: XE6.

Unfortunately, I do not have XE6.

But I will be interested to know what is needed to get things going under XE6 !
Dear Sir,
I just found the problem:
The token <%receivers%> will not work in XE6. WIll it work in X10 and what ´does it do? WIth out I can deplay, but I have problems with my HID USB Device.
I try to get the Vendor name from the descriptor. But alway a blank line. But I can get the PID and VID.
Can you help me please?
Thanks
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2      


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:38 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz