Software made right!

IPCodes


A simple but powerful utility to send/receive data over TCP/IP.

IPCodes is a universal (iPhone/iPod Touch/iPad) application.

Price: $1.99 USD

09-08-2011 - New IPCodes Blog Entry

If you would like to be automatically notified of new IPCodes information please click on the Feedback and Help button above, send me a note asking to be added to the email list for IPCodes!

IPCodes is a universal application that allows you to send and receive data to any network enabled device or computer from your iPhone, iPod touch, or iPad.

As more and more network enabled devices appear on the market such as stereo receivers, DVD players it is possible to control these devices if you obtain the command sequences for them. Many manufacturers make the network command sequences available on their websites or in the product manual. With IPCodes if you know the IP address of your device and you know the command sequence that is expected you can turn your iPhone, iPod Touch or iPad into customized remote control!

The thing that makes IPCodes different from other apps that allow you to send network data is that each code programmed into IPCodes consists of a mini programming language that includes delays, labels, looping, including, and executing other codes! This flexibility makes IPCodes amazingly powerful since many network enabled devices require specific sequences and in some cases delays.

IPCodes allows you to store as many codes as space allows on your device. Each code must have a unique name and at least one action. Within the code is a place to enter the IP address (or web address) of your device, port to connect on and then a space to enter actions (which are commands to be executed) and a notes area for general use.
For this example code we are naming it “Receiver on”. The receiver is located at IP address 192.168.168.15 and is listening for a connection on port 60000. In the actions field we have specified:

delay(250); - This delays for 250ms after connecting
sendbyte(27); - This sends the escape character
sendbyte(79); - This sends a capital O
sendbyte(78); - This sends a capital N


After executing these four lines the code will disconnect from the device.
On the screen for adding (and editing) a code there are buttons which allow you to:

  • Test connect - Test the connection to the device using the address and port specified
  • Test syntax - Insure that you have not misspelled or forgotten a semi-colon
  • Help - Obtain help on how to use IPCodes

Currently the mini-language in IPCodes is growing. In this first release we support the following commands:
  • noop();
    Does nothing. Everything between () is ignored. Can serve as a comment.
  • comment("Text");
    Does nothing. Everything between () is ignored. Can serve as a comment.
  • include("NAME");
    Includes the actions from the code named NAME and executes them using this connection.
  • execute("NAME");
    Executes the code named NAME. It opens it's own connection and runs its own action list separately.
  • delay(##);
    Delays ## milliseconds before continuing with the next action.
  • setsendtimeout(#);
    Sets the number of seconds (#) to wait for successful transmission of data.
  • sendbyte(##);
    Sends the single byte identified in decimal (##). For example 13 is a carriage return, 10 is a linefeed, 27 is the escape character etc. The help contains an ASCII chart to help you find the decimal equivalents for each character.
  • sendtext("TEXT");
    Sends the text between quote marks.
  • setgetlength(#);
    Sets the maximum number of characters to receive when using the gettext action. If this action is not used the default receive amount if 4096 characters.
  • setgettimeout(#);
    Sets the number of seconds (#) to wait for receive data. If this action is not used the default is 3 seconds.
  • getbyte("BUFFER");
    Receives a byte and stores it in the buffer named BUFFER. If setgettimeout() is used that timeout will apply otherwise this action waits 3 seconds for data.
  • gettext("BUFFER");
    Receives a number of bytes into the buffer named BUFFER. The maximum receive size can be set using setgetlength() and the timeout can be set using setgettimeout().
  • ifcontains("TEXT","BUFFER");
    Determines if "TEXT" is contained in the buffer "BUFFER". If the buffer does contain the text the next line is executed, otherwise the next line is skipped.
  • ifnotconnected("LABEL");
    Checks if the socket connection is still connected. If not execution jumps to the label named "LABEL".
  • label("NAME");
    Defines a label named "NAME". Labels can be used as loop and goto points.
  • goto("NAME");
    Execution jumps to label named "NAME".
  • loopcount(#);
    Sets the number of times a loop will execute. This must be called prior to starting a loop or the loop will execute just once.
  • loop("NAME");
    Loops to the label named "NAME" if the loop count previous set is still a positive number and greater than zero.
Here is a simple action list:

delay(250);
sendbyte(27);
sendbyte(79);
sendbyte(78);


This action list first delays 250 milliseconds then it sends the escape character (27), then it sends a capital O (79) and a capital N (78).

If your device needed slower character transmission you could do something like:

delay(250);
sendbyte(27);
delay(15);
sendbyte(79);
delay(15);
sendbyte(78);

This would send the same exact code but each character would have a 15ms delay before the next character. Alternatively if your device uses plain text command you could do something like:

delay(250);
sendtext("ON");
sendbyte(13);

This would wait 250ms after connection then send the text ON and a carriage return (13).

The include() action allows you to include actions from another named code and execute them as part of the current sequence. Assume you had a code which turned your stereo receiver on named RON and another code which set the receiver input to your CD player named SETCD. You could write a new code which would do these to things without having to retype them:

delay(100);
include("RON");
delay(100);
include("SETCD");

This new code would include any actions from both RON and SETCD and run them as if you had typed them directly into this current code. You might name this code LISTEN TO CD.

With revision 1.01 (now available in the app store) it will be possible to have a code which does not create and use its own connection and simply acts as a wrapper for other codes using the execute command. For example, assume you have two codes: RECEIVER ON and SPEAKERS MAIN, in which the first one communicates with your stereo receiver and the second one communicates with a separate speaker switcher. You've tested each code on its own and you know that each one works correct.

With revision 1.01 and later you will be able to create a code with no connection that simply executes these two codes. Example:

Code name: RECEIVER ON SPKR MAIN
Address: (leave blank)
Port: (leave blank)
Actions:
execute("RECEIVER ON");
execute("SPEAKERS MAIN");

This code when run will create no connection of its own and it will execute (as separate tasks) each of the specified codes which will create their own connections and perform there own actions. Obviously the codes "RECEIVER ON" and "SPEAKERS MAIN" must be available and fully implemented.

The cool thing about wrapper codes under version 1.01 is that you can program up individual codes which do specific things like turning on your receiver, selecting an input, setting speakers. Once you have these individual actions working you can then make wrappers for them which act like macros on a programmable remote!