concox GPS device sending special characters on the port - gps

I tried to integrate with few CONCOX GPS devices but I am receiving special characters (below) on the port. Am I doing something wrong? I tried checking it on netstat but still getting the same special characters. Following are the 4 different data:
"?%U!5g?f2"
"xxU!5g?f2ΣΎ"
"xxU!5g?f2*A"
Is there any setting changes required on port level? I should be getting data in hexadecimal rather special characters

Related

How to know a pack of data is fully received in telnet?

I'm writing a toy MUD client which uses a TCP/IP socket to make a connection to a telnet server.
As a common feature in MUD clients, I should be able to run a bunch of regular expressions on the responses from the server and do stuff when they are triggered.
Now the problem arises when the response is long and received in 2 or more TCP/IP packets, and therefore the regular expressions wont match when I run them on the responses, as they are not complete yet (the first or second part wont match alone).
So the question is how do I know the server is done sending a packet of data before running my regular expressions on them.
The short answer is: you don't
TCP/IP is a serial protocol, that has no notion of packets.
If your application layer protocol uses packets (most do), then you have two options:
use a transport layer that supports packets natively (UDP, SCTP,...)
add packetizing information to your data stream
The simplest way to add packetizing info, is by adding delimiter characters (usually \n); obviously you cannot use the delimiter in the payload then, as it is already reserved for other purposes.
If you need to be able to transmit any character in the payload (so you cannot reserve a delimiter), use something like SLIP on top of TCP/IP
you can keep a stack, add the packets to it, keep testing until you get a full response
If the MUD is to be played (almost) exclusively by the client (not telnet itself), you can add delimiters, again have the stack, but don't test blindly, test when you get a delimiter.
If there is a command you can send that has no gameplay effect but has a constant reply from the server (eg a ping) you could use it as a delimiter of sorts.
You may be over thinking it. Nearly all muds delimit lines with LF, i.e. \n (some oddball servers will use CRLF, \r\n, or even \n\r). So buffer your input and scan for the delimiter \n. When you find one, move the line out of the input buffer and then run your regexps.
A special case is the telnet command IAC GA, which some muds use to denote prompts. Read the Telnet RFC for more details, https://www.rfc-editor.org/rfc/rfc854 , and do some research on mud-specific issues, for example http://cryosphere.net/mud-protocol.html .
Practically speaking, with muds you will never have a problem with waiting for a long line. If there's a lot of lag between mud and client there's not a whole lot you can do about that.

How can i send a SSDP / UPNP packet and get response?

Hey guys well i'm working on a project.
Basically i need to be able to retrieve result of a SSDP packet to find the IP of my Pioneer VSX AVR. It responds to SSDP to be used with the official apps and i am working on a windows application to do the same sort off thing.
Source: http://github.com/cyanlabs/vsxremote
What i know so far...
the packet need to be sent to the ip 239.255.255.250
The port is 1900 and the AVR responds to Telnet/TCP on 23/8102
The description.xml is located at 192.168.0.111:8080/description.xml
I tried to figure this code out but it didn't seem to work. http://social.msdn.microsoft.com/Forums/vstudio/en-US/d7f53b79-80dc-46f7-96dd-fc3b7a28f8d4
The request i need to send is
M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST:urn:schemas-upnp-org:device:MediaRenderer:1
MAN: "ssdp:discover"
MX: 1
Any help would be great. Thanks.
Based on the wireshark output and the linked code (both of which really should be in the post):
CONTENT-LENGTH header should not be part of a M-SEARCH message. You are also missing an empty line (vbCrLf) in the end -- and that's in addition to the CrLf that is missing from end of CONTENT-LENGTH line. In other words, every line including the last line must end with "\r\n" and then there must be an extra "\r\n" in the end. Omitting the empty line typically results in devices ignoring your message (as they can't really know it is complete).
See UPnP Device Architecture part 1 for the de facto spec on SSDP.

Sending SMS through GSM modem in Objective-C

My project is a full program to communicate with a USB modem via serial port. What I am working on now is sending the SMS. What I can't figure out is what to tell it to actually send the message. I know that in terminal you would hit CTRL-z to send the message. Does anyone know how to do this?
I finally figured it out using a combination of these two websites:
Escape Sequences (C)
ASCII Table
The ASCII escape sequence in C is '/xhh' where hh is the hexadecimal sequence, and the ASCII hex sequence for CTRL-Z is 1A, so it's just '/x1a'.

Unicode Character Corrupting Text

I have a weird situation that has been puzzling me for weeks. My project, Textual, is an IRC client for Mac OS X. It works great except one problem. DCC SEND messages via the DCC protocol do not work properly. For some reason the first section of the IP address sent for which connections will be established is always cut off. For example, the correct message sent would be "DCC SEND file.png 72.218.77.160 1097 4699" but once sent is viewed as "DCC SEND file.png .218.77.160 1097 4699"
I have isolated this to the Unicode character 0x01 which is sent along side the message to distinguish it from a standard message. If this character is removed then no stripping occurs. I simply cannot figure out why it does this. It could be a result of sockets or not. Not my strong area on that one. If anyone has time to help it would be appreciated.
After more investigation this appears to be a server-side problem and not an actual problem with the client itself.
A DCC SEND message should not contain the IP address formatted as a dotted quad - it should be formatted as an unsigned 32 bit decimal number. For the address 72.218.77.160, the message should be:
DCC SEND file.png 1222266272 1097 4699
Could be a BOM (Byte Order Mark). Which programming language are you using?
Depending on the Unicode flavor you're sending, certain meta-characters may be sent over to the other side. A good rule of thumb is to never send any flavor of Unicode to an endpoint that isn't capable of reading Unicode (some people compromise in the case of UTF-8 which is nearly identical to ISO-8859-1 for English text, but I'm not a big fan).

SerialPort.GetPortNames() not returning correct result

I'm developing small demo application for Windows Mobile 6.1 to get the list of all serial ports and the Bluetooth devices configured on them. I'm facing some weird problem.
I can see total 10 COM ports when I go to Settings->Connections->Bluetooth->COM POrts. But when I use SerialPort.GetPortNames() to get all the ports, it shows 9 ports i.e. one port less. The last port i.e. COM09 is not returned in the result set.
Then I removed one of the paired devices configured on one of the COM ports (COM08) and SerialPort.GetPortNames() returned the result set WITHOUT the COM08 port.
I further tried to know which COM ports are still unused. When i tried to create "New Outgoing Port" manually on one of the 'unused' (as per my program) port, it gives a message saying "COM port cannot be created"!
Could someone tell me the reason and guide me further to resolve the issue?
The Bluetootch driver is probably modifying the registry key where the Drivers are and GetPortNames is probably looking through that key.
Take a look at both HKLM\Drivers\BuiltIn and HKLM\Drivers\Active with the remove registry editor and see what's happening. You can likely write your own parser that looks at these values for what you are after.