The tini specification and developer's guide

I would like to thank the many people who have contributed to the TINI project and this book. First and foremost I would like to thank the talented engineers who contributed so much to this long and intense development effort for their hard work and dedication: Kris Ardis, Bryan Armstrong, Tom Chenot, Chris Fox, Stephen Hess, Nicolas Kral, Yolanda Lei, Jesse Marroquin, Caroline McLean, Jeff Owens, David Smiczek, Lorne Smith, Stephen Umfleet, and Clayton Ware. I would also like to thank my management, Steve Curry and Michael Bolan, for their support and encouragement while I was writing this book. I am grateful for the volunteer efforts of many on the TINI SIG, who not only provide fantastic support to new developers but also contribute to the quality and definition of the platform. Thorough and insightful technical reviews of early drafts were provided by Tom Cargill, Steve Curry, Peter Haggar, Judy Loomis, Robert Muchsel, and John Wilson. I appreciate all of the excellent feedback. I am also grateful to Mike Hendrickson and Heather Olszyk at Addison-Wesley, who patiently guided me through the writing process. I would also like to thank the copy editor, Debbie Prato, who did a terrific job. Finally, many thanks to the folks at Sun Microsystems who allowed me to use their excellent MIF Doclet tool to create the Almanac. The legend page of the Alma-nac is also the result of blatant thievery from the Java Real-Time specification.

