Feb-27-2018, 04:14 AM
Hi all. This may be a stupid question, but I find what I am trying to do quite confusing. Im receiving a GPS sentence from another server, and I would like to convert this sentence to something else, and send it over the wire, basically as bytes, to another server. I've basically got a client and server in two separate pycharm projects on my desktop, and am sending a message over from the client to the server as follows:
So I do my conversion and basically I have the results in an array.
Now I want to take that isNavGPRMC[] array which is 12 values and send them over the wire to another server, and the server should receive something like 0A 5b 6C 4D etc. etc. (those are just random numbers).
How can I :
1. Print the isNavGPRMC[] array as ascii characters
2. Send those ascii characters over 'the wire' as a binary stream of those ascii characters (I guess thats how you can put it?)
Hope you can help
:D Thanks.
# This is a very standard GPS sentence message = '$GPRMC,145012,A,3417.2967,N,07805.1806,W,000.0,291.9,240517,000.0,W*7D'Now, in my server program/project, I am receiving this sentence and splitting it by comma
split_request = request.split(',')Then what I would like to do is build basically a new string or array of things (or anything really that will get me to my final result) that is basically a few different converted values and send it off to another server as a converted GPS sentence, which is basically a stream of bytes.
So I do my conversion and basically I have the results in an array.
for x in range(12): result = eval(convGPRMC[x].format('split_request[x]')) split_request[x] = result isNavGPRMC[x] = split_request[x]So now, of course, I have a function that converts all of those values and drops them into the isNavGPRMC[] array and now I have all of my values.
Now I want to take that isNavGPRMC[] array which is 12 values and send them over the wire to another server, and the server should receive something like 0A 5b 6C 4D etc. etc. (those are just random numbers).
How can I :
1. Print the isNavGPRMC[] array as ascii characters
2. Send those ascii characters over 'the wire' as a binary stream of those ascii characters (I guess thats how you can put it?)
Hope you can help
