Sending and receiving data over USB port [closed] - windows

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 10 months ago.
Improve this question
I'd like to send/receive data over a USB port to a device (from my vista pc). Is there a free/cheap library out there that can do this, and how involved would this project be (not taking into account what's being sent or received) ?

You don't specify what's going on here. Does the device already exist? Is it already a USB device?
If you already have a USB device, then the manufacturer should be able to help.
If you are building the device, then you might want to look at something like a USB to serial adapter (which generally require no special drivers at all) or something from FTDI - they make a number of easy-to-use USB chips that generally don't need, or come with appropriate drivers under windows. I've worked with their chips on a couple of occasions and they've never given me any trouble.

libusb-win32 maybe?

This article in Code project may be a good start for you. At first you need to build your device. You can either use a micro-controller with a USB port or you can use a serial-to-USB chipset (like the already suggested FTDI).
You should avoid writing your own USB library-driver. The article in the CodeProject uses the HDI driver, which is already present in your device. It uses a PIC micro-controller, but my personal favourite is AVR. With AVR you have the following options:
AVR-USB: Implements USB stack in firmware. Drivers, examples for all platforms. Any AVR micro can be used. You may need to build the hardware yourself.
Atmel's USB family. These are microcontrollers with USB port. Drivers and ready to buy kits are available. Other manufacturers (like Microchip's PIC family) have similar solutions.

Without knowing anything else about your situation, and assuming you are in control of the device's USB protocol and drivers, I would recommend using WinUSB.
It is a lot better than libusb-win32 because it is a native part of Windows and it supports asynchronous communication. Also, libusb-win32 only supports the libusb-0.1 API, which is really old.

Related

Is there any tool to capture (sniff) packages sending over HDMI socket on Windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Problem
I need a tool like Wireshark to capture outgoing and incoming packets. I searched the Wireshark documentation, but I didn't find any resources related to my question. There is probably some way to do it, but I don't know how to search for this efficiently.
For now, I am using Windows 10 for Education to sniff the packet formats that the monitor supports and expects from desktop applications.
Objective
My objective is to configure my monitor over HDMI (monitor supports it on Windows) when using Linux. Then, I will write a tool to do this and, barring legal obstacles, I will share it.
The Network vs HDMI
The reason that your computer can communicate with a remote server 1000km away is that your computer's network interface encapsulates data with control information. This enables the data to be transmitted over your broadcast domain (layer 2), the internet (layer 3), and a connection between the two devices (layer 4). Depending on the traffic you are sending, more layers/encapsulation may be involved here. Server fault has an answer that goes into more detail on OSI layers.
HDMI is more similar to a point-to-point connection here. There is no expectation that data needs to be sent to remote hosts such that routing/congestion information needs to be included. Wireshark is used to analyze network protocols, but won't be of much use to look at this raw data stream.
HDMI control libraries
You probably want to focus on sending a signal on CEC, HDMI's control wire. There are libraries such as libCEC, which has Linux support and can control this. If you wanted to programmatically control the link, you can, but you will likely need to buy a CEC adapter.

I2C Driver in Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am aware of I2C in a very basic level which relies inside linux kernel, but no clue to implement a basic I2C driver.
Trying to moving for a start in I2C device driver.
could you please suggest any beginner tutorial with source code mapping !!
linux-source/Documentation/i2c/ has lot of the information you'd need. .../writing-clients.txt is a good place to start.
Have a look at the online version:
https://www.kernel.org/doc/Documentation/i2c/writing-clients
There is an okay sort of a tutorial at:
http://renjucnair.blogspot.ca/2012/01/writing-i2c-client-driver.html
Here is a good commentary on someone writing an i2c driver and has a tutorial feel to it:
http://www.embedded-bits.co.uk/2009/i2c-in-the-2632-linux-kernel/
Here is some sample code:
http://code.google.com/p/ldd-templates/source/browse/drivers/i2c/sample-i2c-client.c
I2C driver is implemented as a platform driver in linux kernel.So first you need to understand the linux model for platform devices.
Please go through below documentation under linux kernel for platform devices:
https://www.kernel.org/doc/Documentation/driver-model/platform.txt
You also need to understand the bus structure under linux kernel.Please refer to the below link:
http://www.mjmwired.net/kernel/Documentation/driver-model/bus.txt
Now you can google for I2C drivers and further study.
Have a look at the smbus modules available for many programming languages...then write the driver for your i2c device around that.

