SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Sofia, Bulgaria
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP and USB device

    I am always wondering can I connect some device from PHP using USB port. Using COM function i discover this device and can get his name, but that's all. Can you give me some directions or I need device's RFC for next step of communication?

    Regards
    Bogomil
    http://purplerain.org

  2. #2
    SitePoint Wizard Mike Borozdin's Avatar
    Join Date
    Oct 2002
    Location
    Edinburgh, UK
    Posts
    1,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmmm. COM functions in PHP, can you possoble give me a link to them?

  3. #3
    SitePoint Addict launchcode's Avatar
    Join Date
    Dec 2004
    Location
    Bristol, UK
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mike - look at the PHP manual section "COM support functions for Windows"

    Bogomil - this should be perfectly possible via the com_invoke and similar functions. I do not believe it is the RFC you need but rather a list of the API calls you can make to the devices interface. You're going to need to know which methods you can call (and what a valid response should be). As you know the whole point of COM is that you can use other components regardless of what language they were written in.

    The following web site should prove useful if you are dealing with standard Windows API calls (and there are an awful lot of them!)

    http://www.mentalis.org/apilist/apilist.php

    If you don'thave the API for the COM object you wish to interface with, you can just open it up into a resource editor (or even notepad!) and you'll get a list of every function inside it - however you cannot just call these directly, but it might give you more of a clue while digging around.

    Cheers,

    Rich
    Richard Davey

    Launchcode
    PHP Security Guide. Think your scripts are secure? Think again.

  4. #4
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Sofia, Bulgaria
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    re

    Quote Originally Posted by Mike Borozdin
    Hmmmm. COM functions in PHP, can you possoble give me a link to them?
    Hello, yes you can find them here:
    http://php.net/com
    you can also see PHP communication with WMI using COM

    Regards
    Bogomil
    http://purplerain.org/

  5. #5
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Sofia, Bulgaria
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks launchcode.
    Here is my problem. I have a Flash device attached to my PC using USB. I 'll search into this website for apropriate method to any connection.

    Thanks
    Bogomil

  6. #6
    SitePoint Wizard Mike Borozdin's Avatar
    Join Date
    Oct 2002
    Location
    Edinburgh, UK
    Posts
    1,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bogomil
    Hello, yes you can find them here:
    http://php.net/com
    you can also see PHP communication with WMI using COM

    Regards
    Bogomil
    http://purplerain.org/
    But these functions are COM functions, but I thought you used different COM functions that worked with COM ports but not with Windows system, do you really have a code that can locate a device as you said?

  7. #7
    SitePoint Addict launchcode's Avatar
    Join Date
    Dec 2004
    Location
    Bristol, UK
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mike - I guess it's perfectly possible that the device has a COM interface? I would be surprised, but it's certainly possible if it has been coded that way.
    Richard Davey

    Launchcode
    PHP Security Guide. Think your scripts are secure? Think again.

  8. #8
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Sofia, Bulgaria
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    re

    Hello
    Mike Borozdin: I use COM functions on Windows and WMI to locate device.

    Regards
    Bogomil


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •