Epson E02 manual 12Programming Samples

Page 70

buf[11] = 0x00;

buf[12] = 0x00; // Parameter length buf[13] = 0x00;

/* send a packet */

i = sendto(sock, buf, 14, 0, (struct sockaddr*)&addr, sizeof(addr));

/* receive packet */ fromlen = sizeof(addr);

len = recvfrom(sock, buf, MAXBUF, 0, (struct sockaddr*)&addr, &fromlen);

/* print receive packet */ if (len) {

if ((buf[10] == 0x00) && (buf[11] == 0x00)) for (i = 0; i < len; i++)

printf("%3d:%02Xh\n", i, buf[i] & 0xff);

}

/* close socket */ closesocket(sock); return 0;

}

4-12Programming Samples

Rev. A

Image 70
Contents UB-E02 Technical Reference Guide Page Rev. a Revision Information About This Guide Contents of the GuideRelated Documents FCC Compliance Statement For American Users EMC and Safety Standards AppliedCE Marking For Canadian UsersKey to Symbols GereäuschpegelProduct Servicing Safety PrecautionsLabel Operating Environments Environments for Setup UtilityIntroduction Supported Operating SystemsSupported TM Printers Programming How to Use this GuideInstallation Overview AppendixContents Rev. a Contents Xii Contents Rev. a Supported Operating Systems Supported Network ProtocolsOther Limitations Installation Installation PrecautionsPart Names SwitchUnpacking FunctionsUB-E02 Installation 4Installation Rev. a Page 6Installation Rev. a Initializing UB-E02 UB-E02 Status Sheet Printing2 Q2. The self test does not operate correctly FAQ3 Q3. Starting up the printer takes a long time UB-E02 Technical Reference Guide 10Installation Rev. a Setting the IP Address using Epson TMNet WinConfig Setting the IP AddressSetting the TCP/IP protocol in Your Operating System Windows UB-E02 Technical Reference Guide Windows NT Windows Installing Epson TMNet WinConfig Installation EnvironmentsInstallation with Windows Setting with the Epson TMNet WinConfig UB-E02 Technical Reference Guide Page Setting the IP Address Using the arp/ping Command Example ping Epson TMNet WinConfig Functions Tool Menu Time-out setting Menu BarSearch Options Settings Printer Print server TCP/IP Password Epson TMNet WebConfig Functions Opening ScreenTCP/IP Protocol Information and Settings General Information2.2 TCP/IP Information ApipaSnmp Information 2.4 TCP/IP Setting Snmp Communication Setting Snmp IP Trap 1 Setting Snmp IP Trap 2 Setting Administrator Setting Password Setting Reset Advanced Programming Samples Method of Printing to the UB-E02 Buffer of the UB-E02Direct Printing by PORT9100 For Windows Console4Programming Samples For Linux Priorities of Printing Commands Sent to a TM Printer When the Power is OnMonitoring of the ASB status Time-out for ConnectionPrinter Operation by the UDP Commands Commands Packets3 03-0010 Retrieving Status 2 03-0000 Retrieving Basic InformationReply data 4 03-0011 Forced Transmission 5 03-0012 ResetSet-up data 7 03-0016 Clearing Connection Time-Out Timer 6 03-0013 Buffer FlashProgramming Sample For Windows Console12Programming Samples For Linux Rev. a 13Programming Samples14Programming Samples Line Display Connection FeaturesPrinter Connection OverviewHardware Specifications Basic Communications Protocols Software SpecificationsExternal appearance and connector locations Printing Communications ProtocolsHttp Status Inquiry and Setting ProtocolsSnmp MIB Enpc Automatic IP Address Assignment ProtocolsIP Address Acquisition by Dhcp Manual Setting IP Address Assignment by ApipaInternal Settings Item ListSetting with Browser Internal Parameter Setting MethodsSetting with Exclusive utility Setting the IP Address with arp + pingVersion Upgrading Upgrade MethodsInitializing Supported protocolEnvironmental Specifications Storage ConditionsDefinitions 2Definitions Rev. a Page Epson