Windows Firewall Programming [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I googled many times till I created this question, so please excuse me if there are some tutorials out there. I didn't found them.
How can I code a firewall application in windows? I thought about a usermode fiewall using inline hooks in every process, but there is the problem that I can't hook csrss.exe (which creates the new processes) in windows 7. The second thing is that it's not very clean and will be detected as malware for sure.
So I think that I should hook the APIs in kernel mode as a driver. But there are 3 problems.
First I don't know the kernel APIs
for the windows sockets.
Second I havent't got any experience in kernel
mode hooks.
Third I don't know if
it's the right way.
Don't worry, I know that it's not easy and I'm not a beginner with jsut an idea ;). If anyone has got good information please share it.
Oh and I want to write for x86 Systems ;).
You need Windows Filtering Platform (WFP).
With the WFP API, developers can
implement firewalls, intrusion
detection systems, antivirus programs,
network monitoring tools, and parental
controls. WFP integrates with and
provides support for firewall features
such as authenticated communication
and dynamic firewall configuration
based on applications' use of sockets
API (application-based policy). WFP
also provides infrastructure for IPsec
policy management, change
notifications, network diagnostics,
and stateful filtering.

What happened to the Windows "Midi Mapper"? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I wrote a windows program many years ago, which created music by sending notes to the "midi mapper" (and thence to the midi-synth on my sound-card)
Today, I have a soft-synth which, allegedly accepts midi information, so I'd assume it should be possible to use today's equivalent of a midi-mapper to route the midi output from my program to the soft-synth.
There's clearly no longer a midi-mapper application in windows, but my program still works (on XP) in that it drives the built-in soundcard synth, so there must be some sort of midi handling layer in windows. How can I get at this? And maybe redirect the midi to the soft-synth?
The default MIDI device can be set in Control Panel/Sounds and Audio Devices. If your soft-synth is registered as a MIDI device, you should be able to see it in the dropdown.
AFAIK most modern MIDI software now does its own MIDI routing from one device to another. Windows XP is limited in the number of MIDI devices it can support, and the MIDI software industry is gradually moving towards an all-USB model now.
In the USB model, many hardware controllers (such as this one) are "class-compliant", so you don't even need a special software driver to make them work.
For technical programming documentation about MIDI in Windows, this might be a good starting point.

Any tool similar to Hyperterminal application? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
HyperTerminal is a program that you can use to connect to other
computers, Telnet sites, bulletin
board systems (BBSs), online services,
and host computers, using either your
modem, a null modem cable or Ethernet
connection.
But My main usage of Hyperterminal is to communicate with hardware through local (virtual )COM ports. I suppose it is removed in Vista for some reason.
Are there any other tools that functions similar to Hyperterminal?
[I am curious to know even if it is not for vista]
PuTTY can do serial communication nowdays.
Here are two:
Tera Term
Tera Term (Pro) is a free software terminal emulator (communication program) for MS-Windows. It supports VT100 emulation, telnet connection, serial port connection, and so on.
Kermit 95
Kermit 95: Internet and serial communications for Microsoft Windows® 95, Windows 98, Windows ME, Windows NT (4.0 and later), Windows 2000, Windows XP, and IBM OS/2 from the Kermit Project at Columbia University, offers you text-based terminal connections to Unix, VMS, and many other kinds of hosts, allowing you to interact directly with their shells and applications, to transfer files, and, if desired, to automate interactions and file transfers with its built-in platform- and transport-independent scripting language.
I had the same problem trying to connect to an RFID device over RS323/serial and found SerialMonitor.
There are two links to that application. A free version that I found here (and that's the one I used and it works with Vista):
http://www.softhypermarket.com/Free-Serial-Port-Monitor-download_29681.html
But if you follow the email address to the main site, there are a couple of versions of the tool. They aren't free, but they seem to have more features than the one I used.
http://www.hhdsoftware.com/Products/home/serial-monitor.html
Hope that helps.
Here is a better tool specificaly designed to test serial devices: http://www.caerustech.com/UDT.php . You can save settings and commands for various devices - I use it often at work.

Resources