How can I catch this output logs by using Delphi ?
On picture is my cellphone, but it could be any other modem. I need to get the result form "Query Modem"
I want my program be able to make query such modem and get the output logs.
update question:
I want to see that kind of logs (not exactly same) by using any possible way. It is okay if need to dealing with com port component. My concern is the result from ATI1
You can connect to the modem via your com port.
Use something like Turbo Power's Async Professional (free, open source).
http://tpapro.sourceforge.net/ApdComPort.html
Send the AT commands that you need, and catch everything that the modem returns.
Related
I have a problem where I need to check the TCP packets on a machine.
We use a closed source VOIP system here and I want to open a program when an incoming calls happens.
The VOIP system's software shows the call, however has no functionality to call external software.
I used Wireshark to capture my PCs packets and I'm able to filter the packets easily by
ip.src==AAA.BBB.CCC.DDD && giop.request_op == "pushEvents" && giop.len > 300 && tcp contains "CallInfo"
Now I can work with this package if my custom software could read the package from pipe
Is there a library for purebasic that can do this capturing and filtering??
Alternatively Is there a way to trigger wireshark (console start) so it outputs the filtered data to pipe? (I noticed tshark could do this but does not support this display filter)
Thanks for any constructive answer not hitting me for rtfm ;-)
tshark is just a terminal/console interface to the same engine as GUI Wireshark. It should support all the same protocol dissectors and display filters as GUI app.
I'm pretty sure you're doing something wrong while launching it. Please provide more info why you didn't manage to get tshark working.
To solve your problem: I would launch a tshark with the filter you've come up with so only those packets are displayed on the output. Then I would pipe the output to the simple python/bash/whatever script that launches the app you want on every line of input.
You will also need to take care of specific situations like:
ensure the input line is what it was supposed to be (you can get error lines etc from tshark)
perhaps avoid launching the app if it's already running
In Xamarin, I'm often using the Console (WriteLine) to debug an application.
Is this possible to write some lines directly to a file somewhere on the host machine instead of using the Console to debug? I don't want to write a file on the phone as I'll use this file in realtime on the development machine.
The easy way:
Use Console.WriteLine in your app.
On your host, execute this:
/Developer/MonoTouch/usr/bin/mtouch --logdev > ~/myfile.log
And now your Console.WriteLine output will end up in ~/myfile.log. The downside is that you'll get everything written to the Device Log, both from iOS itself and any other apps (this can be significant sometimes). However it should be possible to filter out only your output by some clever grep usage.
The more involved approach would be to redirect Console.WriteLine output to some sort of network stream that sends the data over wifi to the host machine (or a web service for instance).
The easy part is to redirect Console.WriteLine output:
Console.SetOut (myNetworkStream);
The rest will be left as an exercise for the reader, since that wasn't part of the question :)
I have a device that sends data to Hyperterminal. What I want is that when a certain piece of text appears is to get an alert, either audible or visual. Is there any software/scripts etc available that might of that functionality?
You'd probably be as well using vb .net or similar and listen to the device using the comms port directly. You can then trigger an event based on the returned data.
There's some useful info here:
How to access serial and parallel ports by using Visual Basic .NET
I am trying to automate the process of capturing network packets send by a particular application.I don't have problem in windows as I am using Microsoft Network Monitoring tool and that gives all the traffic send based on the process.Now the problem is that we need to achieve the same result in mac as well.
We used Wire-shark in mac for capturing network traffic after a long research but still wireshark does not capture by process name.We tried some tools that captures based on process name but with very limited information. We need the full packet informations to be captured.
What will be the best way to achieve the result in mac as like we are getting in windows?
what all parameters can be used to filter the wanted data...?
I am in fact trying to get the port number used by the process but is that a right approach ? I am not sure we can zero down based on port number.
Any help would be greatly appreciated...
Thanks in advance...
You can use lsof command, but it's more complex than netstat.
Here is a guide: lsof survival guide
I am trying to find a solution to monitor the traffic (in and out) through a specific port. It is not required to capture the packets, or do anyting else. What it does is to be a traffic listener to make sure there are messages sent to or received from this port every 10 minutes. It has to be running at the background all the time (like a daemon), and without significant performance impact. Based on my research, one choice is to use an existing tool to do that. There are a bunch of tools out there to monitor or sniff the traffic, such as wireshark. Well, seems most of them monitor the traffic passing through a interface, instead of a port, or they can't run as a daemon. Another choice to write a program to do this. SharpPcap seems to be a good choice, but I still need to capture and analyze the packets to know whether such traffic exist. Could somebody suggest what I should do?
SharpPcap handles packet capturing in the same manner as Wireshark, so you can set filters to limit the packet being captured to a specific port the same way in SharpPcap as you can in wireshark. Except, SharpPcap will be a much lighter weight option vs wireshark.
Download the SharpPcap source tree and look at the Example05.SetFilter.
To narrow down the results so you capture only the packets you want to see you'll need to employ a few filters.
Pcap uses a common language across all applications that use it do specify the filters to set. Capture programs that use winpcap (windows) or libpcap (*nix) include, sharppcap, wireshark, pcap.net, winpcap, libpcap, tcpdump, etc... For a great resource on how to use pcap filters see this link.
Here are the filters you need:
ether host ehost
port port
Where the ehost is the MAC address of the computer sending/receiving the packets and the port is the port you want to monitor. So the full filter string would be.
SetFilter("ether host ff:ff:ff:ff:ff:ff and port 60");
The MAC and port here are for illustration purposes only, you'd obviously change them with the values that pertain to your specific setup.
This, used in the SetFilter example will simply print out a line of info with the time of when the packet was captured to the command line every time a packet is captured and meets the criteria if your filter.
If you want more detailed info about the packet, such as info from the headers or the packet's payload, you'll need to parse the incoming raw packet. Be sure to ask for help on the sourceforge project's forum if you need some tips on how to do this. The project developers are very active and always willing to help.
The best way that will limit the impact your tool will have on performance is via an ETW (Event Tracing for Windows) Real-time Consumer (i.e. a tool that activates an ETW trace and reads it immediately instead of saving it to a file). This MSDN sample is a great way to see how to do this via C# and it gives you some code to get started.