pdf381 trang | Chia sẻ: banmai | Lượt xem: 2093 | Lượt tải: 0download
Bạn đang xem trước 20 trang tài liệu The tini specification and developer's guide, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
DNS (Domain Name System), 124–127 address setting, slush command shell, 38 application layer protocol, 112–113 com.dalsemi.tininet.dns package, 126, 268 DatagramSocket object and, 124–125 DNSClient class, 126, 268 DNSTest program, 126–127 Dynamic Host Configuration Protocol (DHCP) and address setting, 123 forward lookups, 124, 126 getAllByName() method, 127 getByIP() method, 126 getByName() method, 125–126 InetAddress class, 124–126 IP addresses mapping, 124 IP addresses of primary and secondary servers, 125 lookups, 124–126 nslookup (lookup) command, 126 Ping (ICMP echo request/reply), 125 public methods, 126 resolver, 124 reverse lookups, 124, 126 server IP address, 123 setDNSTimeout() method, 126 setDomainName() method, 125 slush command shell for setting address, 38 Socket object and, 124–125 time-out value, 117 UnknownHostException class, 126–127 See also TCP/IP (Transmission Control Protocol/Internet Protocol) network DNSClient class, 126, 268 DNSTest program, 126–127 doADConvert() method, 105 Domain name, 117 Domain Name System. See DNS doubles, 245 down() method, 145 DRST (device reset), 184 DS18S20 temperature sensor example, 85, 102 DS80C390 microcontroller, 4 DS2438 A/D (Analog to Digital) converter, 104–108 DS2502 device, 100 DSFile class, 268–269 DSPortAdapter class, 89, 91–93, 95–96, 269–272 DSPortAdapter() methods, 102–103 DSR (Data Set Ready) signal, 54, 65 DTE (Data Terminal Equipment) serial port, 52–54 DTR (Data Terminal Ready) signal, 53, 63 Dynamic Host Configuration Protocol. See DHCP Dynamic loading of class files (omitted func- tionality), 13 E E10 socket, 25–26, 53 Echo client/server program, 230–232 ECHO_REPLY message, 136 EchoWorker program, 228–229 Edge triggering, 220–221 EEPROM (electrically erasable programma- ble read only memory), 4, 249 enableReceiveThreshold() method, 62 enableReceiveTimeout() method, 61–62 enableSerialPort1() method, 68 endExclusive() method, 96 enumerateAllAdapters () method, 89 Environmental monitors applications, 2 Error and control information, 130 348 Index Ethernet address, 1-Wire communication, 100 address, slush command shell, 36 controller, 4, 6 converter, 74–80 runtime environment support of, 18 SerialToEthernet program, 74–80, 231 TCP/IP (Transmission Control Protocol/ Internet Protocol) network, 113–115 EthernetAddressReader program, 100–102 Event listeners, 63–67 Events, 142–145 Exceptions ArrayIndexOutOfBounds exception, 131 CanBusException class, 261–262 CommitException class, 120, 264 DataLinkException class, 164, 169, 171–172, 175 ExternalInterruptException class, 221, 273 HTTPServerException class, 128, 275 IllegalAddressException class, 187, 203–204, 276 IllegalArgumentException class, 189 IOException class, 152 NoSuchPortException class, 71 OneWireException class, 89, 96, 318 OneWireIOException class, 97–99, 110, 318–319 PortInU See xception class, 58, 71 PPPException class, 328 UnknownHostException class, 126–127 UnsupportedCommOperationException class, 59, 61–62, 71 excludeFamily() method, 95 Executable files in file system, 17 Execution error detection. See Watchdog exit command, 37 Expanded I/O capabilities, debugging, 49 External adapters, 91 External device interface to bus, 182 External interrupt, 219–224 addEventListener() method, 221–222 common interrupt source sharing, 224 defined, 209 edge triggering, 220–221 ExternalInterrupt class, 221, 273 externalInterruptEvent() method, 221–223 ExternalInterruptEventListener interface, 221, 223 ExternalInterruptException class, 221, 273 falling edge, 220, 222 getTrigger() method, 221 Interrupt Service Routine (ISR), 15, 220 interrupts versus polling, 219–220 latched interrupts, 220 level triggering, 220–221 “low true” pin interrupt, 220 notification of interrupts, 221–224 ordering of event listeners, 224 polling versus interrupts, 219–220 “power fail” interrupt, 220 priority levels, 220 PushButton program, 222–224 receiving notification of interrupts, 221–224 removeEventListener() method, 221–222 setTrigger() method, 221 sharing a common interrupt source, 224 triggering, 220–221 See also Ports and port pins External memory, reading/writing, 196–198 External pins, 202–206 External reset, 19–20 External serial ports configuration, 67–69 ExternalInterrupt class, 221, 273 ExternalInterruptEvent class, 273 externalInterruptEvent() method, 221–223 ExternalInterruptEventListener class, 273 ExternalInterruptEventListener interface, 221, 223 ExternalInterruptException class, 221, 273 F Falling edge, 220, 222 Family Census program, 94–95 Family code part of address, 86 FastCensus program, 99–100 Faster loop, 241–242, 244 feedWatchdog() method, 216–217 FIFO (First In First Out), 187–188, 193 Index 349 File system exploration using slush command shell, 33–35 integrity check, 20 manager, 17 File Transfer Protocol (FTP), 112–113 FindAdapters program, 89 FindContainers program, 103–104 findFirstDevice() method, 99–100 findNextDevice() method, 99 Finite State Machine (FSM), 162–164 First In First Out (FIFO), 187–188, 193 Flash ROM memory, 4–5, 249–250 Floating point calculations, 245 Flow control (hardware handshake), 53, 59–63, 68, 80 flush() method, 232 for loop, 240 Forced heap initialization, 251–252 Foreground processes, 73 Forward lookups, 124, 126 freeMemory() method, 235 FSM (Finite State Machine), 162–164 FTP (File Transfer Protocol), 112–113 FTPServer class, 274 FTPSession class, 274 Full-duplex throughput, 229 G Garbage collector (gc) process, 16–17, 20–21, 234, 237 Gateway (router) address setting, 38, 117, 123 gc (garbage collector) process, 16–17, 20–21, 234, 237 Gender changer, 55 General purpose I/O, 200–201 getAddressAsString() method, 93 getAllByName() method, 127 getAllOneWireDevices() method, 92 getAvailableTableIDs() method, 211 getBlock() method, 101 getBootState() method, 120, 251 getByIP() method, 126 getByName() method, 125–126 getByte() method, 97–98 getCommPortIdentifier() method, 71 getDefaultAdapter() method, 90 getEthernetAddress() method, 115 getEventType() method, 64, 72, 140 getFIFOMode() method, 188 getFirstDeviceContainer() method, 103, 107 getFlowControlMode() method, 60 getFreeRAM() method, 235–236 getInputBufferSize() method, 62 getInputStream() method, 61, 158, 228 getIPAddress() methods, 118 getLastError() method, 144 getLong() method, 247 getNetworkCommitState() method, 119 getNewValue() method, 65 getNextDeviceContainer() method, 103 GetOpt class, 274 getOutputStream() method, 61, 71, 151, 228 getPeerID() method, 143 getPeerPassword() method, 143 getPort() method, 166–167 getPortIdentifier() method, 56 getRTC() method, 210 getSensorRH() method, 107 getStretchCycles() method, 189 getTimeZone() method, 211 getTrigger() method, 221 getTrueRH() method, 107 GMT (Greenwich Mean Time), 211 H “Hard” reset countdown, 215 “Hard-wired” devices, 108 Hardening applications. See Application hardening Hardware, 3–9, 23–26 asynchronous serial protocol support, 8 battery-back circuitry, 5–6 capacitive loading, 6 code segment of memory map, 5–7, 18–19 configuration, 1-Wire, 82 controller area network (CAN) support, 8, 260–262 data segment of memory map, 5–7, 16 DS80C390 microcontroller, 4 350 Index E10 socket, 25–26, 53 electrically erasable programmable read only memory (EEPROM), 4, 249 Ethernet controller, 4, 6 flash ROM memory, 4–5, 249–250 hardware reference design, 8–9 integrated I/O, 7–8 Java methods and the real-time clock, 4 large-scale integration (LSI) chips, 3–5 lithium cell for clock, 5 memory map, 5–7, 184–185, 191 microcontroller, 4–5, 7 nonvolatized static RAM (NVSRAM), 4–5, 17 parallel I/O expansion, 4–7 peripheral chip enable (PCE) space, 7, 183–185, 194–195 peripheral devices, 4–7 peripheral segment of memory map, 5–7 reference implementation of TBM390, 9 serial communication support, 7–8 static RAM (SRAM) memory, 4–5, 249 synchronous serial protocol support, 8 TINI Board Model 390 (TBM390), 9, 24 TTL I/O support, 8, 189–196 Universal Asynchronous Receiver Trans- mitter (UART), 8, 52, 67 watchdog, 216 See also 1-Wire network; Parallel I/O; Ports and port pins; RTC (Real-time clock); Serial communication applica- tions Hardware handshake (flow control), 53, 59–63, 68, 80 Heap initialization, forced, 251–252 runtime environment, 16–17, 20, 30–31 sizes, 233 HelloWeb program, 45–48 HelloWorld program, 39–42 help command, 35–36 Host name, 118 Hosts for debugging, 48 HTTP (HyperText Transfer Protocol), 127–130 application layer protocol, 112–113 com.dalsemi.tininet.http package, 127, 274–275 HTTPServer class, 45, 48, 127–128, 274–275 HTTPServerException class, 128, 275 MiniBrowser program, 129–130 proxy port/server setting, 118, 128–130 ServerSocket object, 128 serviceRequests() method, 128 setHTTPRoot() method, 128 setIndexPage() method, 128 SetProxyServer() method, 129 URL and, 128–130 Web root, 128 See also TCP/IP (Transmission Control Protocol/Internet Protocol) network HTTPServer class, 45, 48, 127–128, 274–275 HTTPServerException class, 128, 275 Human interfaces and TINI, 3 HumidityLogger class, 149, 156–157 HumiditySample class, 155–156 HumiditySensor class, 152, 157 HumiditySensor program, 104–108 “Hung” code, 215–216 HyperText Transfer Protocol. See HTTP I I/O efficiency, 227–232 Blinky program, 42–45 block data transfer versus byte-banging, 227–232 buffered streams, 232 byte-banging, 152, 207, 227–232 DataLogger class, 149–152, 175–176, 232 echo client/server program, 230–232 EchoWorker program, 228–229 flush() method, 232 full-duplex throughput, 229 getInputStream() method, 228 getOutputStream() method, 228 InputStream object, 228, 231 MemoryTester program, 196–198, 231 method invocations, expense of, 230–232 Index 351 OutputStream, 228, 231 read() method, 227–228, 230 SerialToEthernet program, 74–80, 231 SocketInputStream, 228, 230 SocketOutputStream, 228–230 throughput of server, 229 TiniTerm program, 69–73, 231 write() method, 227–229, 232 See also Application programming opti- mization I/O management subsystem, 11, 15, 17–18 I2CPort class, 276 iButtons, 88 ICMP (Internet Control Message Protocol), 130–137 ArrayIndexOutOfBounds exception, 131 com.dalsemi.tininet.icmp package, 325 ECHO_REPLY message, 136 error and control information, 130 ICMP data, 132 ICMP header, 132–134 IP data area, 132 IP header, 132–133, 136 message within an IP datagram, 131–132 module, 112–113, 130 Ping (ICMP echo request/reply), 37–38, 112–113, 116, 125 Pinger program, 134–137 pingNode() method, 130–131, 136 PORT_UNREACHABLE message, 134 round-trip time (RTT), 131 TIME_EXCEEDED message, 133–134, 136 TTL field, 133–134, 136 TYPE byte, 132–133 See also TCP/IP (Transmission Control Protocol/Internet Protocol) network IEEE (Institute of Electrical and Electronics Engineers), 114 IllegalAddressException class, 187, 203– 204, 276 IllegalArgumentException class, 189 Immutable strings and loop optimization, 240–241 index.html file, 46, 48 indexOf() method, 242–243 Industrial controls applications, 2 InetAddress class, 124–126 Initialization phase of transaction, 84 initializeLink() method, 164, 166–167, 169, 171–172 Initializing runtime environment, 20–21, 29–31 InputStream object, 61–62, 228, 231 Instance fields, RTC, 210 Instances of containers, creating, 102–104 int primitive type, 245 intDump() method, 236 Integer operations, 245 Integrated I/O, 7–8 Integrity checks, 20 Inter-Process Communication (IPC), 16, 117 Internal adapters, 90–91 Internal serial ports configurations, 67–68 Internet Control Message Protocol. See ICMP Interrupt Service Routine (ISR), 15, 220 Interrupts versus polling, 219–220. See also External interrupt IOException class, 152 IP address DHCP (Dynamic Host Configuration Pro- tocol), 118, 123 DNS (Domain Name System) mapping, 123–125 gateway (router), 38, 117, 123 “leased,” 121–123 network parameters, setting, 117, 119 slush command shell for setting, 37 IP data/header area, ICMP, 132 IP datagram transmissions, 116 IPC (Inter-Process Communication), 16, 117 ipconfig (network configuration) command communication (1-Wire), 100, 102 DHCP (Dynamic Host Configuration Pro- tocol), 122 network parameters, setting, 117, 120– 121 PPP (Point-to-Point Protocol144 remote data logger, 178 slush command shell, 36–39 TCP/IP (Transmission Control Protocol/ Internet Protocol) network, 113–114, 117, 120–122 352 Index ipError() method, 124 ipLeased() method, 124 ipLost() method, 124 ipRenewed() method, 124 isEqual() method, 243 ISR (Interrupt Service Routine), 15, 220 isValidUser() method, 160, 164, 175–176 J java command, 35 Java Communications API (comm API), 56–67 addEventListener() method, 63 available() method, 64 buffer sizes, 62 com.dalsemi.comm package, 12, 56, 260–262, 266, 277, 279, 328–329 core packages, 11–12 CTSMonitor program, 65–67 DATA_AVAILABLE event, 64–65, 72 defined, 27, 56 disableReceiveThreshold() method, 62 disableReceiveTimeout() method, 61 enableReceiveThreshold() method, 62 enableReceiveTimeout() method, 61–62 event listeners, 63–67 flow control, 58–63 getEventType() method, 64 getFlowControlMode() method, 60 getInputBufferSize() method, 62 getInputStream() method, 61 getNewValue() method, 65 getOutputStream() method, 61 InputStream object, 61–62 javax.comm package, 56 notifyOn() method, 63–64 OUTPUT_BUFFER_EMPTY event, 64–65 OutputStream object, 61 receive time-outs and thresholds, 61–62, 65 receiving serial data, 61–63 removeEventListener() method, 63 RTS/CTS (hardware flow control), 59–61, 63, 68, 168 sending serial data, 61–63 serial port events, 63–67 serialEvent() method, 64 SerialPortEvent object, 64–65, 72 SerialPortEventListener interface, 64, 170 setDTR() method, 63 setFlowControlMode() method, 60–61 setInputBufferSize() method, 62 setRTS() method, 63 UnsupportedCommOperationException class, 59, 61–62 XON/XOFF (software flow control), 59–60, 68, 141 See also Configuring serial ports; Parallel I/O; Serial communication applica- tions Java Developer’s Kit (JDK), 10, 27 Java Native Interface (JNI), 14 Java Virtual Machine (JVM), 10, 13–14, 17 java.io.IOException class, 76, 214 JavaKit launching, 29–30 java.lang.System class, 246 java.util package, 209, 211 java.util.Date class, 209–214 java.util.Hashtable, 125 javax.comm package, 56 JDK (Java Developer’s Kit), 10, 27 JNI (Java Native Interface), 14 JVM (Java Virtual Machine), 10, 13–14, 17 K Kernel processes, 18 kill command, 44–45 “Knocking back,” 216, 219 L LANs (Local Area Networks), 114 Large-scale integration (LSI) chips, 3–5 Latched interrupts, 220 LCDOutputStream class, 277 LCDPort class, 277 LCP (Line Control Protocol), 142, 164 “Leased” IP addresses, 121–123 length() method, 240 Level translators, 52 Level triggering, 220–221 Limitations, 14 Index 353 Line Control Protocol (LCP), 142, 164 Link errors, 167, 169–175 Linux, 26–27 List (ls) command, 33 Listeners Java Communications API, 63–67 Point-to-Point Protocol (PPP) network, 140 Lithium cell for clock, 5 Loading converted image, applications program- ming, 41–42 runtime environment, 29–31 loadlibrary method, 14 Local Area Networks (LANs), 114 Locking adapters, 96 Log file, 45, 48 Logging on, 32–33 LoggingDaemon class, 153–154, 157–158 Login (authentication) information, 140 Lookup (nslookup) command, 126 Lookups, 124–126 Loop optimization, 239–244 array comparison, 243 arraylenth opcode, 244 Bogus class, 239–240 caching instance fields in local variables, 243–244 caching length in a local variable, 240–241 charAt() method, 241 charCounter() method, 239–240, 242 directly accessing character data, 241 faster loop, 241–242, 244 for loop, 240 immutable strings and, 240–241 indexOf() method, 242–243 isEqual() method, 243 length() method, 240 opcodes, 241 unrolling loops, 242–243 See also Application programming opti- mization Loopback interface, 113–114, 116–117 “Low true” pin interrupt, 220 ls (list) command, 33 LSI (large-scale integration) chips, 3–5 M MAC id, 114 Mailhost IP address, 118, 123 main() method, 149–150, 176 Malloc (memory allocation operation), 233 MARK (binary one) bit, 52–53 Masters, 1-Wire adapters, 88 Measuring elapsed time program, 226–227 Memory access modes, DataPort class, 187–188 blocks, 16 constrained environment, remote data logger, 153 management subsystem, 7, 11, 15–17 map, 5–7, 184–185, 191 technology and application hardening, 249–250 See also Memory usage Memory allocation operation (malloc), 233 Memory usage, 233–237 + operator, 234 append() method, 234 displayRAM() method, 236 freeMemory() method, 235 garbage collector (gc) process, 16–17, 20–21, 234, 237 getFreeRAM() method, 235–236 heap sizes, 233 intDump() method, 236 malloc (memory allocation operation), 233 MemReporter program, 235–236 multi-thread/multi-process systems and, 234 new operator, 233 object creation and, 233 PrintStream, 236 profiling memory usage, 234–236 StringBuffers, 233–234, 236 TCP process and, 234 See also Application programming opti- mization MemoryBank class, 277–278 MemoryTester program, 196–198, 231 MemReporter program, 235–236 Message within an IP datagram, 131–132 Method invocations, expense of, 230–232 354 Index Microcontrollers, 4–5, 7. See also Ports and port pins MiniBrowser program, 129–130 Modem control, 167, 169–175 ModemCommand class, 170–173 Module, ICMP, 112–113, 130 Multi-thread/multi-process systems memory usage and, 234 slush command shell, 32 Multiple threads/processes and adapters, 95– 96 Mutual exclusion, 95–96 N Native code, 184, 207 Native method interface (TNI), 11, 14 Native methods, 10–11, 14 Network I/O, 11, 17–18 Network parameters, setting, 117–124 com.dalsemi.tininet package, 12, 112, 117, 336–338 CommitException class, 120, 264 commitNetworkState() method, 119–120 committing static network parameters, 119–121 disableNetworkRestore() method, 120 domain name, 117 Domain Name System (DNS) time-out value, 117 gateway (router) IP address, 38, 117, 123 getBootState() method, 120 getIPAddress() methods, 118 getNetworkCommitState() method, 119 host name, 118 HTTP proxy port/server, 118, 128–130 IP address, 117, 119 ipconfig (network configuration) com- mand, 117, 120–121 loopback interface, 113–114, 116–117 mailhost IP address, 118, 123 NETWORK_CONFIGURATION_REST ORED mask, 120 primary DNS address, 117 secondary DNS address, 117 setIPAddress() methods, 118 slush command shell for configuring, 36–39 subnet mask, 37, 117, 119, 123 TININet class, 112, 117–118, 336–338 TINIOS class, 120, 338–340 See also DHCP (Dynamic Host Configu- ration Protocol); DNS (Domain Name System); HTTP (HyperText Transfer Protocol); ICMP (Internet Control Message Protocol); Java Communica- tions API (comm API); 1-Wire net- work; PPP (Point-to-Point Protocol) network; Serial communication appli- cations; TCP/IP (Transmission Con- trol Protocol/Internet Protocol) network Network server creation, 148–152 Network time server, 212–214 NETWORK_CONFIGURATION_RESTOR ED mask, 120 NetworkMonitor class, 278 NetworkMonitorEvent class, 278–279 NetworkMonitorEventListener class, 279 new operator, 233 newInstance() method, 103 Non-network I/O, 11, 17–18 Nonvolatized static RAM, 4–5, 17 NoSuchPortException class, 71 Notification of interrupts, 221–224 notifyOn() method, 63–64 nslookup (lookup) command, 126 Null modems, 54–55, 73 NullInputStream class, 279 NullOutputStream class, 279 Numbers and names of ports, 200–201 O Object creation and memory usage, 233 finalization/serialization, 12–13 1-Wire network, 81–110 address discovery process, 84, 86–88 addressing phase of transaction, 84 broadcast (skip address) command, 88 chips, 88 com.dalsemi.onewire.utils package, 108, 258–259, 265, 278–279, 319, 321–324 compute() methods, 108–109 CRCCalculator program, 109–110 Index 355 Cyclic Redundancy Check (CRC) part of address, 86, 108–110 data exchange phase of transaction, 84 data integrity, 108–110 debugging, 48 device discovery (address search), 86–87 device id part of address, 86 device selection (address match), 86–88 DS18S20 temperature sensor example, 85, 102 family code part of address, 86 “hard-wired” devices, 108 hardware configuration, 82 iButtons, 88 initialization phase of transaction, 84 OneWireIOException class, 97–99, 110, 318–319 open drain driven, 83 overdrive speed, 83 read data time slot, 83 regular speed, 83 reset sequence signal, 83 roaming devices, 98, 108 “selected” device, 84 signaling (waveforms), 82–84 temperature conversion example, 85 time slots, 83–84 transactions, 84–85 write 0 time slot, 83–84 write 1 time slot, 83–84 See also Adapters (1-Wire); Communica- tion (1-Wire); Containers (1-Wire); Remote data logger OneWireAccessProvider class, 89, 279–280 OneWireContainer classes, 92–93, 102–104, 280–318 OneWireException class, 89, 96, 318 OneWireIOException class, 97–99, 110, 318–319 OneWireMonitor class, 319 OneWireMonitorEvent class, 319 OneWireMonitorEventListener class, 319 OneWireSensor class, 320 Opcodes, 241 Open drain driven devices, 83 open() method Java Communications API (comm API), 58 PPP (Point-to-Point Protocol) daemon, 162 PPP (Point-to-Point Protocol) network, 142–143 OpenSource Project RXTX, 27 Opening a serial port, 29 Operating systems, 11, 15–18, 26 Optimization. See Application programming optimization Ordering of event listeners, 224 Organizationally Unique Identifier (OUI), 114–115 OTPMemoryBank class, 320 OUI (Organizationally Unique Identifier), 114–115 OutOfMemoryError, 153 OUTPUT_BUFFER_EMPTY event, 64–65 OutputStream object, 61, 228, 231 Overdrive speed, 1-Wire, 83 Overhead of containers, 96 OWFile class, 321–322 OWFileDescriptor class, 322 OWFileInputStream class, 322 OWFileOutputStream class, 323 Ownership adapters, 95–96 communications ports, 58 OWPath class, 323 OWPathElement class, 324 P PagedMemoryBank class, 324–325 PAP (Password Authentication Protocol), 140, 176 Parallel bus, 7, 182–185 Parallel I/O, 181–198 additional TTL I/O, 8, 189–196 address bus, 183 block move operations, 184 buffers, 182 chip enables (CEs), 183–186, 190 control signals, 183 data bus, 183 address decoder chips, 190–192 defined, 181 device reset (DRST), 184 don’t care bits, 192, 195 356 Index examples, 189–198 expansion, 4–7 external device interface to bus, 182 external memory, reading/writing, 196– 198 memory map, 5–7, 184–185, 191 MemoryTester program, 196–198, 231 native code, 184 parallel bus, 7, 182–185 ParallelLoopBack program, 192–193 peripheral chip enables (PCEs), 7, 183–185, 194–195 ports and port pins, 185, 198 program store enable (PSEN), 184 read strobe (RD), 184 reading/writing external memory, 196–198 speed of data transfer, 187 swapping overhead, 184 TTL I/O, additional, 8, 189–196 write strobe (WR), 184 See also DataPort class ParallelLoopBack program, 192–193 Parity checking, 58 Passive mode, 142 Password Authentication Protocol (PAP), 140, 176 Passwords, 32, 34, 37 PCEs (peripheral chip enables), 7, 183–185, 194–195 Performance ports, 207–208 profiling, 225–227 See also Application programming opti- mization Peripheral chip enables (PCEs), 7, 183–185, 194–195 Peripheral devices, 4–7 Persistence storage, 249 Ping class, 325 Ping (ICMP echo request/reply), 37–38, 112–113, 116, 125 Pinger program, 134–137 pingNode() method, 130–131, 136 Pinout, 53–54 Point-to-Point Protocol. See PPP Polling versus interrupts, 219–220 POR (power-on reset), 19 Port adapters, 95–96. See also Adapters (1-Wire) PortInUSee xception class, 58, 71 PortLister class, 57 Ports and port pins, 199–208 application programming and, 43 BitPort class, 43, 201–203, 207, 259–260 bitpos parameter, 203 BitTwiddler program, 204–206 Blinky program, 42–45, 200 byte-banging, 152, 207, 227–232 BytePort class, 206–208, 260 clear() method, 201–203 com.dalsemi.system package, 201, 206 creating additional outputs example, 204–206 defined, 7 external pins, 202–206 general purpose I/O, 200–201 IllegalAddressException class, 187, 203–204, 276 native code, 207 numbers and names of, 200–201 parallel I/O and, 185, 198 performance, 207–208 read() method, 207 readBit() method, 203 readLatch() method, 202–204 set() method, 201–203, 207 synthetic port pins, 202–206 write() method, 207 See also DataPort class; External inter- rupt; Parallel I/O PORT_UNREACHABLE message, 134 PotentiometerContainer class, 325–326 “Power fail” interrupt, 220 Power-on reset (POR), 19 PPP class, 140, 161–162, 326–327 PPP (Point-to-Point Protocol) daemon, 160–166 adding to remote data logger, 175–176 addInterface() method, 164 AUTHENTICATION_REQUESTED event, 140, 143, 164 class, 140, 161–162, 326–327 CLOSED event, 144–145, 164, 167 Index 357 daemonError interface, 160, 175 DataLinkException class, 164, 169, 171– 172, 175 DataLinkListener interface, 160 Finite State Machine (FSM), 162–164 initializeLink() method, 164 isValidUser() method, 160, 164, 175–176 Line Control Protocol (LCP), 142, 164 open() method, 162 PPPDataLink interface, 162, 166 pppEvent program, 164–166 PPPEventListener interface, 140, 160, 162, 175 PPPModemLink class, 161–162, 169–170 PPPSerialLink class, 161–162, 167–169 startDaemon() method, 162–163 STARTING event, 143, 162, 164 STOPPED event, 141–144, 164 UP event, 144–145, 164–165 See also PPP (Point-to-Point Protocol) data link; PPP (Point-to-Point Proto- col) network; Remote data logger PPP (Point-to-Point Protocol) data link, 166–176 Carrier Detect (CD) signal, 170 CLOSED event, 144–145, 164, 167 currentTimeMillis() method, 174 dataLinkError() method, 167, 170 DataLinkException class, 164, 169, 171–172, 175 DataLinkListener interface, 167 getPort() method, 166–167 initializeLink() method, 166–167, 169, 171–172 link errors, 167, 169–175 modem control, 167, 169–175 ModemCommand class, 170–173 PPPDataLink interface, 162, 166 PPPModemLink class, 161–162, 169–170 PPPSerialLink class, 161–162, 167–169 receiveMatch() method, 172 resetModem() method, 171–172 RTS/CTS (hardware flow control), 59–61, 63, 68, 168 sendCommand() method, 171–172 serial link, 167–169 serialEvent() method, 170 SerialPortEventListener interface, 64, 170 waitForMatch() method, 174–175 See also PPP (Point-to-Point Protocol) daemon; PPP (Point-to-Point Proto- col) network; Remote data logger PPP (Point-to-Point Protocol) network, 139–145 addEventListener() method, 140 addInterface() method, 144 ADDR error, 144 API classes, 139–142 application layer protocol, 113–116 asynchronous control character map (ACCM), 141 AUTH error, 144 authenticating peer node, 140–141 AUTHENTICATION_REQUESTED event, 140, 143, 164 CLOSED event, 144–145, 164, 167 com.dalsemi.tininet.ppp package, 139, 326–328 down() method, 145 events, 142–145 getEventType() method, 140 getLastError() method, 144 getPeerID() method, 143 getPeerPassword() method, 143 IP datagram transportation, 139 ipconfig (network configuration) com- mand, 144 Line Control Protocol (LCP), 142, 164 listeners, 140 login (authentication) information, 140 NONE error, 144 open() method, 142–143 passive mode, 142 Password Authentication Protocol (PAP), 140, 176 PPP class, 140 PPPEvent class, 144 PPPEvent interface, 142–143 pppEvent() method, 140 PPPEventListener interface, 140, 160, 162, 175 358 Index REJECT error, 144 removeEventListener() method, 140 removeInterface() method, 145 runtime environment support of, 18 setACCM() method, 141 setAuthenticate() method, 140 setLocalAddress() method, 141 setPassive() method, 142 setPassword() method, 140 setRemoteAddress() method, 141 setUsername() method, 140 setXonXoffEscape() method, 141 STARTING event, 143, 162, 164 STOPPED event, 141–144, 164 TIME error, 144 UP event, 144–145, 164–165 up() method, 143 XON/XOFF (software flow control), 59– 60, 68, 141 See also PPP (Point-to-Point Protocol) daemon; PPP (Point-to-Point Proto- col) data link; Remote data logger PPPDataLink interface, 162, 166 PPPEvent interface, 142–143 pppEvent() method, 140 pppEvent program, 164–166 PPPEventListener class, 328 PPPEventListener interface, 140, 160, 162, 175 PPPException class, 328 PPPModemLink class, 161–162, 169–170 PPPSerialLink class, 161–162, 167–169 Primary Domain Name System (DNS) address, 117 JAVA application, 18–19, 21–22 Printstream, 236 Priority levels, external interrupt, 220 Process (ps) command, 44–45, 47 Process schedulers, 11, 15–16 Profiling code, 225–227 memory usage, 234–236 Program store enable (PSEN), 184 Progress messages, 69 Protocol conversion (link) applications, 2–3 Proxy port/server setting, 118, 128–130 ps (process) command, 44–45, 47 PSEN (program store enable), 184 Public methods, 126 PushButton program, 222–224 putByte() method, 97–98 Q Quick operations, measuring, 227 R RamdomAccessFile, 153 RD (read strobe), 184 RD (Receive Data) signal, 53–54 Read data time slot, 83 read() method DataPort class, 186–188, 198 I/O efficiency, 227–228, 230 ports and port pins, 207 serial communication applications, 72, 77–78 Read strobe (RD), 184 readBit() method, 203 ReadClockRaw program, 210–211 Reading/writing external memory, 196–198 readInt() method, 214 readLatch() method, 202–204 readLong() method, 214 README.txt file, 28 Real-time clock. See RTC reboot() method versus, 219 Receive Data (RD) signal, 53–54 Receive time-outs and thresholds, 61–62, 65 receiveMatch() method, 172 Receivers, 52–53 Receiving notification of interrupts, 221–224 serial data, 61–63 Reference implementation of TINI (TBM390), 9 Reflection (omitted), 12 Register set, 210 Regular speed, 1-Wire, 83 REJECT error, 144 Remote data logger, 147–180 accept() method, 152 Index 359 adding Point-to-Point Protocol (PPP) to, 175–176 addInterface() method, 179 BufferedOutputStream, 151–152 byte-banging, 152, 207, 227–232 captureSample() method, 154–157 collecting data, 152–158 constructor, 154 currentTimeMillis() method, 156 data collection, 152–158 DataInputStream, 158 DataLogger class, 149–152, 175–176, 232 DataLoggerClient class, 158–160, 177 DataOutputStream, 151–152, 158 debug statements, 178 getInputStream() method, 158 getOutputStream() method, 151 HumidityLogger class, 149, 156–157 HumiditySample class, 155–156 HumiditySensor class, 152, 157 IOException class, 152 LoggingDaemon class, 153–154, 157–158 main() method, 149–150, 176 memory constrained environment of, 153 network server creation, 148–152 OutOfMemoryError, 153 overview, 147–148 RamdomAccessFile, 153 removeInterface() method, 179 run() method, 150–151, 154–155 sample client for testing, 158–160 ServerSocket object, 150–151 SocketOutputStream, 151–152 start() method, 150 storage of data samples, 153 testing application, 176–180 testing sample, 158–160 toString() method, 159 writeDouble() method, 158 writeLog() method, 152 writeLogEntry() method, 154–156, 158 writeLong() method, 158 See also 1-Wire network; PPP (Point-to- Point Protocol) daemon; PPP (Point- to-Point Protocol) data link; PPP (Point-to-Point Protocol) network; Serial communication applications; TCP/IP (Transmission Control Proto- col/Internet Protocol) network removeEventListener() method, 63, 140, 221–222 removeInterface() method, 145, 179 removeInterfaceEntry() method, 114 Request To Send (RTS) signal, 54, 60, 63, 67 reset() method, 97–98 Reset sequence signal, 83 resetDefaultStreams() method, 250 resetModem() method, 171–172 Resets, 19 Resetting watchdog, 215–219 Resolver, 124 ResponseADPU class, 328 Reverse lookups, 124, 126 RFC868 (Time Protocol) server, 212–213 RI (Ring Indicator) signal, 54, 65 Roaming devices, 98, 108 “Rolled back” transactions, 20 Root account, 32, 37 Round-trip time (RTT), 131 Router (gateway) address setting, 38, 117, 123 RS-232-C standard, 51–52 RS232 serial port, 26 RTC (real-time clock), 209–214 Clock class, 210, 262–263 com.dalsemi.system package, 210–211 coordinated universal time (UTC), 212 Date class, 209–211 date command, 211–212, 214 default (local) time zone, 211 defined, 4–6, 209 getAvailableTableIDs() method, 211 getRTC() method, 210 getTimeZone() method, 211 Greenwich Mean Time (GMT), 211 instance fields, 210 java.util package, 209, 211 java.util.Date class, 209–214 millis parameter, 212 network time server, 212–214 ReadClockRaw program, 210–211 readInt() method, 214 360 Index readLong() method, 214 register set, 210 SetClock program, 213–214 setRTC() method, 212 setTickCount() method, 212–214 setTimeZone() method, 211 setting date and time, 212 Time Protocol (RFC868) server, 212–213 “well-known port,” 212 RTS/CTS (hardware flow control), 59–61, 63, 68, 168 RTS (Request To Send) signal, 54, 60, 63, 67 RTT (round-trip time), 131 run() method I/O efficiency, 228–232 Remote data logger, 150–151, 154–155 serial communication applications, 72, 76–77 “Runaway” code, 215 Running converted image, 42 Runtime binaries loading, 29–30 Runtime environment, 10–22 API portion of, 10–13 bootstrap loader, 18–20, 29, 31, 251 class loading, 13–14 classes specific to TINI, 10 com.dalsemi packages, 12, 255–340 command shell application, 16 convertor utility (TINIConvertor), 13 core Java packages, 11–12 creation of initial processes, 20 device driver initialization, 20 Ethernet support, 18 executable files in file system, 17 external reset, 19–20 file system integrity check, 20 file system manager, 17 garbage collector (gc) process, 16–17, 20–21, 234, 237 heap, 16–17, 20, 30–31 I/O management subsystem, 11, 15, 17–18 initializing runtime environment, 20–21, 29–31 integrity checks, 20 Inter-Process Communication (IPC), 16, 117 Interrupt Service Routine (ISR), 15, 220 Java core packages, 11–12 Java Developer’s Kit (JDK), 10, 27 Java Native Interface (JNI), 14 Java Virtual Machine (JVM), 10, 13–14, 17 JavaKit launching, 29–30 kernel processes, 18 limitations, 14 loading the runtime environment, 29–31 loadlibrary method, 14 memory blocks, 16 memory management subsystem, 7, 11, 15–17 native method interface (TNI), 11, 14 native methods, 10–11, 14 network I/O, 11, 17–18 non-network I/O, 11, 17–18 object finalization (omitted functionality), 13 object serialization (omitted functional- ity), 12 opening a serial port, 29 operating systems, 11, 15–18, 26 Point-to-Point Protocol (PPP) support, 18 power-on reset (POR), 19 primary JAVA application, 18–19, 21–22 process schedulers, 11, 15–16 public static void main() method, 10 reflection (omitted), 12 resets, 19 “rolled back” transactions, 20 runtime binaries loading, 29–30 “sandbox” restrictions, 10 schedulers, 11, 15–16 serial port opening, 29 slush command shell and, 22 sweeper, 20–21 synchronization, 16 tagging memory, 17 thread execution limits, 14 thread schedulers, 11, 15–16 Transmission Control Protocol/Internet Protocol (TCP/IP) stack, 11, 18 See also Application programming; Application programming optimiza- tion; External interrupt; Hardware; Index 361 1-Wire network; Parallel I/O; Ports and port pins; PPP (Point-to-Point Protocol) network; Remote data log- ger; RTC (Real-time clock); Serial communication applications; Slush command shell; TCP/IP (Transmission Control Protocol/Internet Protocol) network; TINI (Tiny InterNet Inter- face) platform; Watchdog RXTX Open Source Project, 27 S Sample client for testing, 158–160 “Sandbox” restrictions, 10 Schedulers, 11, 15–16 SDK (Software Development Kit), 27–28 Searching for 1-Wire devices, 92–95 Secondary DNS address, 117 Secure Hash Algorithm (SHAI), 34 Security class, 328 “Selected” device, 84 sendCommand() method, 171–172 Sending serial data, 61–63 Sequential memory mode, 188 Serial communication applications, 51–80 BlackBox program, 54, 67, 73, 80 buffer sizes, 79–80 Carrier Detect (CD) signal, 53, 65, 67 Clear To Send (CTS) signal, 54, 60, 65, 67 collisions, 54 Common (Signal Ground) signal, 54 CommPort object, 71 contention, 54 Data Communications Equipment (DCE) serial port, 52–53 data rates supported, 68 Data Set Ready (DSR) signal, 54, 65 Data Terminal Equipment (DTE) serial port, 52–54 Data Terminal Ready (DTR) signal, 53, 63 DATA_AVAILABLE event, 64–65, 72 debugging, 48 defaults, 53, 67–69 E10 socket, 25–26, 53 enableSerialPort1() method, 68 Ethernet converter, 74–80 external serial ports configuration, 67–69 flow control (hardware handshake), 53, 59–63, 68, 80 foreground processes, 73 gender changer, 55 getCommPortIdentifier() method, 71 getEventType() method, 72 getOutputStream() method, 71 hardware support of, 7–8 internal serial ports configurations, 67–68 level translators, 52 MARK (binary one) bit, 52–53 NoSuchPortException class, 71 null modems, 54–55, 73 pinout, 53–54 PortInUSee xception class, 71 progress messages, 69 read() method, 72, 77–78 Receive Data (RD) signal, 53–54 receivers, 52–53 Request To Send (RTS) signal, 54, 60, 63, 67 Ring Indicator (RI) signal, 54, 65 RS-232-C standard, 51–52 run() method, 72, 76–77 serial port events, 63–67 serial port opening, 29 serial ports, 56–59, 67–69 serialEvent program, 72–73 SerialPort object, 56, 58, 60–61, 64, 66, 71 SerialPortEvent object, 64–65, 72 SerialReader program, 76–78, 80 SerialToEthernet program, 74–80, 231 SerialWriter program, 76–79 setExternalSerialPortAddress() method, 69 setExternalSerialPortEnable() method, 68–69 setInputBufferSize() method, 79 setRawMode() method, 72 setRTSCTSFlowControlEnable() method, 68 signal ground, 52, 54 SPACE (binary zero) bit, 52–53 362 Index switching region, 52–53 System.in, 72–73 terminal example, 69–73 test configuration, 55 throughput, 79–80 TiniTerm program, 69–73, 231 Transistor Transistor Logic (TTL), 52 Transmit Data (TD) signal, 53–54 Universal Asynchronous Receiver Trans- mitter (UART), 8, 52, 67 UnsupportedCommOperationException class, 71 voltage levels, 52–53 See also Application programming; Java Communications API (comm API); Remote data logger Serial link, 167–169 Serial port events, 63–67 Serial port opening, 29 Serial ports, 56–59, 67–69 serial0 and slush, 69 serialEvent() method, 64, 170 serialEvent program, 72–73 SerialInputStream class, 328–329 SerialOutputStream class, 329 SerialPort object, 56, 58, 60–61, 64, 66, 71 SerialPortEvent object, 64–65, 72 SerialPortEventListener interface, 64, 170 SerialReader program, 76–78, 80 SerialServer class, 329 SerialSession class, 329 SerialToEthernet program, 74–80, 231 SerialWriter program, 76–79 Server class, 329–330 ServerSocket object, 128, 150–151 serviceRequests() method, 128 Session class, 330 set() method, 43, 201–203, 207 setACCM() method, 141 setAddress() method, 186–188 setAuthenticate() method, 140 SetClock program, 213–214 setDNSTimeout() method, 126 setDomainName() method, 125 setDTR() method, 63 setExternalSerialPortAddress() method, 69 setExternalSerialPortEnable() method, 68–69 setFIFOMode() method, 188, 196 setFlowControlMode() method, 60–61 setHTTPRoot() method, 128 setIndexPage() method, 128 setInputBufferSize() method, 62, 79 setIPAddress() methods, 118 setLocalAddress() method, 141 setLong() method, 247 setPassive() method, 142 setPassword() method, 140 SetProxyServer() method, 129 setRawMode() method, 72 setRemoteAddress() method, 141 setRTC() method, 212 setRTS() method, 63 setRTSCTSFlowControlEnable() method, 68 setSearchAllDevices() method, 95 setSearchOnlyAlarmingDevices() method, 95 setSerialPortParams() method, 58–59 setStretchCycles() method, 189 setTickCount() method, 212–214 setTimeZone() method, 211 Setting date and time, 212 setTrigger() method, 221 setupContainer() methods, 104 setUsername() method, 140 setWatchdogTimeout() method, 216 setXonXoffEscape() method, 141 SHA1 (Secure Hash Algorithm), 34 SHAiButton class, 330–332 Sharing a common interrupt source, 224 Shift operations, 245 Signal ground, 52, 54 Signaling (waveforms), 82–84 Simple Network Management Protocol (SNMP), 112 SimpleEthernetAddressReader program, 115 Skip address (broadcast) command, 88 Slush command shell, 31–39 cat command, 34, 48 cd (change directory) command, 33, 35 configuring the network, 36–39 date command, 211–212, 214 defaults, user accounts, 32 defined, 31–32 Domain Name Server (DNS) address set- ting, 38 Index 363 Dynamic Host Configuration Protocol (DHCP), 37 Ethernet address, 36 exit command, 37 file system exploration, 33–35 gateway (router) address setting, 38 help command, 35–36 IP address setting, 37 ipconfig (network configuration) com- mand, 36–39, 100, 102, 113–114, 117, 120–122, 144, 178 java command, 35 logging on, 32–33 ls (list) command, 33 memory usage, 234 multi-threaded, multi-user system, 32 network configuration, 36–39 nslookup (lookup) command, 126 passwords, 32, 34, 37 Ping (ICMP echo request/reply), 37–38, 116 primary Java application and, 22 root account, 32, 37 runtime environment and, 22 Secure Hash Algorithm (SHA1), 34 serial0 and, 69 slush.tbin file, 28–29 starting a new session, 32–33 subnet mask setting, 37 “super user,” 32 Telnet session, 37–39 testing network settings, 37–38 tini.passwd file, 34 tini.startup file, 34–35 user accounts defaults, 32 slush.tbin file, 28–29 SNMP (Simple Network Management Proto- col), 112 SocketInputStream, 228, 230 SocketOutputStream, 151–152, 228–230 Software. See Application programming Software and watchdog, 215–216 Software Development Kit (SDK), 27–28 Software flow control (XON/XOFF), 59–60, 68, 141 Solaris, 26–27 Source files creation, 39–40 SPACE (binary zero) bit, 52–53 Speed of data transfer, 187 SRAM (static RAM) memory, 4–5, 249 start() method, 123, 150 startDaemon() method, 162–163 Starting applications, 251–252 new session, 32–33 STARTING event, 143, 162, 164 Static RAM (SRAM) memory, 4–5, 249 Status reporting. See Remote data logger Stop bits, 58 stopDHCPThread() method, 123–124 STOPPED event, 141–144, 164 Storage of data samples, 153 Stretch cycles, 188–189 StringBuffers, 233–234, 236 Subnet mask, 37, 117, 119, 123 Sun Microsystems, 10, 27, 56 “Super user,” 32 Swapping overhead, 184 Sweeper, 20–21 SwitchContainer class, 332 Switching region, 52–53 Synchronization, 16 Synchronous serial protocol support, 8 Synthetic port pins, 202–206 System component of TBM390, 9 System resources. See External interrupt; RTC (Real-time clock); Watchdog System.in, 72–73 SystemInputStream class, 332–333 SystemPrintStream class, 333–334 T Tagging memory, 17 targetAllFamilies() method, 95 targetFamily() method, 94, 107 TBM390 (TINI Board Model 390), 9, 24 TCP/IP (Transmission Control Protocol/ Internet Protocol) network, 111–137 addInterfaceEntry() method, 114 com.dalsemi.shell.server.ftp package, 112, 274 com.dalsemi.shell.server.telnet package, 112, 334 com.dalsemi.tininet package, 12, 112, 117, 336–338 364 Index debugging applications, 48 Ethernet, 113–115 File Transfer Protocol (FTP), 112–113 getEthernetAddress() method, 115 Inter-Process Communication (IPC), 16, 117 IP datagram transmissions, 116 ipconfig (network configuration) com- mand, 113–114, 117, 120–122 Local Area Networks (LANs), 114 MAC id, 114 memory usage, 234 Organizationally Unique Identifier (OUI), 114–115 Ping (ICMP echo request/reply), 37–38, 112–113, 116, 125 removeInterfaceEntry() method, 114 Simple Network Management Protocol (SNMP), 112 SimpleEthernetAddressReader program, 115 stack, 11, 18 Telnet, 112–113 TININet class, 112, 117–118, 336–338 See also DNS (Domain Name System); DHCP (Dynamic Host Configuration Protocol); HTTP (HyperText Transfer Protocol); ICMP (Internet Control Message Protocol); Network parame- ters, setting; PPP (Point-to-Point Pro- tocol) network; Remote data logger TD (Transmit Data) signal, 53–54 Telnet session, 37–39, 112–113 TelnetServer class, 334 TelnetSession class, 334 Temperature conversion example, 85 TemperatureContainer class, 334–335 Terminal example, 69–73 Testing application programming, debugging, 48–49 network settings, 37–38 remote data logger application, 176–180 sample for remote data logger, 158–160 serial communication applications, 55 Thermocron iButton, 93 Thread execution limits, 14 Thread schedulers, 11, 15–16 Throughput, 79–80, 229 TIME error, 144 Time-out values, 216–217, 219 Time Protocol (RFC868) server, 212–213 Time slots, 83–84 TIME_EXCEEDED message, 133–134, 136 TINI Board Model 390 (TBM390), 9, 24 TINI (Tiny InterNet Interface) platform, 1–39 development platform requirements, 26–28 environmental monitors applications, 2 human interfaces, 3 industrial controls applications, 2 operating systems, 11, 15–18, 26 protocol conversion (link) applications, 2–3 README.txt file, 28 RS232 serial port, 26 slush.tbin file, 28–29 Software Development Kit (SDK), 27–28 tiniclasses.jar file, 28 tini.db file, 28 tini.jar file, 28 tini.tbin file, 28–29 Web-based equipment monitoring and control applications, 2 See also Application programming; Application programming optimiza- tion; External interrupt; Hardware; 1- Wire network; Parallel I/O; Ports and port pins; PPP (Point-to-Point Proto- col) network; Remote data logger; RTC (Real-time clock); Runtime envi- ronment; Serial communication appli- cations; Slush command shell; TCP/IP (Transmission Control Protocol/Inter- net Protocol) network; Watchdog tiniclasses.jar file, 28 TINIConvertor, 40–41 TINIConvertor (convertor utility), 13 tini.db file, 28 TINIExternalAdapter class, 89–90, 92, 335 TINIInternalAdapter class, 89, 92, 336 tini.jar file, 28 TININet class, 112, 117–118, 336–338 Index 365 TINIOS class, 120, 216, 219, 225, 251–252, 338–340 TINIShell class, 340 tini.startup file, 34–35 tini.tbin file, 28–29 TiniTerm program, 69–73, 231 Tiny InterNet Interface. See TINI Transactions and containers, 84–85 Transistor Transistor Logic (TTL), 52 Transmission Control Protocol/Internet Pro- tocol. See TCP/IP Transmit Data (TD) signal, 53–54 Triggering, 220–221 TTL field, ICMP, 133–134, 136 TTL I/O, 8, 189–196 TTL (Transistor Transistor Logic), 52 TYPE byte, ICMP, 132–133 U UART (Universal Asynchronous Receiver Transmitter), 8, 52, 67 UnknownHostException class, 126–127 Unrolling loops, 242–243 UnsupportedCommOperationException class, 59, 61–62, 71 UP event, 144–145, 164–165 up() method, 143 uptimeMillis() method, 225–226 URL and HTTP, 128–130 User accounts defaults, 32 UTC (coordinated universal time), 212 V Voltage levels, 52–53 W waitForMatch() method, 174–175 Watchdog, 215–219 com.dalsemi.system package, 216 defined, 209 feedWatchdog() method, 216–217 “hard” reset countdown, 215 hardware watchdog, 216 “hung” code, 215–216 “knocking back,” 216, 219 optimization for, 252 reboot() method versus, 219 resetting, 215–219 “runaway” code, 215 setWatchdogTimeout() method, 216 software problems, 215 software watchdog, 216 starting, 252 time-out values, 216–217, 219 TINIOS class, 216, 219, 338–340 Watchdog Timer program, 217–219 Waveforms (signaling), 82–84 Web-based equipment monitoring and con- trol applications, 2 Web root, 128 Web server example, 45–48 “Well-known port,” 212 Win32, 26–27 WR (write strobe), 184 Write 1 time slot, 83–84 write() method DataPort class, 186–188, 198 I/O efficiency, 227–229, 232 ports and port pins, 207 Write strobe (WR), 184 writeDouble() method, 158 writeLog() method, 152 writeLogEntry() method, 154–156, 158 writeLong() method, 158 X XON/XOFF (software flow control), 59–60, 68, 141

Các file đính kèm theo tài liệu này:

  • pdf12.pdf