Luup IO Device
Most Luup plugins are simply interfaces to talk to an external piece of hardware using infrared (a/v devices like TV's), RS232 (high-end a/v gear, alarm panels, etc.), Network (IP cameras and other IP devices), and a handful of other connections like RS485. In this case the Luup plugin will effectively act as a translator to go from UPnP to the device's native communication (i/r, RS232, etc.). All these communication methods (i/r, rs232, network) can be thought of as 'input/output', or IO, because you get data in from the device and send data out to the device. Infrared is often output-only since generally you can only send i/r codes to the device. If you're writing a device that does not talk to some piece of external hardware this section doesn't apply to you.
The Luup engine handles all the low-level i/o. Your plugin only needs to specify what type of i/o to use. Then, within your plugin, when you want to send something to the device you use one of the Luup send commands, like lu_iop_send. If the device is using infrared, whatever you send needs to be in pronto format. If the device is serial/rs232 or network based, you can send anything and Luup will send this data to the device. Generally serial and network devices have a low-level protocol to organize the data you send/receive into 'chunks'. The most basic low-level protocol is to send/receive text commands that end with a carriage return+line feed (ie ENTER), such as: PowerOn [ENTER] ChannelUp [ENTER]. Luup handles the low-level protocol for you, meaning that any incoming data is automatically divided into 'chunks' of discrete commands, and handles adding separating characters like carriage return+line feed to anything you send. This makes it much faster for you to write a plugin.