Go Down

Topic: I DO NOT want ghetto data conversions because of telnet (Read 891 times) previous topic - next topic

delinquentme

Feb 20, 2011, 11:28 pm Last Edit: Feb 20, 2011, 11:38 pm by delinquentme Reason: 1
Ha. i think the title sums it up.

What I'm after:
RoR App <=> MAGIC DATA TRANSFER*  <=> Arduino Ethernet shield

*magic data transfer has been achieved using telnet
... BUT with this AWFUL ascii converted data

Example:
I telnet in, and send it:
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
# stepper rotates



ABSOLUTELY NOT what im after...

i want to send it:
"100"
# stepper steps 100 steps
"-100"
# stepper steps reverse 100 steps

1. CAN this be done with telnet?
2. MUST i resort to this fugly data conversion

if ( #2 == 'true'){
    Forget telnet ... what can i use to send real STRICT .. unconverted data types?
}


I simply cannot imagine that there is __NO__ way to send my data as an INTEGER .. and not have to do this wonky conversion / reconversion bc im using TELNET as a transfer method

... telnet is the simplest solution .. which id like to use .. but id REALLY REALLY like to send it actual integers

PaulS

Telnet sends ascii data. You need to collect the characters in an char array, keeping it NULL terminated, and convert the ascii representation of the number ("100") to an integer. It happens that there is a function, atoi() to do exactly that.

delinquentme

ok so after some research TELNET is exactly NOT the way to do this

so im gonna make a new post with what im actually going to do

Go Up