Pages: [1]   Go Down
Author Topic: I DO NOT want ghetto data conversions because of telnet  (Read 782 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: February 20, 2011, 05:38:15 pm by delinquentme » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 614
Posts: 49365
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: