Epson C32C824151 Technical Reference - Page 61
For Linux
![]() |
UPC - 000054074415
View all Epson C32C824151 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 61 highlights
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 \n"); 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; } Rev. A 4-5 Programming Samples
![](/manual_guide/products/epson-c32c824151-technical-reference-498e021/61.png)