2 for linux, For linux -5 – Epson UB E02 User Manual
Page 63
Rev. A
4-5
Programming Samples
UB-E02 Technical Reference Guide
4.2.2 For Linux
The program is a sample of printing “EPSON UB-E02” to a TM printer with the UB-E02 from
Linux, through the ethernet connection.
/* TCP00 programming sample for LINUX
* HOW TO BUILD
* cc ltcp.c
*/
#include
#include
int main(int argc, char* argv[])
{
int sock;
struct sockaddr_in addr;
if (argc != 2) {
printf("usage: ltcp
exit(1);
}
/* create socket */
sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0) {
perror("socket()");
exit(1);
}
/* initialize the parameter */
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(9100);
addr.sin_addr.s_addr = inet_addr(argv[1]);
/* connect */
if (connect(sock, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
perror("connect()");
}
printf("connected\n");
/* send data */
send(sock, "EPSON\n", 6, 0);
/* close socket */
close(sock);
return 0;
}
- C8230 (29 pages)
- 400 (38 pages)
- 400 (148 pages)
- 600 (135 pages)
- 640 (45 pages)
- 700 (10 pages)
- 850 (147 pages)
- 1520 (40 pages)
- C82314 (71 pages)
- RS-485 (2 pages)
- 6200A (97 pages)
- C82307 (37 pages)
- 440 (212 pages)
- 440 (240 pages)
- 660 (92 pages)
- 5000 (154 pages)
- 5000 (176 pages)
- 9000 (68 pages)
- ARM.POWERED ARM720T (224 pages)
- SD-DSPUSBB (2 pages)
- CMD-2260 (18 pages)
- C823301 (17 pages)
- S1C6200A (98 pages)
- 33+ (10 pages)
- FEH300b (46 pages)
- SED 1520 Series (40 pages)
- Serial Interface GQ-3500 (13 pages)
- ETX-945 (39 pages)
- Photo EX (35 pages)
- C82364 (279 pages)
- 214D-1 (57 pages)
- EM07ZS1647F (168 pages)
- Connect-It SD-DSWIFIB (2 pages)
- ACTIONPC 7000 (10 pages)
- S5U1C63000H2 (35 pages)
- C824 (4 pages)
- C82069* (46 pages)
- 80211b (68 pages)
- C82312 (13 pages)
- S5U1C17801T1100 (60 pages)
- C82324* (57 pages)
- C82372 (22 pages)
- C82315 (48 pages)
- P07303 (36 pages)