#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
#include <sys/lnp.h>
#include <sys/lnp-logical.h>
#include "rcxtty.h"
#include "keepalive.h"
#include <lx.h>
#include <getopt.h>
Go to the source code of this file.
Defines | |
#define | MAX_DATA_CHUNK 0xf8 |
maximum data bytes/packet for boot protocol | |
#define | XMIT_RETRIES 5 |
number of packet transmit retries | |
#define | REPLY_TIMEOUT 750000 |
timeout for reply | |
#define | BYTE_TIME (1000*LNP_BYTE_TIME) |
time to transmit a byte. | |
#define | PROG_MIN 1 |
#define | PROG_MAX 8 |
#define | ADDR_MIN 0 |
#define | ADDR_MAX 15 |
#define | DEFAULT_DEST 0 |
#define | DEFAULT_PROGRAM PROG_MIN |
#define | DEFAULT_SRCPORT 0 |
#define | DEFAULT_PRIORITY 10 |
#define | HAVE_GETOPT_LONG 1 |
Enumerations | |
enum | packet_cmd_t { CMDacknowledge, CMDdelete, CMDcreate, CMDoffsets, CMDdata, CMDrun, CMDirmode, CMDsethost, CMDlast } |
Functions | |
void | io_handler (void) |
int | lnp_logical_write (const void *data, size_t length) |
int | lnp_assured_write (const unsigned char *data, unsigned char length, unsigned char dest, unsigned char srcport) |
send a LNP layer 0 packet of given length | |
void | LNPinit (const char *tty) |
void | ahandler (const unsigned char *data, unsigned char len, unsigned char src) |
void | lnp_download (const lx_t *lx) |
int | main (int argc, char **argv) |
the user main() | |
Variables | |
const struct option | long_options [] |
volatile int | receivedAck = 0 |
volatile unsigned short | relocate_to = 0 |
unsigned int | rcxaddr |
int | run_flag = 0 |
int | verbose_flag = 0 |
display some diagnostics if non-zero | |
int | tty_usb = 0 |
int | pdelete_flag = 0 |
int | hostaddr_flag = 0 |
Definition in file loader.c.
|
Definition at line 94 of file loader.c. Referenced by main(). |
|
|
|
time to transmit a byte.
|
|
|
|
|
|
|
|
|
|
|
|
maximum data bytes/packet for boot protocol
|
|
Definition at line 91 of file loader.c. Referenced by main(). |
|
|
|
timeout for reply
Definition at line 87 of file loader.c. Referenced by io_handler(), and lnp_assured_write(). |
|
number of packet transmit retries
|
|
|
Definition at line 342 of file loader.c. References receivedAck, and relocate_to. Referenced by main(). |
|
Definition at line 238 of file loader.c. References NULL, rcxFD(), REPLY_TIMEOUT, and tty_usb. Referenced by lnp_assured_write(). |
|
send a LNP layer 0 packet of given length
Definition at line 189 of file loader.c. References io_handler(), NULL, rcxFD(), receivedAck, and REPLY_TIMEOUT. Referenced by lnp_download(), and main(). |
|
Definition at line 353 of file loader.c. References lx_t::data_size, exit(), lnp_assured_write(), memcpy(), rcxaddr, size_t, lx_t::text, and lx_t::text_size. Referenced by main(). |
|
blocking I/R write. ! return number of bytes written, or negative for error. Definition at line 162 of file loader.c. References keepaliveRenew(), mywrite(), NULL, rcxFD(), and tty_usb. |
|
Definition at line 291 of file loader.c. References exit(), keepaliveInit(), myperror(), rcxFD(), rcxInit(), and tty_usb. Referenced by main(). |
|
the user main()
Definition at line 379 of file loader.c. References ADDR_MAX, ahandler(), lx_t::bss_size, lx_t::data_size, hostaddr_flag, lnp_assured_write(), lnp_download(), LNPinit(), long_options, lx_read(), lx_relocate(), lx_t::offset, pdelete_flag, PROG_MAX, rcxaddr, relocate_to, run_flag, lx_t::stack_size, lx_t::text_size, tty_usb, TTY_VARIABLE, and verbose_flag. |
|
Definition at line 155 of file loader.c. Referenced by main(). |
|
Initial value: { {"rcxaddr",required_argument,0,'r'}, {"program",required_argument,0,'p'}, {"delete", required_argument,0,'d'}, {"srcport",required_argument,0,'s'}, {"tty", required_argument,0,'t'}, {"irmode", required_argument,0,'i'}, {"node" , required_argument,0,'n'}, {"execute",no_argument ,0,'e'}, {"verbose",no_argument ,0,'v'}, {0 ,0 ,0,0 } } Definition at line 122 of file loader.c. Referenced by main(). |
|
Definition at line 154 of file loader.c. Referenced by main(). |
|
Initial value: DEFAULT_DEST prog = DEFAULT_PROGRAM srcport = DEFAULT_SRCPORT hostaddr = DEFAULT_DEST irmode = -1 Definition at line 145 of file loader.c. Referenced by lnp_download(), and main(). |
|
Definition at line 141 of file loader.c. Referenced by ahandler(), and lnp_assured_write(). |
|
Definition at line 143 of file loader.c. Referenced by ahandler(), and main(). |
|
Definition at line 151 of file loader.c. Referenced by main(). |
|
Definition at line 153 of file loader.c. Referenced by io_handler(), lnp_logical_write(), LNPinit(), main(), nbread(), rcx_init(), rcx_send(), rcxInit(), and rx_flush(). |
|
display some diagnostics if non-zero
|