Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki
This commit is contained in:
commit
321ecc9fab
|
@ -25,10 +25,10 @@ static const char *prompt = "contiki> ";
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static char * CC_FASTCALL
|
static char * CC_FASTCALL
|
||||||
n(u16_t num, char *ptr)
|
n(uint16_t num, char *ptr)
|
||||||
{
|
{
|
||||||
u16_t d;
|
uint16_t d;
|
||||||
u8_t a, f;
|
uint8_t a, f;
|
||||||
|
|
||||||
if(num == 0) {
|
if(num == 0) {
|
||||||
*ptr = '0';
|
*ptr = '0';
|
||||||
|
|
|
@ -104,18 +104,18 @@ static const char *err_msgs[] =
|
||||||
#define UDPDATASIZE 32
|
#define UDPDATASIZE 32
|
||||||
|
|
||||||
struct codeprop_udphdr {
|
struct codeprop_udphdr {
|
||||||
u16_t id;
|
uint16_t id;
|
||||||
u16_t type;
|
uint16_t type;
|
||||||
#define TYPE_DATA 0x0001
|
#define TYPE_DATA 0x0001
|
||||||
#define TYPE_NACK 0x0002
|
#define TYPE_NACK 0x0002
|
||||||
u16_t addr;
|
uint16_t addr;
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u8_t data[UDPDATASIZE];
|
uint8_t data[UDPDATASIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct codeprop_tcphdr {
|
struct codeprop_tcphdr {
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u16_t pad;
|
uint16_t pad;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void uipcall(void *state);
|
static void uipcall(void *state);
|
||||||
|
@ -123,19 +123,19 @@ static void uipcall(void *state);
|
||||||
PROCESS(codeprop_process, "Code propagator");
|
PROCESS(codeprop_process, "Code propagator");
|
||||||
|
|
||||||
struct codeprop_state {
|
struct codeprop_state {
|
||||||
u8_t state;
|
uint8_t state;
|
||||||
#define STATE_NONE 0
|
#define STATE_NONE 0
|
||||||
#define STATE_RECEIVING_TCPDATA 1
|
#define STATE_RECEIVING_TCPDATA 1
|
||||||
#define STATE_RECEIVING_UDPDATA 2
|
#define STATE_RECEIVING_UDPDATA 2
|
||||||
#define STATE_SENDING_UDPDATA 3
|
#define STATE_SENDING_UDPDATA 3
|
||||||
u16_t count;
|
uint16_t count;
|
||||||
u16_t addr;
|
uint16_t addr;
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u16_t id;
|
uint16_t id;
|
||||||
struct etimer sendtimer;
|
struct etimer sendtimer;
|
||||||
struct timer nacktimer, timer, starttimer;
|
struct timer nacktimer, timer, starttimer;
|
||||||
u8_t received;
|
uint8_t received;
|
||||||
u8_t send_counter;
|
uint8_t send_counter;
|
||||||
struct pt tcpthread_pt;
|
struct pt tcpthread_pt;
|
||||||
struct pt udpthread_pt;
|
struct pt udpthread_pt;
|
||||||
struct pt recv_udpthread_pt;
|
struct pt recv_udpthread_pt;
|
||||||
|
@ -198,10 +198,10 @@ PROCESS_THREAD(codeprop_process, ev, data)
|
||||||
PROCESS_END();
|
PROCESS_END();
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
static u16_t
|
static uint16_t
|
||||||
send_udpdata(struct codeprop_udphdr *uh)
|
send_udpdata(struct codeprop_udphdr *uh)
|
||||||
{
|
{
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
|
|
||||||
uh->type = UIP_HTONS(TYPE_DATA);
|
uh->type = UIP_HTONS(TYPE_DATA);
|
||||||
uh->addr = uip_htons(s.addr);
|
uh->addr = uip_htons(s.addr);
|
||||||
|
@ -367,7 +367,7 @@ PT_THREAD(recv_udpthread(struct pt *pt))
|
||||||
static
|
static
|
||||||
PT_THREAD(recv_tcpthread(struct pt *pt))
|
PT_THREAD(recv_tcpthread(struct pt *pt))
|
||||||
{
|
{
|
||||||
u8_t *dataptr;
|
uint8_t *dataptr;
|
||||||
struct codeprop_tcphdr *th;
|
struct codeprop_tcphdr *th;
|
||||||
int datalen = uip_datalen();
|
int datalen = uip_datalen();
|
||||||
PT_BEGIN(pt);
|
PT_BEGIN(pt);
|
||||||
|
|
|
@ -104,13 +104,13 @@ void codeprop_set_rate(clock_time_t time);
|
||||||
#define UDPDATASIZE 32
|
#define UDPDATASIZE 32
|
||||||
|
|
||||||
struct codeprop_udphdr {
|
struct codeprop_udphdr {
|
||||||
u16_t id;
|
uint16_t id;
|
||||||
u16_t type;
|
uint16_t type;
|
||||||
#define TYPE_DATA 0x0001
|
#define TYPE_DATA 0x0001
|
||||||
#define TYPE_NACK 0x0002
|
#define TYPE_NACK 0x0002
|
||||||
u16_t addr;
|
uint16_t addr;
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u8_t data[UDPDATASIZE];
|
uint8_t data[UDPDATASIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
static void uipcall(void *state);
|
static void uipcall(void *state);
|
||||||
|
@ -118,19 +118,19 @@ static void uipcall(void *state);
|
||||||
PROCESS(codeprop_process, "Code propagator");
|
PROCESS(codeprop_process, "Code propagator");
|
||||||
|
|
||||||
struct codeprop_state {
|
struct codeprop_state {
|
||||||
u8_t state;
|
uint8_t state;
|
||||||
#define STATE_NONE 0
|
#define STATE_NONE 0
|
||||||
#define STATE_RECEIVING_TCPDATA 1
|
#define STATE_RECEIVING_TCPDATA 1
|
||||||
#define STATE_RECEIVING_UDPDATA 2
|
#define STATE_RECEIVING_UDPDATA 2
|
||||||
#define STATE_SENDING_UDPDATA 3
|
#define STATE_SENDING_UDPDATA 3
|
||||||
u16_t count;
|
uint16_t count;
|
||||||
u16_t addr;
|
uint16_t addr;
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u16_t id;
|
uint16_t id;
|
||||||
struct etimer sendtimer;
|
struct etimer sendtimer;
|
||||||
struct timer nacktimer, timer, starttimer;
|
struct timer nacktimer, timer, starttimer;
|
||||||
u8_t received;
|
uint8_t received;
|
||||||
u8_t send_counter;
|
uint8_t send_counter;
|
||||||
struct pt tcpthread_pt;
|
struct pt tcpthread_pt;
|
||||||
struct pt udpthread_pt;
|
struct pt udpthread_pt;
|
||||||
struct pt recv_udpthread_pt;
|
struct pt recv_udpthread_pt;
|
||||||
|
@ -199,10 +199,10 @@ PROCESS_THREAD(codeprop_process, ev, data)
|
||||||
PROCESS_END();
|
PROCESS_END();
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
static u16_t
|
static uint16_t
|
||||||
send_udpdata(struct codeprop_udphdr *uh)
|
send_udpdata(struct codeprop_udphdr *uh)
|
||||||
{
|
{
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
|
|
||||||
uh->type = UIP_HTONS(TYPE_DATA);
|
uh->type = UIP_HTONS(TYPE_DATA);
|
||||||
uh->addr = uip_htons(s.addr);
|
uh->addr = uip_htons(s.addr);
|
||||||
|
@ -360,7 +360,7 @@ PT_THREAD(recv_udpthread(struct pt *pt))
|
||||||
static
|
static
|
||||||
PT_THREAD(recv_tcpthread(struct pt *pt))
|
PT_THREAD(recv_tcpthread(struct pt *pt))
|
||||||
{
|
{
|
||||||
u8_t *dataptr;
|
uint8_t *dataptr;
|
||||||
struct codeprop_tcphdr *th;
|
struct codeprop_tcphdr *th;
|
||||||
int datalen = uip_datalen();
|
int datalen = uip_datalen();
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,8 @@
|
||||||
#define CODEPROP_DATA_PORT 6510
|
#define CODEPROP_DATA_PORT 6510
|
||||||
|
|
||||||
struct codeprop_tcphdr {
|
struct codeprop_tcphdr {
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u16_t pad;
|
uint16_t pad;
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCESS_NAME(codeprop_process);
|
PROCESS_NAME(codeprop_process);
|
||||||
|
|
|
@ -50,8 +50,8 @@ PROCESS(tcp_loader_process, "TCP loader");
|
||||||
|
|
||||||
static
|
static
|
||||||
struct codeprop_state {
|
struct codeprop_state {
|
||||||
u16_t addr;
|
uint16_t addr;
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
struct pt tcpthread_pt;
|
struct pt tcpthread_pt;
|
||||||
} s;
|
} s;
|
||||||
|
|
||||||
|
|
|
@ -55,8 +55,8 @@ PROCESS(tcp_loader_process, "TCP loader");
|
||||||
|
|
||||||
static
|
static
|
||||||
struct codeprop_state {
|
struct codeprop_state {
|
||||||
u16_t addr;
|
uint16_t addr;
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
struct pt tcpthread_pt;
|
struct pt tcpthread_pt;
|
||||||
} s;
|
} s;
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ set_statustext(char *text)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static char *
|
static char *
|
||||||
makebyte(u8_t byte, char *str)
|
makebyte(uint8_t byte, char *str)
|
||||||
{
|
{
|
||||||
if(byte >= 100) {
|
if(byte >= 100) {
|
||||||
*str++ = (byte / 100 ) % 10 + '0';
|
*str++ = (byte / 100 ) % 10 + '0';
|
||||||
|
|
|
@ -52,9 +52,9 @@ struct smtp_state {
|
||||||
char *from;
|
char *from;
|
||||||
char *subject;
|
char *subject;
|
||||||
char *msg;
|
char *msg;
|
||||||
u8_t msgwidth;
|
uint8_t msgwidth;
|
||||||
u8_t msgheight;
|
uint8_t msgheight;
|
||||||
u8_t line;
|
uint8_t line;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct smtp_state s;
|
static struct smtp_state s;
|
||||||
|
@ -209,7 +209,7 @@ smtp_configure(char *lhostname, uip_ipaddr_t *server)
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
unsigned char
|
unsigned char
|
||||||
smtp_send(char *to, char *cc, char *from, char *subject,
|
smtp_send(char *to, char *cc, char *from, char *subject,
|
||||||
char *msg, u8_t msgwidth, u8_t msgheight)
|
char *msg, uint8_t msgwidth, uint8_t msgheight)
|
||||||
{
|
{
|
||||||
struct uip_conn *conn;
|
struct uip_conn *conn;
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ void smtp_configure(char *localhostname, uip_ipaddr_t *smtpserver);
|
||||||
|
|
||||||
unsigned char smtp_send(char *to, char *cc, char *from,
|
unsigned char smtp_send(char *to, char *cc, char *from,
|
||||||
char *subject, char *msg,
|
char *subject, char *msg,
|
||||||
u8_t msgwidth, u8_t msgheight);
|
uint8_t msgwidth, uint8_t msgheight);
|
||||||
|
|
||||||
void smtp_appcall(void *state);
|
void smtp_appcall(void *state);
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#define PRINTBITS(buf,len) { \
|
#define PRINTBITS(buf,len) { \
|
||||||
int i,j=0; \
|
int i,j=0; \
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#define PRINTBITS(buf,len) { \
|
#define PRINTBITS(buf,len) { \
|
||||||
int i,j=0; \
|
int i,j=0; \
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#define PRINTBITS(buf,len) { \
|
#define PRINTBITS(buf,len) { \
|
||||||
int i,j=0; \
|
int i,j=0; \
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF("[%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x]", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF("[%02x:%02x:%02x:%02x:%02x:%02x]",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -674,7 +674,7 @@ ftpc_connected(void *connection)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
ftpc_data(u8_t *data, u16_t len)
|
ftpc_data(uint8_t *data, uint16_t len)
|
||||||
{
|
{
|
||||||
if(data == NULL) {
|
if(data == NULL) {
|
||||||
show_statustext("Download complete", "");
|
show_statustext("Download complete", "");
|
||||||
|
|
|
@ -52,7 +52,7 @@ struct ftp_dataconn {
|
||||||
#define CONNTYPE_LIST 0
|
#define CONNTYPE_LIST 0
|
||||||
#define CONNTYPE_FILE 1
|
#define CONNTYPE_FILE 1
|
||||||
|
|
||||||
u16_t port;
|
uint16_t port;
|
||||||
|
|
||||||
unsigned char filenameptr;
|
unsigned char filenameptr;
|
||||||
char filename[MAX_FILENAMELEN];
|
char filename[MAX_FILENAMELEN];
|
||||||
|
@ -128,7 +128,7 @@ ftpc_init(void)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void *
|
void *
|
||||||
ftpc_connect(uip_ipaddr_t *ipaddr, u16_t port)
|
ftpc_connect(uip_ipaddr_t *ipaddr, uint16_t port)
|
||||||
{
|
{
|
||||||
struct ftp_connection *c;
|
struct ftp_connection *c;
|
||||||
|
|
||||||
|
@ -212,8 +212,8 @@ handle_input(struct ftp_connection *c)
|
||||||
static void
|
static void
|
||||||
newdata(struct ftp_connection *c)
|
newdata(struct ftp_connection *c)
|
||||||
{
|
{
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
u8_t d;
|
uint8_t d;
|
||||||
|
|
||||||
for(i = 0; i < uip_datalen(); ++i) {
|
for(i = 0; i < uip_datalen(); ++i) {
|
||||||
d = ((char *)uip_appdata)[i];
|
d = ((char *)uip_appdata)[i];
|
||||||
|
@ -268,17 +268,17 @@ acked(struct ftp_connection *c)
|
||||||
static void
|
static void
|
||||||
senddata(struct ftp_connection *c)
|
senddata(struct ftp_connection *c)
|
||||||
{
|
{
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
|
|
||||||
switch(c->state) {
|
switch(c->state) {
|
||||||
case STATE_SEND_USER:
|
case STATE_SEND_USER:
|
||||||
len = 5 + (u16_t)strlen(ftpc_username()) + 2;
|
len = 5 + (uint16_t)strlen(ftpc_username()) + 2;
|
||||||
strcpy(uip_appdata, "USER ");
|
strcpy(uip_appdata, "USER ");
|
||||||
strncpy((char *)uip_appdata + 5, ftpc_username(), uip_mss() - 5 - 2);
|
strncpy((char *)uip_appdata + 5, ftpc_username(), uip_mss() - 5 - 2);
|
||||||
strcpy((char *)uip_appdata + len - 2, "\r\n");
|
strcpy((char *)uip_appdata + len - 2, "\r\n");
|
||||||
break;
|
break;
|
||||||
case STATE_SEND_PASS:
|
case STATE_SEND_PASS:
|
||||||
len = 5 + (u16_t)strlen(ftpc_password()) + 2;
|
len = 5 + (uint16_t)strlen(ftpc_password()) + 2;
|
||||||
strcpy(uip_appdata, "PASS ");
|
strcpy(uip_appdata, "PASS ");
|
||||||
strncpy((char *)uip_appdata + 5, ftpc_password(), uip_mss() - 5 - 2);
|
strncpy((char *)uip_appdata + 5, ftpc_password(), uip_mss() - 5 - 2);
|
||||||
strcpy((char *)uip_appdata + len - 2, "\r\n");
|
strcpy((char *)uip_appdata + len - 2, "\r\n");
|
||||||
|
@ -290,7 +290,7 @@ senddata(struct ftp_connection *c)
|
||||||
(c->dataconn.port) & 0xff);
|
(c->dataconn.port) & 0xff);
|
||||||
break;
|
break;
|
||||||
case STATE_SEND_OPTIONS:
|
case STATE_SEND_OPTIONS:
|
||||||
len = (u16_t)strlen(options.commands[c->optionsptr]);
|
len = (uint16_t)strlen(options.commands[c->optionsptr]);
|
||||||
strcpy(uip_appdata, options.commands[c->optionsptr]);
|
strcpy(uip_appdata, options.commands[c->optionsptr]);
|
||||||
break;
|
break;
|
||||||
case STATE_SEND_NLST:
|
case STATE_SEND_NLST:
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
void ftpc_init(void);
|
void ftpc_init(void);
|
||||||
|
|
||||||
void *ftpc_connect(uip_ipaddr_t *ipaddr, u16_t port);
|
void *ftpc_connect(uip_ipaddr_t *ipaddr, uint16_t port);
|
||||||
char ftpc_list(void *connection);
|
char ftpc_list(void *connection);
|
||||||
void ftpc_cwd(void *connection, char *dir);
|
void ftpc_cwd(void *connection, char *dir);
|
||||||
void ftpc_cdup(void *connection);
|
void ftpc_cdup(void *connection);
|
||||||
|
@ -63,6 +63,6 @@ void ftpc_closed(void);
|
||||||
void ftpc_aborted(void);
|
void ftpc_aborted(void);
|
||||||
void ftpc_timedout(void);
|
void ftpc_timedout(void);
|
||||||
void ftpc_list_file(char *filename);
|
void ftpc_list_file(char *filename);
|
||||||
void ftpc_data(u8_t *data, u16_t len);
|
void ftpc_data(uint8_t *data, uint16_t len);
|
||||||
|
|
||||||
#endif /* __FTPC_H__ */
|
#endif /* __FTPC_H__ */
|
||||||
|
|
|
@ -73,7 +73,7 @@ static void makestrings(void);
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static char *
|
static char *
|
||||||
makebyte(u8_t byte, char *str)
|
makebyte(uint8_t byte, char *str)
|
||||||
{
|
{
|
||||||
if(byte >= 100) {
|
if(byte >= 100) {
|
||||||
*str++ = (byte / 100 ) % 10 + '0';
|
*str++ = (byte / 100 ) % 10 + '0';
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",lladdr->addr[0], lladdr->addr[1], lladdr->addr[2], lladdr->addr[3],lladdr->addr[4], lladdr->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",lladdr->addr[0], lladdr->addr[1], lladdr->addr[2], lladdr->addr[3],lladdr->addr[4], lladdr->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
@ -56,9 +56,9 @@
|
||||||
#define UIP_ICMP_BUF ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
|
#define UIP_ICMP_BUF ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
|
||||||
|
|
||||||
static struct etimer ping6_periodic_timer;
|
static struct etimer ping6_periodic_timer;
|
||||||
static u8_t count = 0;
|
static uint8_t count = 0;
|
||||||
static char command[20];
|
static char command[20];
|
||||||
static u16_t addr[8];
|
static uint16_t addr[8];
|
||||||
uip_ipaddr_t dest_addr;
|
uip_ipaddr_t dest_addr;
|
||||||
|
|
||||||
PROCESS(ping6_process, "PING6 process");
|
PROCESS(ping6_process, "PING6 process");
|
||||||
|
@ -66,7 +66,7 @@ AUTOSTART_PROCESSES(&ping6_process);
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static u8_t
|
static uint8_t
|
||||||
ping6handler(process_event_t ev, process_data_t data)
|
ping6handler(process_event_t ev, process_data_t data)
|
||||||
{
|
{
|
||||||
if(count == 0){
|
if(count == 0){
|
||||||
|
@ -130,8 +130,8 @@ ping6handler(process_event_t ev, process_data_t data)
|
||||||
|
|
||||||
|
|
||||||
uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN + PING6_DATALEN;
|
uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN + PING6_DATALEN;
|
||||||
UIP_IP_BUF->len[0] = (u8_t)((uip_len - 40) >> 8);
|
UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8);
|
||||||
UIP_IP_BUF->len[1] = (u8_t)((uip_len - 40) & 0x00FF);
|
UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00FF);
|
||||||
|
|
||||||
UIP_ICMP_BUF->icmpchksum = 0;
|
UIP_ICMP_BUF->icmpchksum = 0;
|
||||||
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
|
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
|
||||||
|
@ -157,7 +157,7 @@ ping6handler(process_event_t ev, process_data_t data)
|
||||||
PROCESS_THREAD(ping6_process, ev, data)
|
PROCESS_THREAD(ping6_process, ev, data)
|
||||||
{
|
{
|
||||||
|
|
||||||
u8_t cont = 1;
|
uint8_t cont = 1;
|
||||||
|
|
||||||
PROCESS_BEGIN();
|
PROCESS_BEGIN();
|
||||||
PRINTF("In Process PING6\n");
|
PRINTF("In Process PING6\n");
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
@ -420,10 +420,10 @@ handle_incoming_data(void)
|
||||||
int error=NO_ERROR;
|
int error=NO_ERROR;
|
||||||
char buf[MAX_PAYLOAD_LEN];
|
char buf[MAX_PAYLOAD_LEN];
|
||||||
|
|
||||||
PRINTF("uip_datalen received %u \n",(u16_t)uip_datalen());
|
PRINTF("uip_datalen received %u \n",(uint16_t)uip_datalen());
|
||||||
|
|
||||||
char* data = (char *)uip_appdata + uip_ext_len;
|
char* data = (char *)uip_appdata + uip_ext_len;
|
||||||
u16_t datalen = uip_datalen() - uip_ext_len;
|
uint16_t datalen = uip_datalen() - uip_ext_len;
|
||||||
|
|
||||||
int data_size = 0;
|
int data_size = 0;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((u8_t *)addr)[0], ((u8_t *)addr)[1], ((u8_t *)addr)[2], ((u8_t *)addr)[3], ((u8_t *)addr)[4], ((u8_t *)addr)[5], ((u8_t *)addr)[6], ((u8_t *)addr)[7], ((u8_t *)addr)[8], ((u8_t *)addr)[9], ((u8_t *)addr)[10], ((u8_t *)addr)[11], ((u8_t *)addr)[12], ((u8_t *)addr)[13], ((u8_t *)addr)[14], ((u8_t *)addr)[15])
|
#define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
|
||||||
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",(lladdr)->addr[0], (lladdr)->addr[1], (lladdr)->addr[2], (lladdr)->addr[3],(lladdr)->addr[4], (lladdr)->addr[5])
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
|
|
|
@ -330,7 +330,7 @@ send_udp_packet(struct uip_udp_conn *conn)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
parse_incoming_packet(const u8_t *buf, int len)
|
parse_incoming_packet(const uint8_t *buf, int len)
|
||||||
{
|
{
|
||||||
int numregs;
|
int numregs;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
|
@ -85,8 +85,8 @@ send_ping(uip_ipaddr_t *dest_addr)
|
||||||
|
|
||||||
uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN +
|
uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN +
|
||||||
UIP_IPH_LEN + PING_DATALEN;
|
UIP_IPH_LEN + PING_DATALEN;
|
||||||
UIP_IP_BUF->len[0] = (u8_t)((uip_len - 40) >> 8);
|
UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8);
|
||||||
UIP_IP_BUF->len[1] = (u8_t)((uip_len - 40) & 0x00ff);
|
UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00ff);
|
||||||
|
|
||||||
UIP_ICMP_BUF->icmpchksum = 0;
|
UIP_ICMP_BUF->icmpchksum = 0;
|
||||||
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
|
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
|
||||||
|
@ -116,11 +116,11 @@ send_ping(uip_ipaddr_t *dest_addr)
|
||||||
UIP_ICMP_BUF->seqno = uip_htons(seqno++);
|
UIP_ICMP_BUF->seqno = uip_htons(seqno++);
|
||||||
|
|
||||||
uip_len = UIP_ICMPH_LEN + UIP_IPH_LEN + PING_DATALEN;
|
uip_len = UIP_ICMPH_LEN + UIP_IPH_LEN + PING_DATALEN;
|
||||||
UIP_IP_BUF->len[0] = (u8_t)((uip_len) >> 8);
|
UIP_IP_BUF->len[0] = (uint8_t)((uip_len) >> 8);
|
||||||
UIP_IP_BUF->len[1] = (u8_t)((uip_len) & 0x00ff);
|
UIP_IP_BUF->len[1] = (uint8_t)((uip_len) & 0x00ff);
|
||||||
|
|
||||||
UIP_ICMP_BUF->icmpchksum = 0;
|
UIP_ICMP_BUF->icmpchksum = 0;
|
||||||
UIP_ICMP_BUF->icmpchksum = ~uip_chksum((u16_t *)&(UIP_ICMP_BUF->type),
|
UIP_ICMP_BUF->icmpchksum = ~uip_chksum((uint16_t *)&(UIP_ICMP_BUF->type),
|
||||||
UIP_ICMPH_LEN + PING_DATALEN);
|
UIP_ICMPH_LEN + PING_DATALEN);
|
||||||
|
|
||||||
/* Calculate IP checksum. */
|
/* Calculate IP checksum. */
|
||||||
|
|
|
@ -123,7 +123,7 @@ sent_mesh(struct mesh_conn *c)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
static void
|
static void
|
||||||
recv_mesh(struct mesh_conn *c, const rimeaddr_t *from, u8_t hops)
|
recv_mesh(struct mesh_conn *c, const rimeaddr_t *from, uint8_t hops)
|
||||||
{
|
{
|
||||||
struct rime_ping_msg ping;
|
struct rime_ping_msg ping;
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
|
@ -293,7 +293,7 @@ PROCESS_THREAD(shell_send_process, ev, data)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
recv_collect(const rimeaddr_t *originator, u8_t seqno, u8_t hops)
|
recv_collect(const rimeaddr_t *originator, uint8_t seqno, uint8_t hops)
|
||||||
{
|
{
|
||||||
struct collect_msg collect_msg;
|
struct collect_msg collect_msg;
|
||||||
char *dataptr;
|
char *dataptr;
|
||||||
|
|
|
@ -82,7 +82,7 @@ telnet_text_output(struct telnet_state *s, char *text1, char *text2)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
telnet_newdata(struct telnet_state *s, char *data, u16_t len)
|
telnet_newdata(struct telnet_state *s, char *data, uint16_t len)
|
||||||
{
|
{
|
||||||
shell_output(&tcpsend_command, data, len, "", 0);
|
shell_output(&tcpsend_command, data, len, "", 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,7 +191,7 @@ shell_wget_init(void)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
webclient_datahandler(char *data, u16_t len)
|
webclient_datahandler(char *data, uint16_t len)
|
||||||
{
|
{
|
||||||
if(len == 0) {
|
if(len == 0) {
|
||||||
running = 0;
|
running = 0;
|
||||||
|
|
|
@ -152,7 +152,7 @@ static void
|
||||||
connect(void)
|
connect(void)
|
||||||
{
|
{
|
||||||
uip_ipaddr_t addr, *addrptr;
|
uip_ipaddr_t addr, *addrptr;
|
||||||
u16_t port;
|
uint16_t port;
|
||||||
char *cptr;
|
char *cptr;
|
||||||
struct uip_conn *conn;
|
struct uip_conn *conn;
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ telnet_timedout(struct telnet_state *s)
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
telnet_newdata(struct telnet_state *s, char *data, u16_t len)
|
telnet_newdata(struct telnet_state *s, char *data, uint16_t len)
|
||||||
{
|
{
|
||||||
petsciiconv_topetscii(data, len);
|
petsciiconv_topetscii(data, len);
|
||||||
data[len] = 0;
|
data[len] = 0;
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#define FLAG_ABORT 2
|
#define FLAG_ABORT 2
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
unsigned char
|
unsigned char
|
||||||
telnet_send(struct telnet_state *s, char *text, u16_t len)
|
telnet_send(struct telnet_state *s, char *text, uint16_t len)
|
||||||
{
|
{
|
||||||
if(s->text != NULL) {
|
if(s->text != NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -104,7 +104,7 @@ senddata(struct telnet_state *s)
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
struct telnet_state *
|
struct telnet_state *
|
||||||
telnet_connect(struct telnet_state *s, uip_ipaddr_t *addr, u16_t port)
|
telnet_connect(struct telnet_state *s, uip_ipaddr_t *addr, uint16_t port)
|
||||||
{
|
{
|
||||||
struct uip_conn *conn;
|
struct uip_conn *conn;
|
||||||
|
|
||||||
|
|
|
@ -39,16 +39,16 @@
|
||||||
struct telnet_state {
|
struct telnet_state {
|
||||||
unsigned char flags;
|
unsigned char flags;
|
||||||
char *text;
|
char *text;
|
||||||
u16_t textlen;
|
uint16_t textlen;
|
||||||
u16_t sentlen;
|
uint16_t sentlen;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*DISPATCHER_UIPCALL(telnet_app, s);*/
|
/*DISPATCHER_UIPCALL(telnet_app, s);*/
|
||||||
void telnet_app(void *s);
|
void telnet_app(void *s);
|
||||||
unsigned char telnet_send(struct telnet_state *s, char *text, u16_t len);
|
unsigned char telnet_send(struct telnet_state *s, char *text, uint16_t len);
|
||||||
unsigned char telnet_close(struct telnet_state *s);
|
unsigned char telnet_close(struct telnet_state *s);
|
||||||
unsigned char telnet_abort(struct telnet_state *s);
|
unsigned char telnet_abort(struct telnet_state *s);
|
||||||
struct telnet_state *telnet_connect(struct telnet_state *s, uip_ipaddr_t *addr, u16_t port);
|
struct telnet_state *telnet_connect(struct telnet_state *s, uip_ipaddr_t *addr, uint16_t port);
|
||||||
|
|
||||||
|
|
||||||
/* Callbacks, implemented by the caller. */
|
/* Callbacks, implemented by the caller. */
|
||||||
|
@ -57,5 +57,5 @@ void telnet_closed(struct telnet_state *s);
|
||||||
void telnet_sent(struct telnet_state *s);
|
void telnet_sent(struct telnet_state *s);
|
||||||
void telnet_aborted(struct telnet_state *s);
|
void telnet_aborted(struct telnet_state *s);
|
||||||
void telnet_timedout(struct telnet_state *s);
|
void telnet_timedout(struct telnet_state *s);
|
||||||
void telnet_newdata(struct telnet_state *s, char *data, u16_t len);
|
void telnet_newdata(struct telnet_state *s, char *data, uint16_t len);
|
||||||
#endif /* __TELNET_H__ */
|
#endif /* __TELNET_H__ */
|
||||||
|
|
|
@ -66,7 +66,7 @@ struct telnetd_state {
|
||||||
char buf[TELNETD_CONF_LINELEN + 1];
|
char buf[TELNETD_CONF_LINELEN + 1];
|
||||||
char bufptr;
|
char bufptr;
|
||||||
uint16_t numsent;
|
uint16_t numsent;
|
||||||
u8_t state;
|
uint8_t state;
|
||||||
#define STATE_NORMAL 0
|
#define STATE_NORMAL 0
|
||||||
#define STATE_IAC 1
|
#define STATE_IAC 1
|
||||||
#define STATE_WILL 2
|
#define STATE_WILL 2
|
||||||
|
@ -239,7 +239,7 @@ senddata(void)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
get_char(u8_t c)
|
get_char(uint8_t c)
|
||||||
{
|
{
|
||||||
PRINTF("telnetd: get_char '%c' %d %d\n", c, c, s.bufptr);
|
PRINTF("telnetd: get_char '%c' %d %d\n", c, c, s.bufptr);
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ get_char(u8_t c)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
sendopt(u8_t option, u8_t value)
|
sendopt(uint8_t option, uint8_t value)
|
||||||
{
|
{
|
||||||
char line[4];
|
char line[4];
|
||||||
line[0] = (char)TELNET_IAC;
|
line[0] = (char)TELNET_IAC;
|
||||||
|
@ -278,8 +278,8 @@ sendopt(u8_t option, u8_t value)
|
||||||
static void
|
static void
|
||||||
newdata(void)
|
newdata(void)
|
||||||
{
|
{
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u8_t c;
|
uint8_t c;
|
||||||
uint8_t *ptr;
|
uint8_t *ptr;
|
||||||
|
|
||||||
len = uip_datalen();
|
len = uip_datalen();
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include "net/uip_arch.h"
|
#include "net/uip_arch.h"
|
||||||
|
|
||||||
/* Pointer to the bitmap area in memory. */
|
/* Pointer to the bitmap area in memory. */
|
||||||
extern u8_t vnc_draw_bitmap[];
|
extern uint8_t vnc_draw_bitmap[];
|
||||||
|
|
||||||
/* Initialize the vnc-draw module. */
|
/* Initialize the vnc-draw module. */
|
||||||
void vnc_draw_init(void);
|
void vnc_draw_init(void);
|
||||||
|
@ -48,14 +48,14 @@ void vnc_draw_init(void);
|
||||||
given by the "data" argument and the length of data is given by the
|
given by the "data" argument and the length of data is given by the
|
||||||
"datalen" argument. The data format is one pixel per byte in bgr233
|
"datalen" argument. The data format is one pixel per byte in bgr233
|
||||||
format (bbgggrrr). */
|
format (bbgggrrr). */
|
||||||
void vnc_draw_pixelline(u16_t x, u16_t y,
|
void vnc_draw_pixelline(uint16_t x, uint16_t y,
|
||||||
u8_t *data, u16_t datalen);
|
uint8_t *data, uint16_t datalen);
|
||||||
|
|
||||||
/* The following functions should return the x and y coordinates and
|
/* The following functions should return the x and y coordinates and
|
||||||
the width and height of the viewport. */
|
the width and height of the viewport. */
|
||||||
u16_t vnc_draw_viewport_x(void);
|
uint16_t vnc_draw_viewport_x(void);
|
||||||
u16_t vnc_draw_viewport_y(void);
|
uint16_t vnc_draw_viewport_y(void);
|
||||||
u16_t vnc_draw_viewport_w(void);
|
uint16_t vnc_draw_viewport_w(void);
|
||||||
u16_t vnc_draw_viewport_h(void);
|
uint16_t vnc_draw_viewport_h(void);
|
||||||
|
|
||||||
#endif /* __VNC_DRAW_H__ */
|
#endif /* __VNC_DRAW_H__ */
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
#define RFB_SERVER_VERSION_STRING rfb_server_version_string
|
#define RFB_SERVER_VERSION_STRING rfb_server_version_string
|
||||||
|
|
||||||
/* "RFB 003.003" */
|
/* "RFB 003.003" */
|
||||||
static u8_t rfb_server_version_string[12] =
|
static uint8_t rfb_server_version_string[12] =
|
||||||
{82,70,66,32,48,48,51,46,48,48,51,10};
|
{82,70,66,32,48,48,51,46,48,48,51,10};
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -77,7 +77,7 @@ vnc_viewer_close(void)
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
vnc_viewer_connect(u16_t *server, u8_t display)
|
vnc_viewer_connect(uint16_t *server, uint8_t display)
|
||||||
{
|
{
|
||||||
struct uip_conn *conn;
|
struct uip_conn *conn;
|
||||||
|
|
||||||
|
@ -96,10 +96,10 @@ vnc_viewer_connect(u16_t *server, u8_t display)
|
||||||
static void
|
static void
|
||||||
senddata(void)
|
senddata(void)
|
||||||
{
|
{
|
||||||
register u8_t *dataptr;
|
register uint8_t *dataptr;
|
||||||
u16_t dataleft;
|
uint16_t dataleft;
|
||||||
|
|
||||||
dataptr = (u8_t *)uip_appdata;
|
dataptr = (uint8_t *)uip_appdata;
|
||||||
|
|
||||||
switch(vs->sendmsg) {
|
switch(vs->sendmsg) {
|
||||||
case VNC_SEND_VERSION:
|
case VNC_SEND_VERSION:
|
||||||
|
@ -115,7 +115,7 @@ senddata(void)
|
||||||
case VNC_SEND_CINIT:
|
case VNC_SEND_CINIT:
|
||||||
PRINTF(("Sending CINIT\n"));
|
PRINTF(("Sending CINIT\n"));
|
||||||
/* Send one byte of client init. */
|
/* Send one byte of client init. */
|
||||||
*(u8_t *)dataptr = 1;
|
*(uint8_t *)dataptr = 1;
|
||||||
uip_send(uip_appdata, 1);
|
uip_send(uip_appdata, 1);
|
||||||
break;
|
break;
|
||||||
case VNC_SEND_PFMT:
|
case VNC_SEND_PFMT:
|
||||||
|
@ -144,10 +144,10 @@ senddata(void)
|
||||||
dataptr += sizeof(struct rfb_set_encodings);
|
dataptr += sizeof(struct rfb_set_encodings);
|
||||||
dataptr[0] = dataptr[1] = dataptr[2] = 0;
|
dataptr[0] = dataptr[1] = dataptr[2] = 0;
|
||||||
dataptr[3] = RFB_ENC_RAW;
|
dataptr[3] = RFB_ENC_RAW;
|
||||||
/* ((u8_t *)dataptr + sizeof(struct rfb_set_encodings))[4] =
|
/* ((uint8_t *)dataptr + sizeof(struct rfb_set_encodings))[4] =
|
||||||
((u8_t *)dataptr + sizeof(struct rfb_set_encodings))[5] =
|
((uint8_t *)dataptr + sizeof(struct rfb_set_encodings))[5] =
|
||||||
((u8_t *)dataptr + sizeof(struct rfb_set_encodings))[6] = 0;
|
((uint8_t *)dataptr + sizeof(struct rfb_set_encodings))[6] = 0;
|
||||||
((u8_t *)dataptr + sizeof(struct rfb_set_encodings))[7] = RFB_ENC_RRE;*/
|
((uint8_t *)dataptr + sizeof(struct rfb_set_encodings))[7] = RFB_ENC_RRE;*/
|
||||||
uip_send(uip_appdata, sizeof(struct rfb_set_encodings) + 4);
|
uip_send(uip_appdata, sizeof(struct rfb_set_encodings) + 4);
|
||||||
break;
|
break;
|
||||||
case VNC_SEND_UPDATERQ:
|
case VNC_SEND_UPDATERQ:
|
||||||
|
@ -230,7 +230,7 @@ senddata(void)
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
buffer_data(u8_t *data, u16_t datalen)
|
buffer_data(uint8_t *data, uint16_t datalen)
|
||||||
{
|
{
|
||||||
PRINTF(("Buffering %d bytes of data\n", datalen));
|
PRINTF(("Buffering %d bytes of data\n", datalen));
|
||||||
|
|
||||||
|
@ -254,11 +254,11 @@ clearbuffer(void)
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
/* Returns: the amount of bytes actually read. */
|
/* Returns: the amount of bytes actually read. */
|
||||||
static u16_t
|
static uint16_t
|
||||||
recv_rectstate(u8_t *dataptr, u16_t datalen)
|
recv_rectstate(uint8_t *dataptr, uint16_t datalen)
|
||||||
{
|
{
|
||||||
u16_t pixels;
|
uint16_t pixels;
|
||||||
u16_t pixelsleft;
|
uint16_t pixelsleft;
|
||||||
|
|
||||||
switch(vs->rectstate) {
|
switch(vs->rectstate) {
|
||||||
case VNC_RECTSTATE_RAW:
|
case VNC_RECTSTATE_RAW:
|
||||||
|
@ -309,7 +309,7 @@ recv_rectstate(u8_t *dataptr, u16_t datalen)
|
||||||
rect can be drawn. */
|
rect can be drawn. */
|
||||||
static unsigned short
|
static unsigned short
|
||||||
recv_update_rect(CC_REGISTER_ARG struct rfb_fb_update_rect_hdr *rhdr,
|
recv_update_rect(CC_REGISTER_ARG struct rfb_fb_update_rect_hdr *rhdr,
|
||||||
u16_t dataleft)
|
uint16_t dataleft)
|
||||||
{
|
{
|
||||||
struct rfb_rre_hdr *rrehdr;
|
struct rfb_rre_hdr *rrehdr;
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ recv_update_rect(CC_REGISTER_ARG struct rfb_fb_update_rect_hdr *rhdr,
|
||||||
rhdr->encoding[2]) == 0) {
|
rhdr->encoding[2]) == 0) {
|
||||||
switch(rhdr->encoding[3]) {
|
switch(rhdr->encoding[3]) {
|
||||||
case RFB_ENC_RAW:
|
case RFB_ENC_RAW:
|
||||||
vs->rectstateleft = (u32_t)uip_htons(rhdr->rect.w) * (u32_t)uip_htons(rhdr->rect.h);
|
vs->rectstateleft = (uint32_t)uip_htons(rhdr->rect.w) * (uint32_t)uip_htons(rhdr->rect.h);
|
||||||
vs->rectstate = VNC_RECTSTATE_RAW;
|
vs->rectstate = VNC_RECTSTATE_RAW;
|
||||||
vs->rectstatex0 = vs->rectstatex = uip_htons(rhdr->rect.x);
|
vs->rectstatex0 = vs->rectstatex = uip_htons(rhdr->rect.x);
|
||||||
vs->rectstatey0 = vs->rectstatey = uip_htons(rhdr->rect.y);
|
vs->rectstatey0 = vs->rectstatey = uip_htons(rhdr->rect.y);
|
||||||
|
@ -330,14 +330,14 @@ recv_update_rect(CC_REGISTER_ARG struct rfb_fb_update_rect_hdr *rhdr,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RFB_ENC_RRE:
|
case RFB_ENC_RRE:
|
||||||
rrehdr = (struct rfb_rre_hdr *)((u8_t *)rhdr +
|
rrehdr = (struct rfb_rre_hdr *)((uint8_t *)rhdr +
|
||||||
sizeof(struct rfb_fb_update_rect_hdr));
|
sizeof(struct rfb_fb_update_rect_hdr));
|
||||||
PRINTF(("Received RRE subrects %d (%d)\n",
|
PRINTF(("Received RRE subrects %d (%d)\n",
|
||||||
(uip_htons(rrehdr->subrects[1]) << 16) +
|
(uip_htons(rrehdr->subrects[1]) << 16) +
|
||||||
uip_htons(rrehdr->subrects[0]),
|
uip_htons(rrehdr->subrects[0]),
|
||||||
rrehdr->bgpixel));
|
rrehdr->bgpixel));
|
||||||
vs->rectstateleft = ((u32_t)(uip_htons(rrehdr->subrects[1]) << 16) +
|
vs->rectstateleft = ((uint32_t)(uip_htons(rrehdr->subrects[1]) << 16) +
|
||||||
(u32_t)uip_htons(rrehdr->subrects[0]));
|
(uint32_t)uip_htons(rrehdr->subrects[0]));
|
||||||
vs->rectstate = VNC_RECTSTATE_RRE;
|
vs->rectstate = VNC_RECTSTATE_RRE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -363,8 +363,8 @@ recv_update_rect(CC_REGISTER_ARG struct rfb_fb_update_rect_hdr *rhdr,
|
||||||
* incoming message and returns the number of bytes of data that is to
|
* incoming message and returns the number of bytes of data that is to
|
||||||
* be expected.
|
* be expected.
|
||||||
*/
|
*/
|
||||||
static u16_t
|
static uint16_t
|
||||||
identify_data(CC_REGISTER_ARG u8_t *data, u16_t datalen)
|
identify_data(CC_REGISTER_ARG uint8_t *data, uint16_t datalen)
|
||||||
{
|
{
|
||||||
switch(vs->waitmsg) {
|
switch(vs->waitmsg) {
|
||||||
case VNC_WAIT_VERSION:
|
case VNC_WAIT_VERSION:
|
||||||
|
@ -405,7 +405,7 @@ identify_data(CC_REGISTER_ARG u8_t *data, u16_t datalen)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
uip_abort();
|
uip_abort();
|
||||||
PRINTF(("Weird message type received (%d)\n", *(u8_t *)uip_appdata));
|
PRINTF(("Weird message type received (%d)\n", *(uint8_t *)uip_appdata));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -425,7 +425,7 @@ identify_data(CC_REGISTER_ARG u8_t *data, u16_t datalen)
|
||||||
* Handles the data.
|
* Handles the data.
|
||||||
*/
|
*/
|
||||||
static unsigned short
|
static unsigned short
|
||||||
handle_data(CC_REGISTER_ARG u8_t *data, u16_t datalen)
|
handle_data(CC_REGISTER_ARG uint8_t *data, uint16_t datalen)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch(vs->waitmsg) {
|
switch(vs->waitmsg) {
|
||||||
|
@ -461,7 +461,7 @@ handle_data(CC_REGISTER_ARG u8_t *data, u16_t datalen)
|
||||||
uip_htons(((struct rfb_server_init *)data)->height),
|
uip_htons(((struct rfb_server_init *)data)->height),
|
||||||
((struct rfb_server_init *)data)->format.bps,
|
((struct rfb_server_init *)data)->format.bps,
|
||||||
((struct rfb_server_init *)data)->format.depth,
|
((struct rfb_server_init *)data)->format.depth,
|
||||||
((u8_t *)data + sizeof(struct rfb_server_init))));*/
|
((uint8_t *)data + sizeof(struct rfb_server_init))));*/
|
||||||
vs->w = uip_htons(((struct rfb_server_init *)data)->width);
|
vs->w = uip_htons(((struct rfb_server_init *)data)->width);
|
||||||
vs->h = uip_htons(((struct rfb_server_init *)data)->height);
|
vs->h = uip_htons(((struct rfb_server_init *)data)->height);
|
||||||
vs->sendmsg = VNC_SEND_PFMT;
|
vs->sendmsg = VNC_SEND_PFMT;
|
||||||
|
@ -490,7 +490,7 @@ handle_data(CC_REGISTER_ARG u8_t *data, u16_t datalen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
PRINTF(("Weird message type received (%d)\n", *(u8_t *)data));
|
PRINTF(("Weird message type received (%d)\n", *(uint8_t *)data));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -525,15 +525,15 @@ handle_data(CC_REGISTER_ARG u8_t *data, u16_t datalen)
|
||||||
* care of the next time this function is invoked (i.e., for the next
|
* care of the next time this function is invoked (i.e., for the next
|
||||||
* incoming data chunk).
|
* incoming data chunk).
|
||||||
*/
|
*/
|
||||||
static u8_t
|
static uint8_t
|
||||||
newdata(void)
|
newdata(void)
|
||||||
{
|
{
|
||||||
u16_t datalen;
|
uint16_t datalen;
|
||||||
u16_t readlen;
|
uint16_t readlen;
|
||||||
u8_t *dataptr;
|
uint8_t *dataptr;
|
||||||
|
|
||||||
datalen = uip_datalen();
|
datalen = uip_datalen();
|
||||||
dataptr = (u8_t *)uip_appdata;
|
dataptr = (uint8_t *)uip_appdata;
|
||||||
|
|
||||||
PRINTF(("newdata: %d bytes\n", datalen));
|
PRINTF(("newdata: %d bytes\n", datalen));
|
||||||
|
|
||||||
|
@ -558,7 +558,7 @@ newdata(void)
|
||||||
sequence for the data that is left in the incoming chunk. */
|
sequence for the data that is left in the incoming chunk. */
|
||||||
datalen -= vs->bufferleft;
|
datalen -= vs->bufferleft;
|
||||||
dataptr += vs->bufferleft;
|
dataptr += vs->bufferleft;
|
||||||
buffer_data((u8_t *)uip_appdata, vs->bufferleft);
|
buffer_data((uint8_t *)uip_appdata, vs->bufferleft);
|
||||||
handle_data(vs->buffer, vs->buffersize);
|
handle_data(vs->buffer, vs->buffersize);
|
||||||
clearbuffer();
|
clearbuffer();
|
||||||
} else { /* datalen < vs->bufferleft */
|
} else { /* datalen < vs->bufferleft */
|
||||||
|
@ -710,9 +710,9 @@ vnc_viewer_appcall(void * nullptr)
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
vnc_viewer_post_event(u8_t type,
|
vnc_viewer_post_event(uint8_t type,
|
||||||
u16_t data1, u16_t data2,
|
uint16_t data1, uint16_t data2,
|
||||||
u16_t data3, u16_t data4)
|
uint16_t data3, uint16_t data4)
|
||||||
{
|
{
|
||||||
register struct vnc_event *ev;
|
register struct vnc_event *ev;
|
||||||
struct vnc_event *ev0;
|
struct vnc_event *ev0;
|
||||||
|
|
|
@ -39,12 +39,12 @@
|
||||||
|
|
||||||
struct vnc_viewer_state;
|
struct vnc_viewer_state;
|
||||||
|
|
||||||
/*typedef unsigned long u32_t;*/
|
/*typedef unsigned long uint32_t;*/
|
||||||
|
|
||||||
void vnc_viewer_init(void);
|
void vnc_viewer_init(void);
|
||||||
void vnc_viewer_appcall(void *nullptr);
|
void vnc_viewer_appcall(void *nullptr);
|
||||||
|
|
||||||
void vnc_viewer_connect(u16_t *server, u8_t display);
|
void vnc_viewer_connect(uint16_t *server, uint8_t display);
|
||||||
void vnc_viewer_close(void);
|
void vnc_viewer_close(void);
|
||||||
|
|
||||||
/* Callback: redraws the VNC viewer bitmap area. */
|
/* Callback: redraws the VNC viewer bitmap area. */
|
||||||
|
@ -63,9 +63,9 @@ void vnc_viewer_refresh(void);
|
||||||
#define VNC_VIEWER_POST_UPDATERQ_EVENT(x1,y1,x2,y2) \
|
#define VNC_VIEWER_POST_UPDATERQ_EVENT(x1,y1,x2,y2) \
|
||||||
vnc_viewer_post_event(VNC_UPDATERQ_EVENT, x1, y1, x2, y2)
|
vnc_viewer_post_event(VNC_UPDATERQ_EVENT, x1, y1, x2, y2)
|
||||||
|
|
||||||
void vnc_viewer_post_event(u8_t event,
|
void vnc_viewer_post_event(uint8_t event,
|
||||||
u16_t data1, u16_t data2,
|
uint16_t data1, uint16_t data2,
|
||||||
u16_t data3, u16_t data4);
|
uint16_t data3, uint16_t data4);
|
||||||
|
|
||||||
/* UIP_APPCALL: the name of the application function. This function
|
/* UIP_APPCALL: the name of the application function. This function
|
||||||
must return void and take no arguments (i.e., C type "void
|
must return void and take no arguments (i.e., C type "void
|
||||||
|
@ -75,22 +75,22 @@ void vnc_viewer_post_event(u8_t event,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct vnc_key_event {
|
struct vnc_key_event {
|
||||||
u8_t down;
|
uint8_t down;
|
||||||
u16_t key;
|
uint16_t key;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vnc_pointer_event {
|
struct vnc_pointer_event {
|
||||||
u8_t buttonmask;
|
uint8_t buttonmask;
|
||||||
u16_t x, y;
|
uint16_t x, y;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vnc_updaterq_event {
|
struct vnc_updaterq_event {
|
||||||
u16_t x, y;
|
uint16_t x, y;
|
||||||
u16_t w, h;
|
uint16_t w, h;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vnc_event {
|
struct vnc_event {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
union {
|
union {
|
||||||
struct vnc_key_event key;
|
struct vnc_key_event key;
|
||||||
struct vnc_pointer_event ptr;
|
struct vnc_pointer_event ptr;
|
||||||
|
@ -133,34 +133,34 @@ enum vnc_rectstate {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vnc_viewer_state {
|
struct vnc_viewer_state {
|
||||||
u8_t close;
|
uint8_t close;
|
||||||
u16_t w, h;
|
uint16_t w, h;
|
||||||
|
|
||||||
u8_t sendmsg;
|
uint8_t sendmsg;
|
||||||
|
|
||||||
u8_t waitmsg;
|
uint8_t waitmsg;
|
||||||
|
|
||||||
u16_t rectsleft;
|
uint16_t rectsleft;
|
||||||
|
|
||||||
u8_t rectstate;
|
uint8_t rectstate;
|
||||||
u32_t rectstateleft;
|
uint32_t rectstateleft;
|
||||||
u16_t rectstatex, rectstatey;
|
uint16_t rectstatex, rectstatey;
|
||||||
u16_t rectstateh, rectstatew;
|
uint16_t rectstateh, rectstatew;
|
||||||
u16_t rectstatex0, rectstatey0;
|
uint16_t rectstatex0, rectstatey0;
|
||||||
u16_t rectstatex2, rectstatey2;
|
uint16_t rectstatex2, rectstatey2;
|
||||||
|
|
||||||
|
|
||||||
u16_t eventptr_acked;
|
uint16_t eventptr_acked;
|
||||||
u16_t eventptr_unacked;
|
uint16_t eventptr_unacked;
|
||||||
u16_t eventptr_next;
|
uint16_t eventptr_next;
|
||||||
#define VNC_EVENTQUEUE_SIZE 32
|
#define VNC_EVENTQUEUE_SIZE 32
|
||||||
struct vnc_event event_queue[VNC_EVENTQUEUE_SIZE];
|
struct vnc_event event_queue[VNC_EVENTQUEUE_SIZE];
|
||||||
|
|
||||||
|
|
||||||
u16_t bufferleft;
|
uint16_t bufferleft;
|
||||||
u16_t buffersize;
|
uint16_t buffersize;
|
||||||
#define VNC_BUFFERSIZE 64
|
#define VNC_BUFFERSIZE 64
|
||||||
u8_t buffer[VNC_BUFFERSIZE];
|
uint8_t buffer[VNC_BUFFERSIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
extern static struct vnc_viewer_state vnc_viewer_state;
|
extern static struct vnc_viewer_state vnc_viewer_state;
|
||||||
|
@ -173,25 +173,25 @@ extern static struct vnc_viewer_state vnc_viewer_state;
|
||||||
|
|
||||||
/* Generic rectangle - x, y coordinates, width and height. */
|
/* Generic rectangle - x, y coordinates, width and height. */
|
||||||
struct rfb_rect {
|
struct rfb_rect {
|
||||||
u16_t x;
|
uint16_t x;
|
||||||
u16_t y;
|
uint16_t y;
|
||||||
u16_t w;
|
uint16_t w;
|
||||||
u16_t h;
|
uint16_t h;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Pixel format definition. */
|
/* Pixel format definition. */
|
||||||
struct rfb_pixel_format {
|
struct rfb_pixel_format {
|
||||||
u8_t bps; /* Bits per pixel: 8, 16 or 32. */
|
uint8_t bps; /* Bits per pixel: 8, 16 or 32. */
|
||||||
u8_t depth; /* Color depth: 8-32 */
|
uint8_t depth; /* Color depth: 8-32 */
|
||||||
u8_t endian; /* 1 - big endian (motorola), 0 - little endian
|
uint8_t endian; /* 1 - big endian (motorola), 0 - little endian
|
||||||
(x86) */
|
(x86) */
|
||||||
u8_t truecolor; /* 1 - true color is used, 0 - true color is not used. */
|
uint8_t truecolor; /* 1 - true color is used, 0 - true color is not used. */
|
||||||
|
|
||||||
/* The following fields are only used if true color is used. */
|
/* The following fields are only used if true color is used. */
|
||||||
u16_t red_max, green_max, blue_max;
|
uint16_t red_max, green_max, blue_max;
|
||||||
u8_t red_shift, green_shift, blue_shift;
|
uint8_t red_shift, green_shift, blue_shift;
|
||||||
u8_t pad1;
|
uint8_t pad1;
|
||||||
u16_t pad2;
|
uint16_t pad2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -234,94 +234,94 @@ struct rfb_pixel_format {
|
||||||
/* Server to client messages. */
|
/* Server to client messages. */
|
||||||
|
|
||||||
struct rfb_server_init {
|
struct rfb_server_init {
|
||||||
u16_t width;
|
uint16_t width;
|
||||||
u16_t height;
|
uint16_t height;
|
||||||
struct rfb_pixel_format format;
|
struct rfb_pixel_format format;
|
||||||
u8_t namelength[4];
|
uint8_t namelength[4];
|
||||||
/* Followed by name. */
|
/* Followed by name. */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_fb_update {
|
struct rfb_fb_update {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t pad;
|
uint8_t pad;
|
||||||
u16_t rects; /* Number of rectanges (struct rfb_fb_update_rect_hdr +
|
uint16_t rects; /* Number of rectanges (struct rfb_fb_update_rect_hdr +
|
||||||
data) that follows. */
|
data) that follows. */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_fb_update_rect_hdr {
|
struct rfb_fb_update_rect_hdr {
|
||||||
struct rfb_rect rect;
|
struct rfb_rect rect;
|
||||||
u8_t encoding[4];
|
uint8_t encoding[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_copy_rect {
|
struct rfb_copy_rect {
|
||||||
u16_t srcx;
|
uint16_t srcx;
|
||||||
u16_t srcy;
|
uint16_t srcy;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_rre_hdr {
|
struct rfb_rre_hdr {
|
||||||
u16_t subrects[2]; /* Number of subrectangles (struct
|
uint16_t subrects[2]; /* Number of subrectangles (struct
|
||||||
rfb_rre_subrect) to follow. */
|
rfb_rre_subrect) to follow. */
|
||||||
u8_t bgpixel;
|
uint8_t bgpixel;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_rre_subrect {
|
struct rfb_rre_subrect {
|
||||||
u8_t pixel;
|
uint8_t pixel;
|
||||||
struct rfb_rect rect;
|
struct rfb_rect rect;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_corre_rect {
|
struct rfb_corre_rect {
|
||||||
u8_t x;
|
uint8_t x;
|
||||||
u8_t y;
|
uint8_t y;
|
||||||
u8_t w;
|
uint8_t w;
|
||||||
u8_t h;
|
uint8_t h;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Client to server messages. */
|
/* Client to server messages. */
|
||||||
|
|
||||||
struct rfb_set_pixel_format {
|
struct rfb_set_pixel_format {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t pad;
|
uint8_t pad;
|
||||||
u16_t pad2;
|
uint16_t pad2;
|
||||||
struct rfb_pixel_format format;
|
struct rfb_pixel_format format;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_fix_colormap_entries {
|
struct rfb_fix_colormap_entries {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t pad;
|
uint8_t pad;
|
||||||
u16_t firstcolor;
|
uint16_t firstcolor;
|
||||||
u16_t colors;
|
uint16_t colors;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_set_encodings {
|
struct rfb_set_encodings {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t pad;
|
uint8_t pad;
|
||||||
u16_t encodings;
|
uint16_t encodings;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_fb_update_request {
|
struct rfb_fb_update_request {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t incremental;
|
uint8_t incremental;
|
||||||
u16_t x;
|
uint16_t x;
|
||||||
u16_t y;
|
uint16_t y;
|
||||||
u16_t w;
|
uint16_t w;
|
||||||
u16_t h;
|
uint16_t h;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_key_event {
|
struct rfb_key_event {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t down;
|
uint8_t down;
|
||||||
u16_t pad;
|
uint16_t pad;
|
||||||
u8_t key[4];
|
uint8_t key[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
#define RFB_BUTTON_MASK1 1
|
#define RFB_BUTTON_MASK1 1
|
||||||
#define RFB_BUTTON_MASK2 2
|
#define RFB_BUTTON_MASK2 2
|
||||||
#define RFB_BUTTON_MASK3 4
|
#define RFB_BUTTON_MASK3 4
|
||||||
struct rfb_pointer_event {
|
struct rfb_pointer_event {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t buttonmask;
|
uint8_t buttonmask;
|
||||||
u16_t x;
|
uint16_t x;
|
||||||
u16_t y;
|
uint16_t y;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __VNC_VIEWER_H__ */
|
#endif /* __VNC_VIEWER_H__ */
|
||||||
|
|
|
@ -125,7 +125,7 @@ static void
|
||||||
connect(void)
|
connect(void)
|
||||||
{
|
{
|
||||||
uip_ipaddr_t addr, *addrptr;
|
uip_ipaddr_t addr, *addrptr;
|
||||||
u16_t port;
|
uint16_t port;
|
||||||
char *cptr;
|
char *cptr;
|
||||||
|
|
||||||
/* Find the first space character in host and put a zero there
|
/* Find the first space character in host and put a zero there
|
||||||
|
|
|
@ -553,11 +553,11 @@ parse_tag(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static u16_t
|
static uint16_t
|
||||||
parse_word(char *data, u8_t dlen)
|
parse_word(char *data, uint8_t dlen)
|
||||||
{
|
{
|
||||||
static u8_t i;
|
static uint8_t i;
|
||||||
static u8_t len;
|
static uint8_t len;
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
|
|
||||||
len = dlen;
|
len = dlen;
|
||||||
|
@ -825,15 +825,15 @@ parse_word(char *data, u8_t dlen)
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
htmlparser_parse(char *data, u16_t datalen)
|
htmlparser_parse(char *data, uint16_t datalen)
|
||||||
{
|
{
|
||||||
u16_t plen;
|
uint16_t plen;
|
||||||
|
|
||||||
while(datalen > 0) {
|
while(datalen > 0) {
|
||||||
if(datalen > 255) {
|
if(datalen > 255) {
|
||||||
plen = parse_word(data, 255);
|
plen = parse_word(data, 255);
|
||||||
} else {
|
} else {
|
||||||
plen = parse_word(data, (u8_t)datalen);
|
plen = parse_word(data, (uint8_t)datalen);
|
||||||
}
|
}
|
||||||
datalen -= plen;
|
datalen -= plen;
|
||||||
data += plen;
|
data += plen;
|
||||||
|
|
|
@ -73,7 +73,7 @@ void htmlparser_renderstate(unsigned char state);
|
||||||
|
|
||||||
/* Functions. */
|
/* Functions. */
|
||||||
void htmlparser_init(void);
|
void htmlparser_init(void);
|
||||||
void htmlparser_parse(char *data, u16_t len);
|
void htmlparser_parse(char *data, uint16_t len);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __HTMLPARSER_H__ */
|
#endif /* __HTMLPARSER_H__ */
|
||||||
|
|
|
@ -58,18 +58,18 @@
|
||||||
#define ISO_space 0x20
|
#define ISO_space 0x20
|
||||||
|
|
||||||
struct webclient_state {
|
struct webclient_state {
|
||||||
u8_t timer;
|
uint8_t timer;
|
||||||
u8_t state;
|
uint8_t state;
|
||||||
u8_t httpflag;
|
uint8_t httpflag;
|
||||||
|
|
||||||
u16_t port;
|
uint16_t port;
|
||||||
char host[40];
|
char host[40];
|
||||||
char file[WWW_CONF_MAX_URLLEN];
|
char file[WWW_CONF_MAX_URLLEN];
|
||||||
u16_t getrequestptr;
|
uint16_t getrequestptr;
|
||||||
u16_t getrequestleft;
|
uint16_t getrequestleft;
|
||||||
|
|
||||||
char httpheaderline[200];
|
char httpheaderline[200];
|
||||||
u16_t httpheaderlineptr;
|
uint16_t httpheaderlineptr;
|
||||||
|
|
||||||
char mimetype[32];
|
char mimetype[32];
|
||||||
};
|
};
|
||||||
|
@ -117,8 +117,8 @@ init_connection(void)
|
||||||
sizeof(http_crnl) - 1 +
|
sizeof(http_crnl) - 1 +
|
||||||
sizeof(http_host) - 1 +
|
sizeof(http_host) - 1 +
|
||||||
sizeof(http_crnl) - 1 +
|
sizeof(http_crnl) - 1 +
|
||||||
(u16_t)strlen(http_user_agent_fields) +
|
(uint16_t)strlen(http_user_agent_fields) +
|
||||||
(u16_t)strlen(s.file) + (u16_t)strlen(s.host);
|
(uint16_t)strlen(s.file) + (uint16_t)strlen(s.host);
|
||||||
s.getrequestptr = 0;
|
s.getrequestptr = 0;
|
||||||
|
|
||||||
s.httpheaderlineptr = 0;
|
s.httpheaderlineptr = 0;
|
||||||
|
@ -131,7 +131,7 @@ webclient_close(void)
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
unsigned char
|
unsigned char
|
||||||
webclient_get(const char *host, u16_t port, const char *file)
|
webclient_get(const char *host, uint16_t port, const char *file)
|
||||||
{
|
{
|
||||||
uip_ipaddr_t addr;
|
uip_ipaddr_t addr;
|
||||||
struct uip_conn *conn;
|
struct uip_conn *conn;
|
||||||
|
@ -212,7 +212,7 @@ window_copy(int curptr, const char *data, unsigned char datalen)
|
||||||
static void
|
static void
|
||||||
senddata(void)
|
senddata(void)
|
||||||
{
|
{
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
int curptr;
|
int curptr;
|
||||||
|
|
||||||
if(s.getrequestleft > 0) {
|
if(s.getrequestleft > 0) {
|
||||||
|
@ -246,7 +246,7 @@ senddata(void)
|
||||||
static void
|
static void
|
||||||
acked(void)
|
acked(void)
|
||||||
{
|
{
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
|
|
||||||
if(s.getrequestleft > 0) {
|
if(s.getrequestleft > 0) {
|
||||||
len = s.getrequestleft > uip_mss()?
|
len = s.getrequestleft > uip_mss()?
|
||||||
|
@ -257,8 +257,8 @@ acked(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static u16_t
|
static uint16_t
|
||||||
parse_statusline(u16_t len)
|
parse_statusline(uint16_t len)
|
||||||
{
|
{
|
||||||
char *cptr;
|
char *cptr;
|
||||||
|
|
||||||
|
@ -324,8 +324,8 @@ casecmp(char *str1, const char *str2, char len)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static u16_t
|
static uint16_t
|
||||||
parse_headers(u16_t len)
|
parse_headers(uint16_t len)
|
||||||
{
|
{
|
||||||
char *cptr;
|
char *cptr;
|
||||||
static unsigned char i;
|
static unsigned char i;
|
||||||
|
@ -393,7 +393,7 @@ parse_headers(u16_t len)
|
||||||
static void
|
static void
|
||||||
newdata(void)
|
newdata(void)
|
||||||
{
|
{
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
|
|
||||||
len = uip_datalen();
|
len = uip_datalen();
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
/* Callback functions that have to be implemented by the application
|
/* Callback functions that have to be implemented by the application
|
||||||
program. */
|
program. */
|
||||||
struct webclient_state;
|
struct webclient_state;
|
||||||
void webclient_datahandler(char *data, u16_t len);
|
void webclient_datahandler(char *data, uint16_t len);
|
||||||
void webclient_connected(void);
|
void webclient_connected(void);
|
||||||
void webclient_timedout(void);
|
void webclient_timedout(void);
|
||||||
void webclient_aborted(void);
|
void webclient_aborted(void);
|
||||||
|
@ -52,7 +52,7 @@ void webclient_closed(void);
|
||||||
|
|
||||||
/* Functions. */
|
/* Functions. */
|
||||||
void webclient_init(void);
|
void webclient_init(void);
|
||||||
unsigned char webclient_get(const char *host, u16_t port, const char *file);
|
unsigned char webclient_get(const char *host, uint16_t port, const char *file);
|
||||||
void webclient_close(void);
|
void webclient_close(void);
|
||||||
|
|
||||||
void webclient_appcall(void *state);
|
void webclient_appcall(void *state);
|
||||||
|
|
|
@ -553,7 +553,7 @@ PROCESS_THREAD(www_process, ev, data)
|
||||||
* text entry widget in the browser window).
|
* text entry widget in the browser window).
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
set_url(char *host, u16_t port, char *file)
|
set_url(char *host, uint16_t port, char *file)
|
||||||
{
|
{
|
||||||
char *urlptr;
|
char *urlptr;
|
||||||
|
|
||||||
|
@ -636,7 +636,7 @@ webclient_connected(void)
|
||||||
* has arrived.
|
* has arrived.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
webclient_datahandler(char *data, u16_t len)
|
webclient_datahandler(char *data, uint16_t len)
|
||||||
{
|
{
|
||||||
if(len > 0) {
|
if(len > 0) {
|
||||||
if(strcmp(webclient_mimetype(), http_texthtml) == 0) {
|
if(strcmp(webclient_mimetype(), http_texthtml) == 0) {
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/* Line endings in git repository are LF instead of CR-LF ? */
|
|
||||||
/*
|
/*
|
||||||
* This file includes functions that are called by the web server
|
* This file includes functions that are called by the web server
|
||||||
* scripts. The functions takes no argument, and the return value is
|
* scripts. The functions takes no argument, and the return value is
|
||||||
|
@ -185,19 +184,38 @@ static unsigned short
|
||||||
generate_header(void *arg)
|
generate_header(void *arg)
|
||||||
{
|
{
|
||||||
unsigned short numprinted=0;
|
unsigned short numprinted=0;
|
||||||
|
|
||||||
#if WEBSERVER_CONF_HEADER_W3C
|
#if WEBSERVER_CONF_HEADER_W3C
|
||||||
#define _MSS1 100
|
#define _MSS1 100
|
||||||
static const char httpd_cgi_headerw[] HTTPD_STRING_ATTR = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
|
static const char httpd_cgi_headerw[] HTTPD_STRING_ATTR = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
|
||||||
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_headerw);
|
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_headerw);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if WEBSERVER_CONF_HEADER_ICON
|
#if WEBSERVER_CONF_HEADER_ICON
|
||||||
#define _MSS2 105
|
#define _MSS2 105
|
||||||
static const char httpd_cgi_header1[] HTTPD_STRING_ATTR = "<html><head><title>Contiki-nano</title><link rel=\"icon\" href=\"favicon.gif\" type=\"image/gif\"></head><body>";
|
#ifdef WEBSERVER_CONF_PAGETITLE
|
||||||
|
static const char httpd_cgi_header1[] HTTPD_STRING_ATTR = "<html><head><title>%s</title><link rel=\"icon\" href=\"favicon.gif\" type=\"image/gif\"></head><body>";
|
||||||
|
#else
|
||||||
|
static const char httpd_cgi_header1[] HTTPD_STRING_ATTR = "<html><head><title>Contiki-Nano</title><link rel=\"icon\" href=\"favicon.gif\" type=\"image/gif\"></head><body>";
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#define _MSS2 52
|
#define _MSS2 52
|
||||||
static const char httpd_cgi_header1[] HTTPD_STRING_ATTR = "<html><head><title>Contiki-nano</title></head><body>";
|
#ifdef WEBSERVER_CONF_PAGETITLE
|
||||||
|
static const char httpd_cgi_header1[] HTTPD_STRING_ATTR = "<html><head><title>%s</title></head><body>";
|
||||||
|
#else
|
||||||
|
static const char httpd_cgi_header1[] HTTPD_STRING_ATTR = "<html><head><title>Contiki-Nano</title></head><body>";
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WEBSERVER_CONF_PAGETITLE
|
||||||
|
#define WAD ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])->destipaddr.u8
|
||||||
|
{ char buf[40];
|
||||||
|
WEBSERVER_CONF_PAGETITLE;
|
||||||
|
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_header1,buf);
|
||||||
|
}
|
||||||
|
#else
|
||||||
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_header1);
|
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_header1);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if WEBSERVER_CONF_HEADER_MENU
|
#if WEBSERVER_CONF_HEADER_MENU
|
||||||
#define _MSS3 32
|
#define _MSS3 32
|
||||||
|
@ -273,7 +291,7 @@ generate_file_stats(void *arg)
|
||||||
static const char httpd_cgi_filestat3[] HTTPD_STRING_ATTR = "%5u";
|
static const char httpd_cgi_filestat3[] HTTPD_STRING_ATTR = "%5u";
|
||||||
char tmp[20];
|
char tmp[20];
|
||||||
struct httpd_fsdata_file_noconst *f,fram;
|
struct httpd_fsdata_file_noconst *f,fram;
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
unsigned short numprinted;
|
unsigned short numprinted;
|
||||||
/* Transfer arg from whichever flash that contains the html file to RAM */
|
/* Transfer arg from whichever flash that contains the html file to RAM */
|
||||||
httpd_fs_cpy(&tmp, s->u.ptr, 20);
|
httpd_fs_cpy(&tmp, s->u.ptr, 20);
|
||||||
|
@ -538,7 +556,7 @@ generate_sensor_readings(void *arg)
|
||||||
static const char httpd_cgi_sensor2[] HTTPD_STRING_ATTR = "<em>Battery :</em> %s\n";
|
static const char httpd_cgi_sensor2[] HTTPD_STRING_ATTR = "<em>Battery :</em> %s\n";
|
||||||
// static const char httpd_cgi_sensr12[] HTTPD_STRING_ATTR = "<em>Temperature:</em> %s <em>Battery:</em> %s<br>";
|
// static const char httpd_cgi_sensr12[] HTTPD_STRING_ATTR = "<em>Temperature:</em> %s <em>Battery:</em> %s<br>";
|
||||||
static const char httpd_cgi_sensor3[] HTTPD_STRING_ATTR = "<em>Uptime :</em> %02d:%02d:%02d\n";
|
static const char httpd_cgi_sensor3[] HTTPD_STRING_ATTR = "<em>Uptime :</em> %02d:%02d:%02d\n";
|
||||||
static const char httpd_cgi_sensor3d[] HTTPD_STRING_ATTR = "<em>Uptime :</em> %u days %02u:%02u:%02u/n";
|
static const char httpd_cgi_sensor3d[] HTTPD_STRING_ATTR = "<em>Uptime :</em> %u days %02u:%02u:%02u\n";
|
||||||
// static const char httpd_cgi_sensor4[] HTTPD_STRING_ATTR = "<em>Sleeping time :</em> %02d:%02d:%02d (%d%%)<br>";
|
// static const char httpd_cgi_sensor4[] HTTPD_STRING_ATTR = "<em>Sleeping time :</em> %02d:%02d:%02d (%d%%)<br>";
|
||||||
|
|
||||||
numprinted=0;
|
numprinted=0;
|
||||||
|
@ -624,7 +642,17 @@ uint8_t c;
|
||||||
numprinted =httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_sensor0,(unsigned int) (seconds-last_tempupdate));
|
numprinted =httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_sensor0,(unsigned int) (seconds-last_tempupdate));
|
||||||
}
|
}
|
||||||
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_sensor1, sensor_temperature);
|
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_sensor1, sensor_temperature);
|
||||||
|
#if CONTIKI_TARGET_REDBEE_ECONOTAG
|
||||||
|
/* Econotag at 3v55 with 10 ohms to LiFePO4 battery: 3680mv usb 3106 battery (meter 3.08). Take 3500 as breakpoint for USB connected */
|
||||||
|
static const char httpd_cgi_sensor2u[] HTTPD_STRING_ATTR = "<em>Vcc (USB) :</em> %s\n";
|
||||||
|
if(adc_reading[8]<1404) {
|
||||||
|
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_sensor2u, sensor_extvoltage);
|
||||||
|
} else {
|
||||||
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_sensor2, sensor_extvoltage);
|
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_sensor2, sensor_extvoltage);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_sensor2, sensor_extvoltage);
|
||||||
|
#endif
|
||||||
// numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_sensr12, sensor_temperature,sensor_extvoltage);
|
// numprinted+=httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_sensr12, sensor_temperature,sensor_extvoltage);
|
||||||
|
|
||||||
#if RADIOSTATS
|
#if RADIOSTATS
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "httpd-fsdata.c"
|
#include "httpd-fsdata.c"
|
||||||
|
|
||||||
#if WEBSERVER_CONF_FILESTATS==1
|
#if WEBSERVER_CONF_FILESTATS==1
|
||||||
u16_t httpd_filecount[HTTPD_FS_NUMFILES];
|
uint16_t httpd_filecount[HTTPD_FS_NUMFILES];
|
||||||
#endif
|
#endif
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
void *
|
void *
|
||||||
|
@ -52,7 +52,7 @@ httpd_fs_get_root()
|
||||||
return (void *)HTTPD_FS_ROOT;
|
return (void *)HTTPD_FS_ROOT;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
httpd_fs_get_size()
|
httpd_fs_get_size()
|
||||||
{
|
{
|
||||||
return HTTPD_FS_SIZE;
|
return HTTPD_FS_SIZE;
|
||||||
|
@ -62,7 +62,7 @@ uint16_t
|
||||||
httpd_fs_open(const char *name, struct httpd_fs_file *file)
|
httpd_fs_open(const char *name, struct httpd_fs_file *file)
|
||||||
{
|
{
|
||||||
#if WEBSERVER_CONF_FILESTATS
|
#if WEBSERVER_CONF_FILESTATS
|
||||||
u16_t i = 0;
|
uint16_t i = 0;
|
||||||
#endif
|
#endif
|
||||||
struct httpd_fsdata_file_noconst *f,fram;
|
struct httpd_fsdata_file_noconst *f,fram;
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ void
|
||||||
httpd_fs_init(void)
|
httpd_fs_init(void)
|
||||||
{
|
{
|
||||||
#if WEBSERVER_CONF_FILESTATS==1
|
#if WEBSERVER_CONF_FILESTATS==1
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
for(i = 0; i < HTTPD_FS_NUMFILES; i++) {
|
for(i = 0; i < HTTPD_FS_NUMFILES; i++) {
|
||||||
httpd_filecount[i] = 0;
|
httpd_filecount[i] = 0;
|
||||||
}
|
}
|
||||||
|
@ -113,11 +113,11 @@ httpd_fs_init(void)
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#if WEBSERVER_CONF_FILESTATS && 0
|
#if WEBSERVER_CONF_FILESTATS && 0
|
||||||
u16_t
|
uint16_t
|
||||||
httpd_fs_count(char *name)
|
httpd_fs_count(char *name)
|
||||||
{
|
{
|
||||||
struct httpd_fsdata_file_noconst *f;
|
struct httpd_fsdata_file_noconst *f;
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;
|
for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;
|
||||||
|
|
|
@ -44,8 +44,8 @@ struct httpd_fs_file {
|
||||||
uint16_t httpd_fs_open(const char *name, struct httpd_fs_file *file);
|
uint16_t httpd_fs_open(const char *name, struct httpd_fs_file *file);
|
||||||
|
|
||||||
#if WEBSERVER_CONF_FILESTATS
|
#if WEBSERVER_CONF_FILESTATS
|
||||||
extern u16_t httpd_filecount[];
|
extern uint16_t httpd_filecount[];
|
||||||
u16_t httpd_fs_count(char *name);
|
uint16_t httpd_fs_count(char *name);
|
||||||
void* httpd_fs_get_root(void);
|
void* httpd_fs_get_root(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
%! header
|
%! header
|
||||||
<h4>Addresses</h4>
|
<p>Addresses<br>
|
||||||
%! addresses
|
%! addresses
|
||||||
<h4>Neighbors</h4>
|
<p>Neighbors<br>
|
||||||
%! neighbors
|
%! neighbors
|
||||||
<h4>Routes</h4>
|
<p>Routes<br>
|
||||||
%! routes
|
%! routes
|
||||||
<h4>Sensors</h4>
|
<p>Sensors<br>
|
||||||
%! sensors
|
%! sensors
|
||||||
%! file-stats .
|
%! file-stats .
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*********Generated by contiki/tools/makefsdata on 2011-09-10*********/
|
/*********Generated by contiki/tools/makefsdata on 2012-02-21*********/
|
||||||
|
|
||||||
|
|
||||||
const char data_404_html[86] HTTPD_STRING_ATTR = {
|
const char data_404_html[86] HTTPD_STRING_ATTR = {
|
||||||
|
@ -48,24 +48,23 @@ const char data_index_shtml[120] HTTPD_STRING_ATTR = {
|
||||||
0x21, 0x0a, 0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d,
|
0x21, 0x0a, 0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d,
|
||||||
0x73, 0x74, 0x61, 0x74, 0x73, 0x20, 0x2e};
|
0x73, 0x74, 0x61, 0x74, 0x73, 0x20, 0x2e};
|
||||||
|
|
||||||
const char data_status_shtml[158] HTTPD_STRING_ATTR = {
|
const char data_status_shtml[150] HTTPD_STRING_ATTR = {
|
||||||
/* /status.shtml */
|
/* /status.shtml */
|
||||||
0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x00,
|
0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x00,
|
||||||
0x25, 0x21, 0x20, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x0a,
|
0x25, 0x21, 0x20, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x0a,
|
||||||
0x3c, 0x68, 0x34, 0x3e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73,
|
0x3c, 0x70, 0x3e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
|
||||||
0x73, 0x65, 0x73, 0x3c, 0x2f, 0x68, 0x34, 0x3e, 0x0a, 0x25,
|
0x65, 0x73, 0x3c, 0x62, 0x72, 0x3e, 0x0a, 0x25, 0x21, 0x20,
|
||||||
0x21, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65,
|
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x0a,
|
||||||
0x73, 0x0a, 0x3c, 0x68, 0x34, 0x3e, 0x4e, 0x65, 0x69, 0x67,
|
0x3c, 0x70, 0x3e, 0x4e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f,
|
||||||
0x68, 0x62, 0x6f, 0x72, 0x73, 0x3c, 0x2f, 0x68, 0x34, 0x3e,
|
0x72, 0x73, 0x3c, 0x62, 0x72, 0x3e, 0x0a, 0x25, 0x21, 0x20,
|
||||||
0x0a, 0x25, 0x21, 0x20, 0x6e, 0x65, 0x69, 0x67, 0x68, 0x62,
|
0x6e, 0x65, 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, 0x73, 0x0a,
|
||||||
0x6f, 0x72, 0x73, 0x0a, 0x3c, 0x68, 0x34, 0x3e, 0x52, 0x6f,
|
0x3c, 0x70, 0x3e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x3c,
|
||||||
0x75, 0x74, 0x65, 0x73, 0x3c, 0x2f, 0x68, 0x34, 0x3e, 0x0a,
|
0x62, 0x72, 0x3e, 0x0a, 0x25, 0x21, 0x20, 0x72, 0x6f, 0x75,
|
||||||
0x25, 0x21, 0x20, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x0a,
|
0x74, 0x65, 0x73, 0x0a, 0x3c, 0x70, 0x3e, 0x53, 0x65, 0x6e,
|
||||||
0x3c, 0x68, 0x34, 0x3e, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72,
|
0x73, 0x6f, 0x72, 0x73, 0x3c, 0x62, 0x72, 0x3e, 0x0a, 0x25,
|
||||||
0x73, 0x3c, 0x2f, 0x68, 0x34, 0x3e, 0x0a, 0x25, 0x21, 0x20,
|
0x21, 0x20, 0x73, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x0a,
|
||||||
0x73, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x0a, 0x25, 0x21,
|
0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74,
|
||||||
0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74, 0x61, 0x74,
|
0x61, 0x74, 0x73, 0x20, 0x2e, 0x0a};
|
||||||
0x73, 0x20, 0x2e, 0x0a};
|
|
||||||
|
|
||||||
const char data_tcp_shtml[227] HTTPD_STRING_ATTR = {
|
const char data_tcp_shtml[227] HTTPD_STRING_ATTR = {
|
||||||
/* /tcp.shtml */
|
/* /tcp.shtml */
|
||||||
|
@ -101,7 +100,7 @@ struct httpd_fsdata_file {
|
||||||
const char *data; //offset to coffee file data
|
const char *data; //offset to coffee file data
|
||||||
const int len; //length of file data
|
const int len; //length of file data
|
||||||
#if HTTPD_FS_STATISTICS == 1 //not enabled since list is in PROGMEM
|
#if HTTPD_FS_STATISTICS == 1 //not enabled since list is in PROGMEM
|
||||||
u16_t count; //storage for file statistics
|
uint16_t count; //storage for file statistics
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
@ -113,4 +112,4 @@ const struct httpd_fsdata_file file_tcp_shtml[] HTTPD_STRING_ATTR ={{ fi
|
||||||
|
|
||||||
#define HTTPD_FS_ROOT file_tcp_shtml
|
#define HTTPD_FS_ROOT file_tcp_shtml
|
||||||
#define HTTPD_FS_NUMFILES 5
|
#define HTTPD_FS_NUMFILES 5
|
||||||
#define HTTPD_FS_SIZE 759
|
#define HTTPD_FS_SIZE 751
|
||||||
|
|
|
@ -44,7 +44,7 @@ struct httpd_fsdata_file {
|
||||||
const int len;
|
const int len;
|
||||||
#ifdef HTTPD_FS_STATISTICS
|
#ifdef HTTPD_FS_STATISTICS
|
||||||
#if HTTPD_FS_STATISTICS == 1
|
#if HTTPD_FS_STATISTICS == 1
|
||||||
u16_t count;
|
uint16_t count;
|
||||||
#endif /* HTTPD_FS_STATISTICS */
|
#endif /* HTTPD_FS_STATISTICS */
|
||||||
#endif /* HTTPD_FS_STATISTICS */
|
#endif /* HTTPD_FS_STATISTICS */
|
||||||
};
|
};
|
||||||
|
@ -56,7 +56,7 @@ struct httpd_fsdata_file_noconst {
|
||||||
int len;
|
int len;
|
||||||
#ifdef HTTPD_FS_STATISTICS
|
#ifdef HTTPD_FS_STATISTICS
|
||||||
#if HTTPD_FS_STATISTICS == 1
|
#if HTTPD_FS_STATISTICS == 1
|
||||||
u16_t count;
|
uint16_t count;
|
||||||
#endif /* HTTPD_FS_STATISTICS */
|
#endif /* HTTPD_FS_STATISTICS */
|
||||||
#endif /* HTTPD_FS_STATISTICS */
|
#endif /* HTTPD_FS_STATISTICS */
|
||||||
};
|
};
|
||||||
|
|
|
@ -49,6 +49,18 @@
|
||||||
* The advertised MSS is easily seen in wireshark.
|
* The advertised MSS is easily seen in wireshark.
|
||||||
* Some example set a small MSS by default. rpl-border-router for example uses a receive window of 60.
|
* Some example set a small MSS by default. rpl-border-router for example uses a receive window of 60.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Titles of web pages served with the !header cgi can be configured to show characteristics of the node.
|
||||||
|
* For example "CD1A:3456" to show the node id and clock time of last access.
|
||||||
|
* Change this line and rebuild to make indentifiable instances.
|
||||||
|
* Undefine to reduce program size, giving "Contiki-Nano" title on all pages.
|
||||||
|
* WAD indexes into the uip destaddr field, which contains the address that we responded to.
|
||||||
|
*/
|
||||||
|
#define WEBSERVER_CONF_PAGETITLE sprintf(buf,"[%02x%02x]",WAD[14],WAD[15]);
|
||||||
|
//#define WEBSERVER_CONF_PAGETITLE sprintf(buf,"Nano[%02x%02x%02x]",WAD[13],WAD[14],WAD[15]);
|
||||||
|
//#define WEBSERVER_CONF_PAGETITLE sprintf(buf,"Nano[%02x%02x...%02x%02x]",WAD[0],WAD[1],WAD[14],WAD[15]);
|
||||||
|
//#define WEBSERVER_CONF_PAGETITLE sprintf(buf,"%2x%02x...%2x%02x [%lu]",WAD[0],WAD[1],WAD[14],WAD[15],clock_seconds());
|
||||||
|
|
||||||
#ifndef WEBSERVER_CONF_NANO
|
#ifndef WEBSERVER_CONF_NANO
|
||||||
#if CONTIKI_TARGET_SKY || CONTIKI_TARGET_STK500
|
#if CONTIKI_TARGET_SKY || CONTIKI_TARGET_STK500
|
||||||
#define WEBSERVER_CONF_NANO 1
|
#define WEBSERVER_CONF_NANO 1
|
||||||
|
|
|
@ -41,14 +41,14 @@
|
||||||
#include "httpd-fsdata.c"
|
#include "httpd-fsdata.c"
|
||||||
|
|
||||||
#if HTTPD_FS_STATISTICS
|
#if HTTPD_FS_STATISTICS
|
||||||
static u16_t count[HTTPD_FS_NUMFILES];
|
static uint16_t count[HTTPD_FS_NUMFILES];
|
||||||
#endif /* HTTPD_FS_STATISTICS */
|
#endif /* HTTPD_FS_STATISTICS */
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static u8_t
|
static uint8_t
|
||||||
httpd_fs_strcmp(const char *str1, const char *str2)
|
httpd_fs_strcmp(const char *str1, const char *str2)
|
||||||
{
|
{
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
|
@ -70,7 +70,7 @@ int
|
||||||
httpd_fs_open(const char *name, struct httpd_fs_file *file)
|
httpd_fs_open(const char *name, struct httpd_fs_file *file)
|
||||||
{
|
{
|
||||||
#if HTTPD_FS_STATISTICS
|
#if HTTPD_FS_STATISTICS
|
||||||
u16_t i = 0;
|
uint16_t i = 0;
|
||||||
#endif /* HTTPD_FS_STATISTICS */
|
#endif /* HTTPD_FS_STATISTICS */
|
||||||
struct httpd_fsdata_file_noconst *f;
|
struct httpd_fsdata_file_noconst *f;
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ void
|
||||||
httpd_fs_init(void)
|
httpd_fs_init(void)
|
||||||
{
|
{
|
||||||
#if HTTPD_FS_STATISTICS
|
#if HTTPD_FS_STATISTICS
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
for(i = 0; i < HTTPD_FS_NUMFILES; i++) {
|
for(i = 0; i < HTTPD_FS_NUMFILES; i++) {
|
||||||
count[i] = 0;
|
count[i] = 0;
|
||||||
}
|
}
|
||||||
|
@ -106,11 +106,11 @@ httpd_fs_init(void)
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#if HTTPD_FS_STATISTICS
|
#if HTTPD_FS_STATISTICS
|
||||||
u16_t
|
uint16_t
|
||||||
httpd_fs_count(char *name)
|
httpd_fs_count(char *name)
|
||||||
{
|
{
|
||||||
struct httpd_fsdata_file_noconst *f;
|
struct httpd_fsdata_file_noconst *f;
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;
|
for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;
|
||||||
|
|
|
@ -50,7 +50,7 @@ int httpd_fs_open(const char *name, struct httpd_fs_file *file);
|
||||||
|
|
||||||
#ifdef HTTPD_FS_STATISTICS
|
#ifdef HTTPD_FS_STATISTICS
|
||||||
#if HTTPD_FS_STATISTICS == 1
|
#if HTTPD_FS_STATISTICS == 1
|
||||||
u16_t httpd_fs_count(char *name);
|
uint16_t httpd_fs_count(char *name);
|
||||||
#endif /* HTTPD_FS_STATISTICS */
|
#endif /* HTTPD_FS_STATISTICS */
|
||||||
#endif /* HTTPD_FS_STATISTICS */
|
#endif /* HTTPD_FS_STATISTICS */
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ struct httpd_fsdata_file {
|
||||||
const int len;
|
const int len;
|
||||||
#ifdef HTTPD_FS_STATISTICS
|
#ifdef HTTPD_FS_STATISTICS
|
||||||
#if HTTPD_FS_STATISTICS == 1
|
#if HTTPD_FS_STATISTICS == 1
|
||||||
u16_t count;
|
uint16_t count;
|
||||||
#endif /* HTTPD_FS_STATISTICS */
|
#endif /* HTTPD_FS_STATISTICS */
|
||||||
#endif /* HTTPD_FS_STATISTICS */
|
#endif /* HTTPD_FS_STATISTICS */
|
||||||
};
|
};
|
||||||
|
@ -56,7 +56,7 @@ struct httpd_fsdata_file_noconst {
|
||||||
int len;
|
int len;
|
||||||
#ifdef HTTPD_FS_STATISTICS
|
#ifdef HTTPD_FS_STATISTICS
|
||||||
#if HTTPD_FS_STATISTICS == 1
|
#if HTTPD_FS_STATISTICS == 1
|
||||||
u16_t count;
|
uint16_t count;
|
||||||
#endif /* HTTPD_FS_STATISTICS */
|
#endif /* HTTPD_FS_STATISTICS */
|
||||||
#endif /* HTTPD_FS_STATISTICS */
|
#endif /* HTTPD_FS_STATISTICS */
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki VNC server
|
* This file is part of the Contiki VNC server
|
||||||
*
|
*
|
||||||
* $Id: ctk-vncfont.c,v 1.1 2006/06/17 22:41:16 adamdunkels Exp $
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -37,13 +36,12 @@
|
||||||
#define o 0x01 /* 1001 0010 */
|
#define o 0x01 /* 1001 0010 */
|
||||||
#define X 0x02 /* 1111 0110 */
|
#define X 0x02 /* 1111 0110 */
|
||||||
|
|
||||||
#ifdef WITH_AVR
|
#ifdef __AVR__
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
|
const unsigned char vncfont[] PROGMEM = {
|
||||||
#else
|
#else
|
||||||
#define prog_char const unsigned char
|
const unsigned char vncfont[] = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
prog_char ctk_vncfont[] = {
|
|
||||||
/* char 0 */
|
/* char 0 */
|
||||||
X,o,_,_,_,_,
|
X,o,_,_,_,_,
|
||||||
o,X,_,_,_,_,
|
o,X,_,_,_,_,
|
||||||
|
|
|
@ -240,9 +240,9 @@ vnc_server_update_remove(struct vnc_server_state *vs,
|
||||||
*/
|
*/
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
update_area(u8_t x, u8_t y, u8_t w, u8_t h)
|
update_area(uint8_t x, uint8_t y, uint8_t w, uint8_t h)
|
||||||
{
|
{
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
if(h == 0 || w == 0) {
|
if(h == 0 || w == 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -266,7 +266,7 @@ update_area(u8_t x, u8_t y, u8_t w, u8_t h)
|
||||||
static struct vnc_server_state *
|
static struct vnc_server_state *
|
||||||
alloc_state(void)
|
alloc_state(void)
|
||||||
{
|
{
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
for(i = 0; i < CTK_VNCSERVER_CONF_NUMCONNS; ++i) {
|
for(i = 0; i < CTK_VNCSERVER_CONF_NUMCONNS; ++i) {
|
||||||
if(conns[i].state == VNC_DEALLOCATED) {
|
if(conns[i].state == VNC_DEALLOCATED) {
|
||||||
return &conns[i];
|
return &conns[i];
|
||||||
|
|
|
@ -70,14 +70,14 @@
|
||||||
#define BGR(b,g,r) (((b) << 6) | (g) << 3 | (r))
|
#define BGR(b,g,r) (((b) << 6) | (g) << 3 | (r))
|
||||||
|
|
||||||
|
|
||||||
static const u8_t menucolor[] = {
|
static const uint8_t menucolor[] = {
|
||||||
BGR(3,7,7), /* Background. */
|
BGR(3,7,7), /* Background. */
|
||||||
BGR(2,6,6), /* Anti-alias font color. */
|
BGR(2,6,6), /* Anti-alias font color. */
|
||||||
BGR(0,0,0), /* Font color. */
|
BGR(0,0,0), /* Font color. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static const u8_t activemenucolor[] = {
|
static const uint8_t activemenucolor[] = {
|
||||||
BGR(0,0,0), /* Background. */
|
BGR(0,0,0), /* Background. */
|
||||||
BGR(2,5,5), /* Anti-alias font color. */
|
BGR(2,5,5), /* Anti-alias font color. */
|
||||||
BGR(3,7,7), /* Font color. */
|
BGR(3,7,7), /* Font color. */
|
||||||
|
@ -160,7 +160,7 @@ static const unsigned char iconcol_w[] =
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static const u8_t * const colortheme[] =
|
static const uint8_t * const colortheme[] =
|
||||||
{
|
{
|
||||||
backgroundcolor,
|
backgroundcolor,
|
||||||
|
|
||||||
|
@ -193,15 +193,15 @@ static const u8_t * const colortheme[] =
|
||||||
static int mouse_x, mouse_y, mouse_button;
|
static int mouse_x, mouse_y, mouse_button;
|
||||||
|
|
||||||
#ifdef CTK_VNCSERVER_CONF_SCREEN
|
#ifdef CTK_VNCSERVER_CONF_SCREEN
|
||||||
static u8_t *screen = CTK_VNCSERVER_CONF_SCREEN;
|
static uint8_t *screen = CTK_VNCSERVER_CONF_SCREEN;
|
||||||
#else
|
#else
|
||||||
static u8_t screen[CHARS_WIDTH * CHARS_HEIGHT];
|
static uint8_t screen[CHARS_WIDTH * CHARS_HEIGHT];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CTK_VNCSERVER_CONF_COLORSCREEN
|
#ifdef CTK_VNCSERVER_CONF_COLORSCREEN
|
||||||
staitc u8_t *colorscreen = CTK_VNCSERVER_CONF_COLORSCREEN;
|
staitc uint8_t *colorscreen = CTK_VNCSERVER_CONF_COLORSCREEN;
|
||||||
#else
|
#else
|
||||||
static u8_t colorscreen[CHARS_WIDTH * CHARS_HEIGHT];
|
static uint8_t colorscreen[CHARS_WIDTH * CHARS_HEIGHT];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ struct ctk_icon *icons[MAX_ICONS];
|
||||||
unsigned char
|
unsigned char
|
||||||
vnc_out_add_icon(struct ctk_icon *icon)
|
vnc_out_add_icon(struct ctk_icon *icon)
|
||||||
{
|
{
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
signed int empty;
|
signed int empty;
|
||||||
|
|
||||||
empty = -1;
|
empty = -1;
|
||||||
|
@ -238,14 +238,14 @@ vnc_out_add_icon(struct ctk_icon *icon)
|
||||||
void
|
void
|
||||||
vnc_out_init(void)
|
vnc_out_init(void)
|
||||||
{
|
{
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
for(i = 0; i < CHARS_WIDTH * CHARS_HEIGHT; ++i) {
|
for(i = 0; i < CHARS_WIDTH * CHARS_HEIGHT; ++i) {
|
||||||
screen[i] = 0x20;
|
screen[i] = 0x20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vnc_out_update_screen(u8_t xpos, u8_t ypos, u8_t c, u8_t color)
|
vnc_out_update_screen(uint8_t xpos, uint8_t ypos, uint8_t c, uint8_t color)
|
||||||
{
|
{
|
||||||
screen[xpos + ypos * CHARS_WIDTH] = c;
|
screen[xpos + ypos * CHARS_WIDTH] = c;
|
||||||
colorscreen[xpos + ypos * CHARS_WIDTH] = color;
|
colorscreen[xpos + ypos * CHARS_WIDTH] = color;
|
||||||
|
@ -253,9 +253,9 @@ vnc_out_update_screen(u8_t xpos, u8_t ypos, u8_t c, u8_t color)
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
vnc_out_update_area(struct vnc_server_state *vs,
|
vnc_out_update_area(struct vnc_server_state *vs,
|
||||||
u8_t x, u8_t y, u8_t w, u8_t h)
|
uint8_t x, uint8_t y, uint8_t w, uint8_t h)
|
||||||
{
|
{
|
||||||
u8_t x2, y2, ax2, ay2;
|
uint8_t x2, y2, ax2, ay2;
|
||||||
register struct vnc_server_update *a, *b;
|
register struct vnc_server_update *a, *b;
|
||||||
|
|
||||||
PRINTF(("update_area_connection: should update (%d:%d) (%d:%d)\n",
|
PRINTF(("update_area_connection: should update (%d:%d) (%d:%d)\n",
|
||||||
|
@ -420,21 +420,21 @@ check_updates(CC_REGISTER_ARG struct vnc_server_state *vs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static u8_t tmp[CTK_VNCFONT_WIDTH * CTK_VNCFONT_HEIGHT];
|
static uint8_t tmp[CTK_VNCFONT_WIDTH * CTK_VNCFONT_HEIGHT];
|
||||||
static void
|
static void
|
||||||
makechar(CC_REGISTER_ARG char *ptr, u8_t x, u8_t y)
|
makechar(CC_REGISTER_ARG char *ptr, uint8_t x, uint8_t y)
|
||||||
{
|
{
|
||||||
u8_t i, *tmpptr;
|
uint8_t i, *tmpptr;
|
||||||
register u8_t *colorscheme;
|
register uint8_t *colorscheme;
|
||||||
unsigned char *bitmap;
|
unsigned char *bitmap;
|
||||||
u8_t b, b2;
|
uint8_t b, b2;
|
||||||
u8_t xmove, ymove;
|
uint8_t xmove, ymove;
|
||||||
unsigned char c, color;
|
unsigned char c, color;
|
||||||
|
|
||||||
color = colorscreen[x + y * CHARS_WIDTH];
|
color = colorscreen[x + y * CHARS_WIDTH];
|
||||||
c = screen[x + y * CHARS_WIDTH];
|
c = screen[x + y * CHARS_WIDTH];
|
||||||
|
|
||||||
colorscheme = (u8_t *)colortheme[color];
|
colorscheme = (uint8_t *)colortheme[color];
|
||||||
|
|
||||||
/* First check if the character is a special icon character. These
|
/* First check if the character is a special icon character. These
|
||||||
are to be interpreted in a special manner: the first character of
|
are to be interpreted in a special manner: the first character of
|
||||||
|
@ -457,7 +457,7 @@ makechar(CC_REGISTER_ARG char *ptr, u8_t x, u8_t y)
|
||||||
|
|
||||||
if(bitmap != NULL) {
|
if(bitmap != NULL) {
|
||||||
bitmap = bitmap + ymove * 8*3;
|
bitmap = bitmap + ymove * 8*3;
|
||||||
colorscheme = (u8_t *)colortheme[VNC_OUT_ICONCOLOR + (c >> 6)];
|
colorscheme = (uint8_t *)colortheme[VNC_OUT_ICONCOLOR + (c >> 6)];
|
||||||
switch(xmove) {
|
switch(xmove) {
|
||||||
case 0:
|
case 0:
|
||||||
for(i = 0; i < CTK_VNCFONT_HEIGHT; ++i) {
|
for(i = 0; i < CTK_VNCFONT_HEIGHT; ++i) {
|
||||||
|
@ -523,7 +523,7 @@ makechar(CC_REGISTER_ARG char *ptr, u8_t x, u8_t y)
|
||||||
void
|
void
|
||||||
vnc_out_new(CC_REGISTER_ARG struct vnc_server_state *vs)
|
vnc_out_new(CC_REGISTER_ARG struct vnc_server_state *vs)
|
||||||
{
|
{
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
vs->width = SCREEN_WIDTH;
|
vs->width = SCREEN_WIDTH;
|
||||||
vs->height = SCREEN_HEIGHT;
|
vs->height = SCREEN_HEIGHT;
|
||||||
|
@ -545,9 +545,9 @@ void
|
||||||
vnc_out_send_blank(CC_REGISTER_ARG struct vnc_server_state *vs)
|
vnc_out_send_blank(CC_REGISTER_ARG struct vnc_server_state *vs)
|
||||||
{
|
{
|
||||||
register struct rfb_fb_update *umsg;
|
register struct rfb_fb_update *umsg;
|
||||||
u8_t *ptr;
|
uint8_t *ptr;
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u8_t msglen;
|
uint8_t msglen;
|
||||||
|
|
||||||
vs->x = vs->y = 0;
|
vs->x = vs->y = 0;
|
||||||
vs->x2 = vs->y2 = 0;
|
vs->x2 = vs->y2 = 0;
|
||||||
|
@ -557,7 +557,7 @@ vnc_out_send_blank(CC_REGISTER_ARG struct vnc_server_state *vs)
|
||||||
umsg->type = RFB_FB_UPDATE;
|
umsg->type = RFB_FB_UPDATE;
|
||||||
umsg->rects = UIP_HTONS(2);
|
umsg->rects = UIP_HTONS(2);
|
||||||
|
|
||||||
ptr = (u8_t *)umsg + sizeof(struct rfb_fb_update);
|
ptr = (uint8_t *)umsg + sizeof(struct rfb_fb_update);
|
||||||
len = sizeof(struct rfb_fb_update);
|
len = sizeof(struct rfb_fb_update);
|
||||||
|
|
||||||
msglen = vnc_server_draw_rect(ptr, 0, 0,
|
msglen = vnc_server_draw_rect(ptr, 0, 0,
|
||||||
|
@ -590,15 +590,15 @@ static short tmpbuf[30];
|
||||||
void
|
void
|
||||||
vnc_out_send_update(CC_REGISTER_ARG struct vnc_server_state *vs)
|
vnc_out_send_update(CC_REGISTER_ARG struct vnc_server_state *vs)
|
||||||
{
|
{
|
||||||
u8_t x, y, x0;
|
uint8_t x, y, x0;
|
||||||
u8_t msglen;
|
uint8_t msglen;
|
||||||
u16_t len, n;
|
uint16_t len, n;
|
||||||
u8_t *ptr;
|
uint8_t *ptr;
|
||||||
struct rfb_fb_update *umsg;
|
struct rfb_fb_update *umsg;
|
||||||
register struct rfb_fb_update_rect_hdr *recthdr;
|
register struct rfb_fb_update_rect_hdr *recthdr;
|
||||||
struct rfb_rre_hdr *rrehdr;
|
struct rfb_rre_hdr *rrehdr;
|
||||||
u8_t c, color, lastcolor;
|
uint8_t c, color, lastcolor;
|
||||||
u8_t numblanks;
|
uint8_t numblanks;
|
||||||
|
|
||||||
/* First, check if we need to feed the update function with a new
|
/* First, check if we need to feed the update function with a new
|
||||||
pending update. */
|
pending update. */
|
||||||
|
@ -615,7 +615,7 @@ vnc_out_send_update(CC_REGISTER_ARG struct vnc_server_state *vs)
|
||||||
x0 = vs->x1;
|
x0 = vs->x1;
|
||||||
n = 0;
|
n = 0;
|
||||||
msglen = 0;
|
msglen = 0;
|
||||||
ptr = (u8_t *)umsg + sizeof(struct rfb_fb_update);
|
ptr = (uint8_t *)umsg + sizeof(struct rfb_fb_update);
|
||||||
len = sizeof(struct rfb_fb_update);
|
len = sizeof(struct rfb_fb_update);
|
||||||
|
|
||||||
/* Loop over all characters that are covered by this update. */
|
/* Loop over all characters that are covered by this update. */
|
||||||
|
@ -741,7 +741,7 @@ vnc_out_send_update(CC_REGISTER_ARG struct vnc_server_state *vs)
|
||||||
recthdr->encoding[2] = 0;
|
recthdr->encoding[2] = 0;
|
||||||
recthdr->encoding[3] = RFB_ENC_RAW;
|
recthdr->encoding[3] = RFB_ENC_RAW;
|
||||||
|
|
||||||
makechar((u8_t *)recthdr +
|
makechar((uint8_t *)recthdr +
|
||||||
sizeof(struct rfb_fb_update_rect_hdr),
|
sizeof(struct rfb_fb_update_rect_hdr),
|
||||||
x, y);
|
x, y);
|
||||||
}
|
}
|
||||||
|
@ -837,7 +837,7 @@ void
|
||||||
vnc_out_pointer_event(struct vnc_server_state *vs)
|
vnc_out_pointer_event(struct vnc_server_state *vs)
|
||||||
{
|
{
|
||||||
struct rfb_pointer_event *ev;
|
struct rfb_pointer_event *ev;
|
||||||
u16_t evx, evy;
|
uint16_t evx, evy;
|
||||||
|
|
||||||
ev = (struct rfb_pointer_event *)uip_appdata;
|
ev = (struct rfb_pointer_event *)uip_appdata;
|
||||||
|
|
||||||
|
|
|
@ -51,12 +51,12 @@ void vnc_out_acked(struct vnc_server_state *vs);
|
||||||
void vnc_out_poll(struct vnc_server_state *vs);
|
void vnc_out_poll(struct vnc_server_state *vs);
|
||||||
|
|
||||||
|
|
||||||
void vnc_out_update_screen(u8_t x, u8_t y, u8_t c, u8_t color);
|
void vnc_out_update_screen(uint8_t x, uint8_t y, uint8_t c, uint8_t color);
|
||||||
char vnc_out_getkey(void);
|
char vnc_out_getkey(void);
|
||||||
char vnc_out_keyavail(void);
|
char vnc_out_keyavail(void);
|
||||||
|
|
||||||
void vnc_out_update_area(struct vnc_server_state *vs,
|
void vnc_out_update_area(struct vnc_server_state *vs,
|
||||||
u8_t x, u8_t y, u8_t w, u8_t h);
|
uint8_t x, uint8_t y, uint8_t w, uint8_t h);
|
||||||
|
|
||||||
#include "ctk/ctk.h"
|
#include "ctk/ctk.h"
|
||||||
|
|
||||||
|
|
|
@ -65,10 +65,10 @@
|
||||||
#define RFB_SERVER_VERSION_STRING rfb_server_version_string
|
#define RFB_SERVER_VERSION_STRING rfb_server_version_string
|
||||||
|
|
||||||
/* "RFB 003.003" */
|
/* "RFB 003.003" */
|
||||||
static u8_t rfb_server_version_string[12] = {82,70,66,32,48,48,51,46,48,48,51,10};
|
static uint8_t rfb_server_version_string[12] = {82,70,66,32,48,48,51,46,48,48,51,10};
|
||||||
|
|
||||||
/* uVNC */
|
/* uVNC */
|
||||||
static u8_t uvnc_name[4] = {117,86,78,67};
|
static uint8_t uvnc_name[4] = {117,86,78,67};
|
||||||
#if 1
|
#if 1
|
||||||
#define PRINTF(x)
|
#define PRINTF(x)
|
||||||
#else
|
#else
|
||||||
|
@ -76,8 +76,8 @@ static u8_t uvnc_name[4] = {117,86,78,67};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
u8_t
|
uint8_t
|
||||||
vnc_server_draw_rect(u8_t *ptr, u16_t x, u16_t y, u16_t w, u16_t h, u8_t c)
|
vnc_server_draw_rect(uint8_t *ptr, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t c)
|
||||||
{
|
{
|
||||||
register struct rfb_fb_update_rect_hdr *recthdr;
|
register struct rfb_fb_update_rect_hdr *recthdr;
|
||||||
struct rfb_rre_hdr *rrehdr;
|
struct rfb_rre_hdr *rrehdr;
|
||||||
|
@ -244,16 +244,16 @@ vnc_pointer_event(struct vnc_server_state *vs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static u8_t
|
static uint8_t
|
||||||
vnc_read_data(CC_REGISTER_ARG struct vnc_server_state *vs)
|
vnc_read_data(CC_REGISTER_ARG struct vnc_server_state *vs)
|
||||||
{
|
{
|
||||||
u8_t *appdata;
|
uint8_t *appdata;
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
struct rfb_fb_update_request *req;
|
struct rfb_fb_update_request *req;
|
||||||
/* u8_t niter;*/
|
/* uint8_t niter;*/
|
||||||
|
|
||||||
len = uip_datalen();
|
len = uip_datalen();
|
||||||
appdata = (u8_t *)uip_appdata;
|
appdata = (uint8_t *)uip_appdata;
|
||||||
|
|
||||||
/* First, check if there is data left to discard since last read. */
|
/* First, check if there is data left to discard since last read. */
|
||||||
if(vs->readlen > 0) {
|
if(vs->readlen > 0) {
|
||||||
|
|
|
@ -37,9 +37,9 @@
|
||||||
|
|
||||||
|
|
||||||
/*struct vnc_server_updatearea {
|
/*struct vnc_server_updatearea {
|
||||||
u8_t active;
|
uint8_t active;
|
||||||
u8_t x, y;
|
uint8_t x, y;
|
||||||
u8_t w, h;
|
uint8_t w, h;
|
||||||
};*/
|
};*/
|
||||||
|
|
||||||
struct vnc_server_update {
|
struct vnc_server_update {
|
||||||
|
@ -49,29 +49,29 @@ struct vnc_server_update {
|
||||||
#define VNC_SERVER_UPDATE_PARTS 1
|
#define VNC_SERVER_UPDATE_PARTS 1
|
||||||
#define VNC_SERVER_UPDATE_FULL 2
|
#define VNC_SERVER_UPDATE_FULL 2
|
||||||
|
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
|
|
||||||
u8_t x, y;
|
uint8_t x, y;
|
||||||
u8_t w, h;
|
uint8_t w, h;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vnc_server_state {
|
struct vnc_server_state {
|
||||||
u16_t counter;
|
uint16_t counter;
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t state;
|
uint8_t state;
|
||||||
u16_t height, width;
|
uint16_t height, width;
|
||||||
|
|
||||||
u8_t update_requested;
|
uint8_t update_requested;
|
||||||
|
|
||||||
/* Variables used when sending screen updates. */
|
/* Variables used when sending screen updates. */
|
||||||
u8_t x, y, x1, y1, x2, y2;
|
uint8_t x, y, x1, y1, x2, y2;
|
||||||
u8_t w, h;
|
uint8_t w, h;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
u16_t readlen;
|
uint16_t readlen;
|
||||||
u8_t sendmsg;
|
uint8_t sendmsg;
|
||||||
u8_t button;
|
uint8_t button;
|
||||||
|
|
||||||
|
|
||||||
struct vnc_server_update *updates_current;
|
struct vnc_server_update *updates_current;
|
||||||
|
@ -131,30 +131,30 @@ enum {
|
||||||
#include "contiki-net.h"
|
#include "contiki-net.h"
|
||||||
|
|
||||||
void vnc_server_send_data(struct vnc_server_state *vs);
|
void vnc_server_send_data(struct vnc_server_state *vs);
|
||||||
u8_t vnc_server_draw_rect(u8_t *ptr, u16_t x, u16_t y, u16_t w, u16_t h, u8_t c);
|
uint8_t vnc_server_draw_rect(uint8_t *ptr, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t c);
|
||||||
|
|
||||||
|
|
||||||
/* Generic rectangle - x, y coordinates, width and height. */
|
/* Generic rectangle - x, y coordinates, width and height. */
|
||||||
struct rfb_rect {
|
struct rfb_rect {
|
||||||
u16_t x;
|
uint16_t x;
|
||||||
u16_t y;
|
uint16_t y;
|
||||||
u16_t w;
|
uint16_t w;
|
||||||
u16_t h;
|
uint16_t h;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Pixel format definition. */
|
/* Pixel format definition. */
|
||||||
struct rfb_pixel_format {
|
struct rfb_pixel_format {
|
||||||
u8_t bps; /* Bits per pixel: 8, 16 or 32. */
|
uint8_t bps; /* Bits per pixel: 8, 16 or 32. */
|
||||||
u8_t depth; /* Color depth: 8-32 */
|
uint8_t depth; /* Color depth: 8-32 */
|
||||||
u8_t endian; /* 1 - big endian (motorola), 0 - little endian
|
uint8_t endian; /* 1 - big endian (motorola), 0 - little endian
|
||||||
(x86) */
|
(x86) */
|
||||||
u8_t truecolor; /* 1 - true color is used, 0 - true color is not used. */
|
uint8_t truecolor; /* 1 - true color is used, 0 - true color is not used. */
|
||||||
|
|
||||||
/* The following fields are only used if true color is used. */
|
/* The following fields are only used if true color is used. */
|
||||||
u16_t red_max, green_max, blue_max;
|
uint16_t red_max, green_max, blue_max;
|
||||||
u8_t red_shift, green_shift, blue_shift;
|
uint8_t red_shift, green_shift, blue_shift;
|
||||||
u8_t pad1;
|
uint8_t pad1;
|
||||||
u16_t pad2;
|
uint16_t pad2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -197,100 +197,100 @@ struct rfb_pixel_format {
|
||||||
/* Server to client messages. */
|
/* Server to client messages. */
|
||||||
|
|
||||||
struct rfb_server_init {
|
struct rfb_server_init {
|
||||||
u16_t width;
|
uint16_t width;
|
||||||
u16_t height;
|
uint16_t height;
|
||||||
struct rfb_pixel_format format;
|
struct rfb_pixel_format format;
|
||||||
u8_t namelength[4];
|
uint8_t namelength[4];
|
||||||
/* Followed by name. */
|
/* Followed by name. */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_fb_update {
|
struct rfb_fb_update {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t pad;
|
uint8_t pad;
|
||||||
u16_t rects; /* Number of rectanges (struct rfb_fb_update_rect_hdr +
|
uint16_t rects; /* Number of rectanges (struct rfb_fb_update_rect_hdr +
|
||||||
data) that follows. */
|
data) that follows. */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_fb_update_rect_hdr {
|
struct rfb_fb_update_rect_hdr {
|
||||||
struct rfb_rect rect;
|
struct rfb_rect rect;
|
||||||
u8_t encoding[4];
|
uint8_t encoding[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_copy_rect {
|
struct rfb_copy_rect {
|
||||||
u16_t srcx;
|
uint16_t srcx;
|
||||||
u16_t srcy;
|
uint16_t srcy;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_rre_hdr {
|
struct rfb_rre_hdr {
|
||||||
u16_t subrects[2]; /* Number of subrectangles (struct
|
uint16_t subrects[2]; /* Number of subrectangles (struct
|
||||||
rfb_rre_subrect) to follow. */
|
rfb_rre_subrect) to follow. */
|
||||||
u8_t bgpixel;
|
uint8_t bgpixel;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_rre_subrect {
|
struct rfb_rre_subrect {
|
||||||
u8_t pixel;
|
uint8_t pixel;
|
||||||
struct rfb_rect rect;
|
struct rfb_rect rect;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_corre_rect {
|
struct rfb_corre_rect {
|
||||||
u8_t x;
|
uint8_t x;
|
||||||
u8_t y;
|
uint8_t y;
|
||||||
u8_t w;
|
uint8_t w;
|
||||||
u8_t h;
|
uint8_t h;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Client to server messages. */
|
/* Client to server messages. */
|
||||||
|
|
||||||
struct rfb_set_pixel_format {
|
struct rfb_set_pixel_format {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t pad;
|
uint8_t pad;
|
||||||
u16_t pad2;
|
uint16_t pad2;
|
||||||
struct rfb_pixel_format format;
|
struct rfb_pixel_format format;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_fix_colormap_entries {
|
struct rfb_fix_colormap_entries {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t pad;
|
uint8_t pad;
|
||||||
u16_t firstcolor;
|
uint16_t firstcolor;
|
||||||
u16_t colors;
|
uint16_t colors;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_set_encoding {
|
struct rfb_set_encoding {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t pad;
|
uint8_t pad;
|
||||||
u16_t encodings;
|
uint16_t encodings;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_fb_update_request {
|
struct rfb_fb_update_request {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t incremental;
|
uint8_t incremental;
|
||||||
u16_t x;
|
uint16_t x;
|
||||||
u16_t y;
|
uint16_t y;
|
||||||
u16_t w;
|
uint16_t w;
|
||||||
u16_t h;
|
uint16_t h;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_key_event {
|
struct rfb_key_event {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t down;
|
uint8_t down;
|
||||||
u16_t pad;
|
uint16_t pad;
|
||||||
u8_t key[4];
|
uint8_t key[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
#define RFB_BUTTON_MASK1 1
|
#define RFB_BUTTON_MASK1 1
|
||||||
#define RFB_BUTTON_MASK2 2
|
#define RFB_BUTTON_MASK2 2
|
||||||
#define RFB_BUTTON_MASK3 4
|
#define RFB_BUTTON_MASK3 4
|
||||||
struct rfb_pointer_event {
|
struct rfb_pointer_event {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t buttonmask;
|
uint8_t buttonmask;
|
||||||
u16_t x;
|
uint16_t x;
|
||||||
u16_t y;
|
uint16_t y;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rfb_client_cut_text {
|
struct rfb_client_cut_text {
|
||||||
u8_t type;
|
uint8_t type;
|
||||||
u8_t pad[3];
|
uint8_t pad[3];
|
||||||
u8_t len[4];
|
uint8_t len[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __VNC_SERVER_H__ */
|
#endif /* __VNC_SERVER_H__ */
|
||||||
|
|
|
@ -51,12 +51,12 @@
|
||||||
|
|
||||||
PROCESS(slip_process, "SLIP driver");
|
PROCESS(slip_process, "SLIP driver");
|
||||||
|
|
||||||
u8_t slip_active;
|
uint8_t slip_active;
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
#define SLIP_STATISTICS(statement)
|
#define SLIP_STATISTICS(statement)
|
||||||
#else
|
#else
|
||||||
u16_t slip_rubbish, slip_twopackets, slip_overflow, slip_ip_drop;
|
uint16_t slip_rubbish, slip_twopackets, slip_overflow, slip_ip_drop;
|
||||||
#define SLIP_STATISTICS(statement) statement
|
#define SLIP_STATISTICS(statement) statement
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -81,10 +81,10 @@ enum {
|
||||||
* they are discarded.
|
* they are discarded.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static u8_t state = STATE_TWOPACKETS;
|
static uint8_t state = STATE_TWOPACKETS;
|
||||||
static u16_t begin, end;
|
static uint16_t begin, end;
|
||||||
static u8_t rxbuf[RX_BUFSIZE];
|
static uint8_t rxbuf[RX_BUFSIZE];
|
||||||
static u16_t pkt_end; /* SLIP_END tracker. */
|
static uint16_t pkt_end; /* SLIP_END tracker. */
|
||||||
|
|
||||||
static void (* input_callback)(void) = NULL;
|
static void (* input_callback)(void) = NULL;
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
@ -98,19 +98,19 @@ slip_set_input_callback(void (*c)(void))
|
||||||
* was used in slip-bridge.c
|
* was used in slip-bridge.c
|
||||||
*/
|
*/
|
||||||
//#if WITH_UIP
|
//#if WITH_UIP
|
||||||
u8_t
|
uint8_t
|
||||||
slip_send(void)
|
slip_send(void)
|
||||||
{
|
{
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
u8_t *ptr;
|
uint8_t *ptr;
|
||||||
u8_t c;
|
uint8_t c;
|
||||||
|
|
||||||
slip_arch_writeb(SLIP_END);
|
slip_arch_writeb(SLIP_END);
|
||||||
|
|
||||||
ptr = &uip_buf[UIP_LLH_LEN];
|
ptr = &uip_buf[UIP_LLH_LEN];
|
||||||
for(i = 0; i < uip_len; ++i) {
|
for(i = 0; i < uip_len; ++i) {
|
||||||
if(i == UIP_TCPIP_HLEN) {
|
if(i == UIP_TCPIP_HLEN) {
|
||||||
ptr = (u8_t *)uip_appdata;
|
ptr = (uint8_t *)uip_appdata;
|
||||||
}
|
}
|
||||||
c = *ptr++;
|
c = *ptr++;
|
||||||
if(c == SLIP_END) {
|
if(c == SLIP_END) {
|
||||||
|
@ -128,12 +128,12 @@ slip_send(void)
|
||||||
}
|
}
|
||||||
//#endif /* WITH_UIP */
|
//#endif /* WITH_UIP */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
u8_t
|
uint8_t
|
||||||
slip_write(const void *_ptr, int len)
|
slip_write(const void *_ptr, int len)
|
||||||
{
|
{
|
||||||
const u8_t *ptr = _ptr;
|
const uint8_t *ptr = _ptr;
|
||||||
u16_t i;
|
uint16_t i;
|
||||||
u8_t c;
|
uint8_t c;
|
||||||
|
|
||||||
slip_arch_writeb(SLIP_END);
|
slip_arch_writeb(SLIP_END);
|
||||||
|
|
||||||
|
@ -161,8 +161,8 @@ rxbuf_init(void)
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/* Upper half does the polling. */
|
/* Upper half does the polling. */
|
||||||
static u16_t
|
static uint16_t
|
||||||
slip_poll_handler(u8_t *outbuf, u16_t blen)
|
slip_poll_handler(uint8_t *outbuf, uint16_t blen)
|
||||||
{
|
{
|
||||||
/* This is a hack and won't work across buffer edge! */
|
/* This is a hack and won't work across buffer edge! */
|
||||||
if(rxbuf[begin] == 'C') {
|
if(rxbuf[begin] == 'C') {
|
||||||
|
@ -212,7 +212,7 @@ slip_poll_handler(u8_t *outbuf, u16_t blen)
|
||||||
* If pkt_end != begin it will not change again.
|
* If pkt_end != begin it will not change again.
|
||||||
*/
|
*/
|
||||||
if(begin != pkt_end) {
|
if(begin != pkt_end) {
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
|
|
||||||
if(begin < pkt_end) {
|
if(begin < pkt_end) {
|
||||||
len = pkt_end - begin;
|
len = pkt_end - begin;
|
||||||
|
@ -275,12 +275,12 @@ PROCESS_THREAD(slip_process, ev, data)
|
||||||
}
|
}
|
||||||
slip_write(buf, 8);
|
slip_write(buf, 8);
|
||||||
} else if(uip_len > 0
|
} else if(uip_len > 0
|
||||||
&& uip_len == (((u16_t)(BUF->len[0]) << 8) + BUF->len[1])
|
&& uip_len == (((uint16_t)(BUF->len[0]) << 8) + BUF->len[1])
|
||||||
&& uip_ipchksum() == 0xffff) {
|
&& uip_ipchksum() == 0xffff) {
|
||||||
#define IP_DF 0x40
|
#define IP_DF 0x40
|
||||||
if(BUF->ipid[0] == 0 && BUF->ipid[1] == 0 && BUF->ipoffset[0] & IP_DF) {
|
if(BUF->ipid[0] == 0 && BUF->ipid[1] == 0 && BUF->ipoffset[0] & IP_DF) {
|
||||||
static u16_t ip_id;
|
static uint16_t ip_id;
|
||||||
u16_t nid = ip_id++;
|
uint16_t nid = ip_id++;
|
||||||
BUF->ipid[0] = nid >> 8;
|
BUF->ipid[0] = nid >> 8;
|
||||||
BUF->ipid[1] = nid;
|
BUF->ipid[1] = nid;
|
||||||
nid = uip_htons(nid);
|
nid = uip_htons(nid);
|
||||||
|
|
|
@ -42,7 +42,7 @@ PROCESS_NAME(slip_process);
|
||||||
/**
|
/**
|
||||||
* Send an IP packet from the uIP buffer with SLIP.
|
* Send an IP packet from the uIP buffer with SLIP.
|
||||||
*/
|
*/
|
||||||
u8_t slip_send(void);
|
uint8_t slip_send(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Input a SLIP byte.
|
* Input a SLIP byte.
|
||||||
|
@ -63,13 +63,13 @@ u8_t slip_send(void);
|
||||||
*/
|
*/
|
||||||
int slip_input_byte(unsigned char c);
|
int slip_input_byte(unsigned char c);
|
||||||
|
|
||||||
u8_t slip_write(const void *ptr, int len);
|
uint8_t slip_write(const void *ptr, int len);
|
||||||
|
|
||||||
/* Did we receive any bytes lately? */
|
/* Did we receive any bytes lately? */
|
||||||
extern u8_t slip_active;
|
extern uint8_t slip_active;
|
||||||
|
|
||||||
/* Statistics. */
|
/* Statistics. */
|
||||||
extern u16_t slip_rubbish, slip_twopackets, slip_overflow, slip_ip_drop;
|
extern uint16_t slip_rubbish, slip_twopackets, slip_overflow, slip_ip_drop;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a function to be called when there is activity on the SLIP
|
* Set a function to be called when there is activity on the SLIP
|
||||||
|
|
|
@ -37,9 +37,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* These typedefs limits object file size! */
|
/* These typedefs limits object file size! */
|
||||||
typedef u16_t cle_off; /* Offset from start of file. */
|
typedef uint16_t cle_off; /* Offset from start of file. */
|
||||||
typedef u16_t cle_word;
|
typedef uint16_t cle_word;
|
||||||
typedef u16_t cle_half;
|
typedef uint16_t cle_half;
|
||||||
|
|
||||||
/* Also used for address arithmetic (can't be void *). */
|
/* Also used for address arithmetic (can't be void *). */
|
||||||
#ifdef __AVR__
|
#ifdef __AVR__
|
||||||
|
|
|
@ -28,14 +28,12 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* @(#)$Id: elfloader-avr.c,v 1.10 2009/07/16 18:02:34 dak664 Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <avr/boot.h>
|
#include <avr/boot.h>
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
#include "dev/rs232.h"
|
|
||||||
#include "elfloader-arch.h"
|
#include "elfloader-arch.h"
|
||||||
#include "lib/mmem.h"
|
#include "lib/mmem.h"
|
||||||
#include <string.h> //memset
|
#include <string.h> //memset
|
||||||
|
@ -64,8 +62,8 @@
|
||||||
|
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
/*#define PRINTF(...) rs232_print_p(RS232_PORT_1, __VA_ARGS__)*/
|
#include <avr/pgmspace.h>
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(FORMAT,args...) printf_P(PSTR(FORMAT),##args)
|
||||||
#else
|
#else
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
#endif
|
#endif
|
||||||
|
@ -305,7 +303,7 @@ elfloader_arch_relocate(int fd, unsigned int sectionoffset,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* new solution */
|
/* new solution */
|
||||||
instr[2] = (u8_t) ((int)addr) & 0xff;
|
instr[2] = (uint8_t) ((int)addr) & 0xff;
|
||||||
instr[3] = ((int)addr) >> 8;
|
instr[3] = ((int)addr) >> 8;
|
||||||
cfs_write(fd, instr, 4);
|
cfs_write(fd, instr, 4);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: cxmac.c,v 1.15 2010/10/03 20:37:32 adamdunkels Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -421,7 +420,7 @@ send_packet(void)
|
||||||
uint8_t strobe[MAX_STROBE_SIZE];
|
uint8_t strobe[MAX_STROBE_SIZE];
|
||||||
int strobe_len, len;
|
int strobe_len, len;
|
||||||
int is_broadcast = 0;
|
int is_broadcast = 0;
|
||||||
int is_reliable;
|
/*int is_reliable;*/
|
||||||
struct encounter *e;
|
struct encounter *e;
|
||||||
struct queuebuf *packet;
|
struct queuebuf *packet;
|
||||||
int is_already_streaming = 0;
|
int is_already_streaming = 0;
|
||||||
|
@ -450,8 +449,8 @@ send_packet(void)
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]);
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* UIP_CONF_IPV6 */
|
||||||
}
|
}
|
||||||
is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) ||
|
/* is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) ||
|
||||||
packetbuf_attr(PACKETBUF_ATTR_ERELIABLE);
|
packetbuf_attr(PACKETBUF_ATTR_ERELIABLE);*/
|
||||||
len = NETSTACK_FRAMER.create();
|
len = NETSTACK_FRAMER.create();
|
||||||
strobe_len = len + sizeof(struct cxmac_hdr);
|
strobe_len = len + sizeof(struct cxmac_hdr);
|
||||||
if(len < 0 || strobe_len > (int)sizeof(strobe)) {
|
if(len < 0 || strobe_len > (int)sizeof(strobe)) {
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: xmac.c,v 1.60 2011/01/25 14:31:09 adamdunkels Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -463,7 +462,7 @@ send_packet(void)
|
||||||
uint8_t strobe[MAX_STROBE_SIZE];
|
uint8_t strobe[MAX_STROBE_SIZE];
|
||||||
int strobe_len, len;
|
int strobe_len, len;
|
||||||
int is_broadcast = 0;
|
int is_broadcast = 0;
|
||||||
int is_reliable;
|
/*int is_reliable; */
|
||||||
struct encounter *e;
|
struct encounter *e;
|
||||||
struct queuebuf *packet;
|
struct queuebuf *packet;
|
||||||
int is_already_streaming = 0;
|
int is_already_streaming = 0;
|
||||||
|
@ -491,8 +490,8 @@ send_packet(void)
|
||||||
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]);
|
packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]);
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* UIP_CONF_IPV6 */
|
||||||
}
|
}
|
||||||
is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) ||
|
/* is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) ||
|
||||||
packetbuf_attr(PACKETBUF_ATTR_ERELIABLE);
|
packetbuf_attr(PACKETBUF_ATTR_ERELIABLE); */
|
||||||
|
|
||||||
packetbuf_set_attr(PACKETBUF_ATTR_MAC_ACK, 1);
|
packetbuf_set_attr(PACKETBUF_ATTR_MAC_ACK, 1);
|
||||||
len = NETSTACK_FRAMER.create();
|
len = NETSTACK_FRAMER.create();
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: collect.c,v 1.73 2011/01/18 16:05:53 adamdunkels Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -126,7 +125,7 @@ struct ack_msg {
|
||||||
full, incoming packets are dropped instead of being forwarded. */
|
full, incoming packets are dropped instead of being forwarded. */
|
||||||
#define MAX_MAC_REXMITS 2
|
#define MAX_MAC_REXMITS 2
|
||||||
#define MAX_ACK_MAC_REXMITS 5
|
#define MAX_ACK_MAC_REXMITS 5
|
||||||
#define REXMIT_TIME CLOCK_SECOND * 32 / NETSTACK_RDC_CHANNEL_CHECK_RATE
|
#define REXMIT_TIME (CLOCK_SECOND * 32 / NETSTACK_RDC_CHANNEL_CHECK_RATE)
|
||||||
#define FORWARD_PACKET_LIFETIME_BASE REXMIT_TIME * 2
|
#define FORWARD_PACKET_LIFETIME_BASE REXMIT_TIME * 2
|
||||||
#define MAX_SENDING_QUEUE 3 * QUEUEBUF_NUM / 4
|
#define MAX_SENDING_QUEUE 3 * QUEUEBUF_NUM / 4
|
||||||
#define MIN_AVAILABLE_QUEUE_ENTRIES 4
|
#define MIN_AVAILABLE_QUEUE_ENTRIES 4
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
*
|
*
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
* Author: Adam Dunkels <adam@sics.se>
|
||||||
*
|
*
|
||||||
* $Id: pt.h,v 1.3 2008/10/14 12:46:39 nvt-se Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -112,7 +111,7 @@ struct pt {
|
||||||
*
|
*
|
||||||
* \hideinitializer
|
* \hideinitializer
|
||||||
*/
|
*/
|
||||||
#define PT_BEGIN(pt) { char PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc)
|
#define PT_BEGIN(pt) { char PT_YIELD_FLAG = 1; if (PT_YIELD_FLAG) {;} LC_RESUME((pt)->lc)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Declare the end of a protothread.
|
* Declare the end of a protothread.
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#if CTK_CONF_MOUSE_SUPPORT
|
#if CTK_CONF_MOUSE_SUPPORT
|
||||||
|
|
||||||
static struct mouse_pos pos;
|
static struct mouse_pos pos;
|
||||||
static u8_t okay;
|
static uint8_t okay;
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
|
|
|
@ -77,7 +77,7 @@ AUTOSTART_PROCESSES(&dhcp_process);
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static char *
|
static char *
|
||||||
makebyte(u8_t byte, char *str)
|
makebyte(uint8_t byte, char *str)
|
||||||
{
|
{
|
||||||
if(byte >= 100) {
|
if(byte >= 100) {
|
||||||
*str++ = (byte / 100 ) % 10 + '0';
|
*str++ = (byte / 100 ) % 10 + '0';
|
||||||
|
|
|
@ -48,7 +48,7 @@ static char * CC_FASTCALL
|
||||||
ipaddrtoa(uip_ipaddr_t *ipaddr, char *buffer)
|
ipaddrtoa(uip_ipaddr_t *ipaddr, char *buffer)
|
||||||
{
|
{
|
||||||
char *ptr = buffer;
|
char *ptr = buffer;
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
for(i = 0; i < 4; ++i) {
|
for(i = 0; i < 4; ++i) {
|
||||||
*ptr = '.';
|
*ptr = '.';
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
PROCESS(ethernet_process, "Ethernet driver");
|
PROCESS(ethernet_process, "Ethernet driver");
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
u8_t
|
uint8_t
|
||||||
ethernet_output(void)
|
ethernet_output(void)
|
||||||
{
|
{
|
||||||
uip_arp_out();
|
uip_arp_out();
|
||||||
|
|
|
@ -37,12 +37,12 @@
|
||||||
#include "contiki.h"
|
#include "contiki.h"
|
||||||
|
|
||||||
struct ethernet_config {
|
struct ethernet_config {
|
||||||
u16_t addr;
|
uint16_t addr;
|
||||||
char name[12+1];
|
char name[12+1];
|
||||||
};
|
};
|
||||||
|
|
||||||
PROCESS_NAME(ethernet_process);
|
PROCESS_NAME(ethernet_process);
|
||||||
|
|
||||||
u8_t ethernet_output(void);
|
uint8_t ethernet_output(void);
|
||||||
|
|
||||||
#endif /* __ETHERNET_DRV_H__ */
|
#endif /* __ETHERNET_DRV_H__ */
|
||||||
|
|
|
@ -46,11 +46,11 @@
|
||||||
struct {
|
struct {
|
||||||
char signature[4];
|
char signature[4];
|
||||||
struct uip_eth_addr ethernet_address;
|
struct uip_eth_addr ethernet_address;
|
||||||
u8_t *buffer;
|
uint8_t *buffer;
|
||||||
u16_t buffer_size;
|
uint16_t buffer_size;
|
||||||
void __fastcall__ (* init)(u16_t reg);
|
void __fastcall__ (* init)(uint16_t reg);
|
||||||
u16_t (* poll)(void);
|
uint16_t (* poll)(void);
|
||||||
void __fastcall__ (* send)(u16_t len);
|
void __fastcall__ (* send)(uint16_t len);
|
||||||
void (* exit)(void);
|
void (* exit)(void);
|
||||||
} *module;
|
} *module;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ ethernet_init(struct ethernet_config *config)
|
||||||
#ifndef ETHERNET
|
#ifndef ETHERNET
|
||||||
|
|
||||||
struct mod_ctrl module_control = {cfs_read};
|
struct mod_ctrl module_control = {cfs_read};
|
||||||
u8_t byte;
|
uint8_t byte;
|
||||||
|
|
||||||
module_control.callerdata = cfs_open(config->name, CFS_READ);
|
module_control.callerdata = cfs_open(config->name, CFS_READ);
|
||||||
if(module_control.callerdata < 0) {
|
if(module_control.callerdata < 0) {
|
||||||
|
@ -103,7 +103,7 @@ ethernet_init(struct ethernet_config *config)
|
||||||
uip_setethaddr(module->ethernet_address);
|
uip_setethaddr(module->ethernet_address);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
ethernet_poll(void)
|
ethernet_poll(void)
|
||||||
{
|
{
|
||||||
return module->poll();
|
return module->poll();
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#define __ETHERNET_H__
|
#define __ETHERNET_H__
|
||||||
|
|
||||||
void CC_FASTCALL ethernet_init(struct ethernet_config *config);
|
void CC_FASTCALL ethernet_init(struct ethernet_config *config);
|
||||||
u16_t ethernet_poll(void);
|
uint16_t ethernet_poll(void);
|
||||||
void ethernet_send(void);
|
void ethernet_send(void);
|
||||||
void ethernet_exit(void);
|
void ethernet_exit(void);
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#pragma optimize(push, off)
|
#pragma optimize(push, off)
|
||||||
void
|
void
|
||||||
uip_add32(u8_t *op32, u16_t op16)
|
uip_add32(uint8_t *op32, uint16_t op16)
|
||||||
{
|
{
|
||||||
asm("ldy #3");
|
asm("ldy #3");
|
||||||
asm("jsr ldaxysp");
|
asm("jsr ldaxysp");
|
||||||
|
@ -71,12 +71,12 @@ uip_add32(u8_t *op32, u16_t op16)
|
||||||
}
|
}
|
||||||
#pragma optimize(pop)
|
#pragma optimize(pop)
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static u16_t chksum_ptr, chksum_len, chksum_tmp;
|
static uint16_t chksum_ptr, chksum_len, chksum_tmp;
|
||||||
static u8_t chksum_protocol;
|
static uint8_t chksum_protocol;
|
||||||
static u16_t chksum(void);
|
static uint16_t chksum(void);
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#pragma optimize(push, off)
|
#pragma optimize(push, off)
|
||||||
u16_t
|
uint16_t
|
||||||
chksum(void) {
|
chksum(void) {
|
||||||
|
|
||||||
asm("lda #0");
|
asm("lda #0");
|
||||||
|
@ -172,14 +172,14 @@ chksum(void) {
|
||||||
}
|
}
|
||||||
#pragma optimize(pop)
|
#pragma optimize(pop)
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
uip_chksum(u16_t *buf, u16_t len)
|
uip_chksum(uint16_t *buf, uint16_t len)
|
||||||
{
|
{
|
||||||
/* unsigned long sum;
|
/* unsigned long sum;
|
||||||
|
|
||||||
sum = 0;
|
sum = 0;
|
||||||
|
|
||||||
chksum_ptr = (u16_t)buf;
|
chksum_ptr = (uint16_t)buf;
|
||||||
while(len >= 256) {
|
while(len >= 256) {
|
||||||
chksum_len = 256;
|
chksum_len = 256;
|
||||||
sum += chksum();
|
sum += chksum();
|
||||||
|
@ -199,28 +199,28 @@ uip_chksum(u16_t *buf, u16_t len)
|
||||||
return sum;*/
|
return sum;*/
|
||||||
|
|
||||||
chksum_len = len;
|
chksum_len = len;
|
||||||
chksum_ptr = (u16_t)buf;
|
chksum_ptr = (uint16_t)buf;
|
||||||
return chksum();
|
return chksum();
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
uip_ipchksum(void)
|
uip_ipchksum(void)
|
||||||
{
|
{
|
||||||
chksum_ptr = (u16_t)uip_buf + UIP_LLH_LEN;
|
chksum_ptr = (uint16_t)uip_buf + UIP_LLH_LEN;
|
||||||
chksum_len = UIP_IPH_LEN;
|
chksum_len = UIP_IPH_LEN;
|
||||||
return chksum();
|
return chksum();
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#pragma optimize(push, off)
|
#pragma optimize(push, off)
|
||||||
static u16_t
|
static uint16_t
|
||||||
transport_chksum(u8_t protocol)
|
transport_chksum(uint8_t protocol)
|
||||||
{
|
{
|
||||||
chksum_protocol = protocol;
|
chksum_protocol = protocol;
|
||||||
chksum_ptr = (u16_t)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN];
|
chksum_ptr = (uint16_t)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN];
|
||||||
chksum_len = UIP_TCPH_LEN;
|
chksum_len = UIP_TCPH_LEN;
|
||||||
chksum_tmp = chksum();
|
chksum_tmp = chksum();
|
||||||
|
|
||||||
chksum_ptr = (u16_t)uip_appdata;
|
chksum_ptr = (uint16_t)uip_appdata;
|
||||||
asm("lda _uip_aligned_buf+3+%b", UIP_LLH_LEN);
|
asm("lda _uip_aligned_buf+3+%b", UIP_LLH_LEN);
|
||||||
asm("sec");
|
asm("sec");
|
||||||
asm("sbc #%b", UIP_IPTCPH_LEN);
|
asm("sbc #%b", UIP_IPTCPH_LEN);
|
||||||
|
@ -313,16 +313,16 @@ transport_chksum(u8_t protocol)
|
||||||
#pragma optimize(pop)
|
#pragma optimize(pop)
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
u16_t
|
uint16_t
|
||||||
uip_tcpchksum(void)
|
uip_tcpchksum(void)
|
||||||
{
|
{
|
||||||
return transport_chksum(IP_PROTO_TCP);
|
return transport_chksum(IP_PROTO_TCP);
|
||||||
#if 0
|
#if 0
|
||||||
chksum_ptr = (u16_t)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN];
|
chksum_ptr = (uint16_t)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN];
|
||||||
chksum_len = UIP_TCPH_LEN;
|
chksum_len = UIP_TCPH_LEN;
|
||||||
chksum_tmp = chksum();
|
chksum_tmp = chksum();
|
||||||
|
|
||||||
chksum_ptr = (u16_t)uip_appdata;
|
chksum_ptr = (uint16_t)uip_appdata;
|
||||||
asm("lda _uip_buf+3+%b", UIP_LLH_LEN);
|
asm("lda _uip_buf+3+%b", UIP_LLH_LEN);
|
||||||
asm("sec");
|
asm("sec");
|
||||||
asm("sbc #%b", UIP_IPTCPH_LEN);
|
asm("sbc #%b", UIP_IPTCPH_LEN);
|
||||||
|
@ -416,16 +416,16 @@ uip_tcpchksum(void)
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
#if UIP_UDP_CHECKSUMS
|
#if UIP_UDP_CHECKSUMS
|
||||||
u16_t
|
uint16_t
|
||||||
uip_udpchksum(void)
|
uip_udpchksum(void)
|
||||||
{
|
{
|
||||||
return transport_chksum(IP_PROTO_UDP);
|
return transport_chksum(IP_PROTO_UDP);
|
||||||
#if 0
|
#if 0
|
||||||
chksum_ptr = (u16_t)&uip_buf[20 + UIP_LLH_LEN];
|
chksum_ptr = (uint16_t)&uip_buf[20 + UIP_LLH_LEN];
|
||||||
chksum_len = 20;
|
chksum_len = 20;
|
||||||
chksum_tmp = chksum();
|
chksum_tmp = chksum();
|
||||||
|
|
||||||
chksum_ptr = (u16_t)uip_appdata;
|
chksum_ptr = (uint16_t)uip_appdata;
|
||||||
asm("lda _uip_buf+3+%b", UIP_LLH_LEN);
|
asm("lda _uip_buf+3+%b", UIP_LLH_LEN);
|
||||||
asm("sec");
|
asm("sec");
|
||||||
asm("sbc #40");
|
asm("sbc #40");
|
||||||
|
|
|
@ -106,18 +106,18 @@ static const char *err_msgs[] =
|
||||||
#define UDPDATASIZE 32
|
#define UDPDATASIZE 32
|
||||||
|
|
||||||
struct codeprop_udphdr {
|
struct codeprop_udphdr {
|
||||||
u16_t id;
|
uint16_t id;
|
||||||
u16_t type;
|
uint16_t type;
|
||||||
#define TYPE_DATA 0x0001
|
#define TYPE_DATA 0x0001
|
||||||
#define TYPE_NACK 0x0002
|
#define TYPE_NACK 0x0002
|
||||||
u16_t addr;
|
uint16_t addr;
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u8_t data[UDPDATASIZE];
|
uint8_t data[UDPDATASIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct codeprop_tcphdr {
|
struct codeprop_tcphdr {
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u16_t pad;
|
uint16_t pad;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void uipcall(void *state);
|
static void uipcall(void *state);
|
||||||
|
@ -125,19 +125,19 @@ static void uipcall(void *state);
|
||||||
PROCESS(codeprop_process, "Code propagator");
|
PROCESS(codeprop_process, "Code propagator");
|
||||||
|
|
||||||
struct codeprop_state {
|
struct codeprop_state {
|
||||||
u8_t state;
|
uint8_t state;
|
||||||
#define STATE_NONE 0
|
#define STATE_NONE 0
|
||||||
#define STATE_RECEIVING_TCPDATA 1
|
#define STATE_RECEIVING_TCPDATA 1
|
||||||
#define STATE_RECEIVING_UDPDATA 2
|
#define STATE_RECEIVING_UDPDATA 2
|
||||||
#define STATE_SENDING_UDPDATA 3
|
#define STATE_SENDING_UDPDATA 3
|
||||||
u16_t count;
|
uint16_t count;
|
||||||
u16_t addr;
|
uint16_t addr;
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
u16_t id;
|
uint16_t id;
|
||||||
struct etimer sendtimer;
|
struct etimer sendtimer;
|
||||||
struct timer nacktimer, timer, starttimer;
|
struct timer nacktimer, timer, starttimer;
|
||||||
u8_t received;
|
uint8_t received;
|
||||||
u8_t send_counter;
|
uint8_t send_counter;
|
||||||
struct pt tcpthread_pt;
|
struct pt tcpthread_pt;
|
||||||
struct pt udpthread_pt;
|
struct pt udpthread_pt;
|
||||||
struct pt recv_udpthread_pt;
|
struct pt recv_udpthread_pt;
|
||||||
|
@ -200,10 +200,10 @@ PROCESS_THREAD(codeprop_process, ev, data)
|
||||||
PROCESS_END();
|
PROCESS_END();
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
static u16_t
|
static uint16_t
|
||||||
send_udpdata(struct codeprop_udphdr *uh)
|
send_udpdata(struct codeprop_udphdr *uh)
|
||||||
{
|
{
|
||||||
u16_t len;
|
uint16_t len;
|
||||||
|
|
||||||
uh->type = UIP_HTONS(TYPE_DATA);
|
uh->type = UIP_HTONS(TYPE_DATA);
|
||||||
uh->addr = uip_htons(s.addr);
|
uh->addr = uip_htons(s.addr);
|
||||||
|
|
|
@ -46,7 +46,7 @@ init_recv_buffer()
|
||||||
recv_buffer.flags = USB_BUFFER_SHORT_END | USB_BUFFER_NOTIFY;
|
recv_buffer.flags = USB_BUFFER_SHORT_END | USB_BUFFER_NOTIFY;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8_t
|
uint8_t
|
||||||
usbeth_send(void)
|
usbeth_send(void)
|
||||||
{
|
{
|
||||||
if ((xmit_buffer[0].flags & USB_BUFFER_SUBMITTED)) return UIP_FW_DROPPED;
|
if ((xmit_buffer[0].flags & USB_BUFFER_SUBMITTED)) return UIP_FW_DROPPED;
|
||||||
|
|
|
@ -315,7 +315,7 @@ static uip_ipaddr_t bcast_addr;
|
||||||
static void
|
static void
|
||||||
send_offer(struct uip_udp_conn *conn, struct dhcps_client_lease *lease)
|
send_offer(struct uip_udp_conn *conn, struct dhcps_client_lease *lease)
|
||||||
{
|
{
|
||||||
u8_t *end;
|
uint8_t *end;
|
||||||
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
||||||
|
|
||||||
create_msg(m);
|
create_msg(m);
|
||||||
|
@ -327,13 +327,13 @@ send_offer(struct uip_udp_conn *conn, struct dhcps_client_lease *lease)
|
||||||
end = add_config(end);
|
end = add_config(end);
|
||||||
end = add_end(end);
|
end = add_end(end);
|
||||||
uip_ipaddr_copy(&conn->ripaddr, &bcast_addr);
|
uip_ipaddr_copy(&conn->ripaddr, &bcast_addr);
|
||||||
uip_send(uip_appdata, (int)(end - (u8_t *)uip_appdata));
|
uip_send(uip_appdata, (int)(end - (uint8_t *)uip_appdata));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
send_ack(struct uip_udp_conn *conn, struct dhcps_client_lease *lease)
|
send_ack(struct uip_udp_conn *conn, struct dhcps_client_lease *lease)
|
||||||
{
|
{
|
||||||
u8_t *end;
|
uint8_t *end;
|
||||||
uip_ipaddr_t ciaddr;
|
uip_ipaddr_t ciaddr;
|
||||||
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
||||||
|
|
||||||
|
@ -347,13 +347,13 @@ send_ack(struct uip_udp_conn *conn, struct dhcps_client_lease *lease)
|
||||||
end = add_end(end);
|
end = add_end(end);
|
||||||
memcpy(&ciaddr, &lease->ipaddr,4);
|
memcpy(&ciaddr, &lease->ipaddr,4);
|
||||||
uip_ipaddr_copy(&conn->ripaddr, &bcast_addr);
|
uip_ipaddr_copy(&conn->ripaddr, &bcast_addr);
|
||||||
uip_send(uip_appdata, (int)(end - (u8_t *)uip_appdata));
|
uip_send(uip_appdata, (int)(end - (uint8_t *)uip_appdata));
|
||||||
printf("ACK\n");
|
printf("ACK\n");
|
||||||
}
|
}
|
||||||
static void
|
static void
|
||||||
send_nack(struct uip_udp_conn *conn)
|
send_nack(struct uip_udp_conn *conn)
|
||||||
{
|
{
|
||||||
u8_t *end;
|
uint8_t *end;
|
||||||
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
||||||
|
|
||||||
create_msg(m);
|
create_msg(m);
|
||||||
|
@ -364,7 +364,7 @@ send_nack(struct uip_udp_conn *conn)
|
||||||
end = add_end(end);
|
end = add_end(end);
|
||||||
|
|
||||||
uip_ipaddr_copy(&conn->ripaddr, &bcast_addr);
|
uip_ipaddr_copy(&conn->ripaddr, &bcast_addr);
|
||||||
uip_send(uip_appdata, (int)(end - (u8_t *)uip_appdata));
|
uip_send(uip_appdata, (int)(end - (uint8_t *)uip_appdata));
|
||||||
printf("NACK\n");
|
printf("NACK\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ delay(void)
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static char buffer[40];
|
static char buffer[40];
|
||||||
static prog_char hextab[] =
|
static const char hextab[] PROGMEM =
|
||||||
{'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
|
{'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
|
@ -60,7 +60,7 @@ debug_print16(unsigned short v)
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
debug_print(prog_char *str)
|
debug_print(char *str)
|
||||||
{
|
{
|
||||||
/* unsigned char i;
|
/* unsigned char i;
|
||||||
|
|
||||||
|
|
|
@ -476,17 +476,17 @@
|
||||||
|
|
||||||
#define MSBV(bit) (1 << ((bit) - 8))
|
#define MSBV(bit) (1 << ((bit) - 8))
|
||||||
|
|
||||||
#define nic_outlb(addr, val) (*(volatile u8_t *)(addr) = (val))
|
#define nic_outlb(addr, val) (*(volatile uint8_t *)(addr) = (val))
|
||||||
#define nic_outhb(addr, val) (*(volatile u8_t *)((addr) + 1) = (val))
|
#define nic_outhb(addr, val) (*(volatile uint8_t *)((addr) + 1) = (val))
|
||||||
#define nic_outwx(addr, val) (*(volatile u16_t *)(addr) = (val))
|
#define nic_outwx(addr, val) (*(volatile uint16_t *)(addr) = (val))
|
||||||
#define nic_outw(addr, val) { \
|
#define nic_outw(addr, val) { \
|
||||||
*(volatile u8_t *)(addr) = (u8_t)(val); \
|
*(volatile uint8_t *)(addr) = (uint8_t)(val); \
|
||||||
*((volatile u8_t *)(addr) + 1) = (u8_t)((val) >> 8); \
|
*((volatile uint8_t *)(addr) + 1) = (uint8_t)((val) >> 8); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define nic_inlb(addr) (*(volatile u8_t *)(addr))
|
#define nic_inlb(addr) (*(volatile uint8_t *)(addr))
|
||||||
#define nic_inhb(addr) (*(volatile u8_t *)((addr) + 1))
|
#define nic_inhb(addr) (*(volatile uint8_t *)((addr) + 1))
|
||||||
#define nic_inw(addr) (*(volatile u16_t *)(addr))
|
#define nic_inw(addr) (*(volatile uint16_t *)(addr))
|
||||||
|
|
||||||
#define nic_bs(bank) nic_outlb(NIC_BSR, bank)
|
#define nic_bs(bank) nic_outlb(NIC_BSR, bank)
|
||||||
|
|
||||||
|
@ -513,11 +513,11 @@
|
||||||
*
|
*
|
||||||
* \return Contents of the PHY interface rgister.
|
* \return Contents of the PHY interface rgister.
|
||||||
*/
|
*/
|
||||||
static u8_t NicPhyRegSelect(u8_t reg, u8_t we)
|
static uint8_t NicPhyRegSelect(uint8_t reg, uint8_t we)
|
||||||
{
|
{
|
||||||
u8_t rs;
|
uint8_t rs;
|
||||||
u8_t msk;
|
uint8_t msk;
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
nic_bs(3);
|
nic_bs(3);
|
||||||
rs = (nic_inlb(NIC_MGMT) & ~(MGMT_MCLK | MGMT_MDO)) | MGMT_MDOE;
|
rs = (nic_inlb(NIC_MGMT) & ~(MGMT_MCLK | MGMT_MDO)) | MGMT_MDOE;
|
||||||
|
@ -577,11 +577,11 @@ static u8_t NicPhyRegSelect(u8_t reg, u8_t we)
|
||||||
*
|
*
|
||||||
* \return Contents of the specified register.
|
* \return Contents of the specified register.
|
||||||
*/
|
*/
|
||||||
static u16_t NicPhyRead(u8_t reg)
|
static uint16_t NicPhyRead(uint8_t reg)
|
||||||
{
|
{
|
||||||
u16_t rc = 0;
|
uint16_t rc = 0;
|
||||||
u8_t rs;
|
uint8_t rs;
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
/* Select register for reading. */
|
/* Select register for reading. */
|
||||||
rs = NicPhyRegSelect(reg, 0);
|
rs = NicPhyRegSelect(reg, 0);
|
||||||
|
@ -613,10 +613,10 @@ static u16_t NicPhyRead(u8_t reg)
|
||||||
* \param reg PHY register number.
|
* \param reg PHY register number.
|
||||||
* \param val Value to write.
|
* \param val Value to write.
|
||||||
*/
|
*/
|
||||||
static void NicPhyWrite(u8_t reg, u16_t val)
|
static void NicPhyWrite(uint8_t reg, uint16_t val)
|
||||||
{
|
{
|
||||||
u16_t msk;
|
uint16_t msk;
|
||||||
u8_t rs;
|
uint8_t rs;
|
||||||
|
|
||||||
/* Select register for writing. */
|
/* Select register for writing. */
|
||||||
rs = NicPhyRegSelect(reg, 1);
|
rs = NicPhyRegSelect(reg, 1);
|
||||||
|
@ -649,10 +649,10 @@ static void NicPhyWrite(u8_t reg, u16_t val)
|
||||||
*/
|
*/
|
||||||
static int NicPhyConfig(void)
|
static int NicPhyConfig(void)
|
||||||
{
|
{
|
||||||
u16_t phy_sor;
|
uint16_t phy_sor;
|
||||||
u16_t phy_sr;
|
uint16_t phy_sr;
|
||||||
u16_t phy_to;
|
uint16_t phy_to;
|
||||||
u16_t mode;
|
uint16_t mode;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reset the PHY and wait until this self clearing bit
|
* Reset the PHY and wait until this self clearing bit
|
||||||
|
@ -739,7 +739,7 @@ static int NicPhyConfig(void)
|
||||||
*
|
*
|
||||||
* \return 0 on success or -1 on timeout.
|
* \return 0 on success or -1 on timeout.
|
||||||
*/
|
*/
|
||||||
static INLINE int NicMmuWait(u16_t tmo)
|
static INLINE int NicMmuWait(uint16_t tmo)
|
||||||
{
|
{
|
||||||
while (tmo--) {
|
while (tmo--) {
|
||||||
if ((nic_inlb(NIC_MMUCR) & MMUCR_BUSY) == 0)
|
if ((nic_inlb(NIC_MMUCR) & MMUCR_BUSY) == 0)
|
||||||
|
@ -803,9 +803,9 @@ static int NicReset(void)
|
||||||
*
|
*
|
||||||
* \param mac Six byte unique MAC address.
|
* \param mac Six byte unique MAC address.
|
||||||
*/
|
*/
|
||||||
static int NicStart(CONST u8_t * mac)
|
static int NicStart(CONST uint8_t * mac)
|
||||||
{
|
{
|
||||||
u8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
if (NicReset())
|
if (NicReset())
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -843,8 +843,8 @@ static int NicStart(CONST u8_t * mac)
|
||||||
#if 0
|
#if 0
|
||||||
static void NicInterrupt(void *arg)
|
static void NicInterrupt(void *arg)
|
||||||
{
|
{
|
||||||
u8_t isr;
|
uint8_t isr;
|
||||||
u8_t imr;
|
uint8_t imr;
|
||||||
NICINFO *ni = (NICINFO *) ((NUTDEVICE *) arg)->dev_dcb;
|
NICINFO *ni = (NICINFO *) ((NUTDEVICE *) arg)->dev_dcb;
|
||||||
|
|
||||||
ni->ni_interrupts++;
|
ni->ni_interrupts++;
|
||||||
|
@ -912,11 +912,11 @@ static void NicInterrupt(void *arg)
|
||||||
/*
|
/*
|
||||||
* Write data block to the NIC.
|
* Write data block to the NIC.
|
||||||
*/
|
*/
|
||||||
static void NicWrite(u8_t * buf, u16_t len)
|
static void NicWrite(uint8_t * buf, uint16_t len)
|
||||||
{
|
{
|
||||||
register u16_t l = len - 1;
|
register uint16_t l = len - 1;
|
||||||
register u8_t ih = (u16_t) l >> 8;
|
register uint8_t ih = (uint16_t) l >> 8;
|
||||||
register u8_t il = (u8_t) l;
|
register uint8_t il = (uint8_t) l;
|
||||||
|
|
||||||
if (!len)
|
if (!len)
|
||||||
return;
|
return;
|
||||||
|
@ -931,11 +931,11 @@ static void NicWrite(u8_t * buf, u16_t len)
|
||||||
/*
|
/*
|
||||||
* Read data block from the NIC.
|
* Read data block from the NIC.
|
||||||
*/
|
*/
|
||||||
static void NicRead(u8_t * buf, u16_t len)
|
static void NicRead(uint8_t * buf, uint16_t len)
|
||||||
{
|
{
|
||||||
register u16_t l = len - 1;
|
register uint16_t l = len - 1;
|
||||||
register u8_t ih = (u16_t) l >> 8;
|
register uint8_t ih = (uint16_t) l >> 8;
|
||||||
register u8_t il = (u8_t) l;
|
register uint8_t il = (uint8_t) l;
|
||||||
|
|
||||||
if (!len)
|
if (!len)
|
||||||
return;
|
return;
|
||||||
|
@ -960,9 +960,9 @@ static void NicRead(u8_t * buf, u16_t len)
|
||||||
static NETBUF *NicGetPacket(void)
|
static NETBUF *NicGetPacket(void)
|
||||||
{
|
{
|
||||||
NETBUF *nb = 0;
|
NETBUF *nb = 0;
|
||||||
//u8_t *buf;
|
//uint8_t *buf;
|
||||||
u16_t fsw;
|
uint16_t fsw;
|
||||||
u16_t fbc;
|
uint16_t fbc;
|
||||||
|
|
||||||
/* Check the fifo empty bit. If it is set, then there is
|
/* Check the fifo empty bit. If it is set, then there is
|
||||||
nothing in the receiver fifo. */
|
nothing in the receiver fifo. */
|
||||||
|
@ -1028,9 +1028,9 @@ static NETBUF *NicGetPacket(void)
|
||||||
#if 0
|
#if 0
|
||||||
static int NicPutPacket(NETBUF * nb)
|
static int NicPutPacket(NETBUF * nb)
|
||||||
{
|
{
|
||||||
u16_t sz;
|
uint16_t sz;
|
||||||
u8_t odd = 0;
|
uint8_t odd = 0;
|
||||||
u8_t imsk;
|
uint8_t imsk;
|
||||||
|
|
||||||
//printf("[P]");
|
//printf("[P]");
|
||||||
/*
|
/*
|
||||||
|
@ -1130,7 +1130,7 @@ PROCESS_THREAD(lanc111_process, ev, data)
|
||||||
IFNET *ifn;
|
IFNET *ifn;
|
||||||
NICINFO *ni;
|
NICINFO *ni;
|
||||||
NETBUF *nb;*/
|
NETBUF *nb;*/
|
||||||
u8_t imsk;
|
uint8_t imsk;
|
||||||
static struct etimer et;
|
static struct etimer et;
|
||||||
|
|
||||||
/* dev = arg;
|
/* dev = arg;
|
||||||
|
|
|
@ -384,14 +384,6 @@ rs232_set_input(uint8_t port, int (*f)(unsigned char))
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
rs232_print_p(uint8_t port, prog_char *buf)
|
|
||||||
{
|
|
||||||
while(pgm_read_byte(buf)) {
|
|
||||||
rs232_send(port, pgm_read_byte(buf));
|
|
||||||
++buf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
rs232_print(uint8_t port, char *buf)
|
rs232_print(uint8_t port, char *buf)
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
* Author: Adam Dunkels <adam@sics.se>
|
||||||
* Simon Barner <barner@in.tum.de>
|
* Simon Barner <barner@in.tum.de>
|
||||||
*
|
*
|
||||||
* @(#)$Id: rs232.h,v 1.6 2008/11/29 18:36:12 c_oflynn Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __RS232_H__
|
#ifndef __RS232_H__
|
||||||
|
@ -111,19 +110,6 @@ rs232_set_input(uint8_t port, int (* f)(unsigned char));
|
||||||
* configured for this function to work.
|
* configured for this function to work.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rs232_print_p(uint8_t port, prog_char *buf);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Print a text string on RS232
|
|
||||||
* \param port The RS232 port to be used.
|
|
||||||
* \param str A pointer to the string that is to be printed
|
|
||||||
*
|
|
||||||
* This function prints a string to RS232. The string must
|
|
||||||
* be terminated by a null byte. The RS232 module must be
|
|
||||||
* correctly initalized and configured for this function
|
|
||||||
* to work.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
rs232_print(uint8_t port, char *buf);
|
rs232_print(uint8_t port, char *buf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
PROCESS(rtl8019_process, "RTL8019 driver");
|
PROCESS(rtl8019_process, "RTL8019 driver");
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
u8_t
|
uint8_t
|
||||||
rtl8019_output(void)
|
rtl8019_output(void)
|
||||||
{
|
{
|
||||||
uip_arp_out();
|
uip_arp_out();
|
||||||
|
|
|
@ -41,6 +41,6 @@
|
||||||
|
|
||||||
PROCESS_NAME(rtl8019_process);
|
PROCESS_NAME(rtl8019_process);
|
||||||
|
|
||||||
u8_t rtl8019_output(void);
|
uint8_t rtl8019_output(void);
|
||||||
|
|
||||||
#endif /* __RTL8019_DRV_H__ */
|
#endif /* __RTL8019_DRV_H__ */
|
||||||
|
|
|
@ -332,7 +332,7 @@ typedef char r_uart_ptchar;
|
||||||
#define _ConstType_ __flash
|
#define _ConstType_ __flash
|
||||||
#define _MemType_
|
#define _MemType_
|
||||||
#define _GenericType_ __generic
|
#define _GenericType_ __generic
|
||||||
#define FLASH PROGMEM
|
#define FLASH const PROGMEM
|
||||||
#define XDATA
|
#define XDATA
|
||||||
#define IDATA
|
#define IDATA
|
||||||
#define DATA
|
#define DATA
|
||||||
|
|
|
@ -93,7 +93,7 @@ extern U8 data_to_transfer;
|
||||||
/**
|
/**
|
||||||
* \brief List of supported RNDIS OID's
|
* \brief List of supported RNDIS OID's
|
||||||
*/
|
*/
|
||||||
prog_uint32_t OIDSupportedList[] = {
|
const uint32_t OIDSupportedList[] PROGMEM = {
|
||||||
/* Required General */
|
/* Required General */
|
||||||
OID_GEN_SUPPORTED_LIST ,
|
OID_GEN_SUPPORTED_LIST ,
|
||||||
OID_GEN_HARDWARE_STATUS ,
|
OID_GEN_HARDWARE_STATUS ,
|
||||||
|
|
|
@ -250,6 +250,7 @@ void usb_get_string_descriptor_sram(U8 string_type) {
|
||||||
|
|
||||||
dummy = Usb_read_byte(); //!< don't care of wIndex field
|
dummy = Usb_read_byte(); //!< don't care of wIndex field
|
||||||
dummy = Usb_read_byte();
|
dummy = Usb_read_byte();
|
||||||
|
if (dummy) {;} //avoid gcc unused variable warning
|
||||||
requested_length = Usb_read_byte(); //!< read wLength
|
requested_length = Usb_read_byte(); //!< read wLength
|
||||||
requested_length |= Usb_read_byte()<<8;
|
requested_length |= Usb_read_byte()<<8;
|
||||||
|
|
||||||
|
@ -341,6 +342,7 @@ void usb_get_string_descriptor(U8 string_type) {
|
||||||
|
|
||||||
dummy = Usb_read_byte(); //!< don't care of wIndex field
|
dummy = Usb_read_byte(); //!< don't care of wIndex field
|
||||||
dummy = Usb_read_byte();
|
dummy = Usb_read_byte();
|
||||||
|
if (dummy) {;}
|
||||||
requested_length = Usb_read_byte(); //!< read wLength
|
requested_length = Usb_read_byte(); //!< read wLength
|
||||||
requested_length |= Usb_read_byte()<<8;
|
requested_length |= Usb_read_byte()<<8;
|
||||||
|
|
||||||
|
@ -468,6 +470,7 @@ void usb_get_descriptor(void)
|
||||||
default:
|
default:
|
||||||
dummy = Usb_read_byte();
|
dummy = Usb_read_byte();
|
||||||
dummy = Usb_read_byte();
|
dummy = Usb_read_byte();
|
||||||
|
if (dummy) {;}
|
||||||
LSBwLength = Usb_read_byte();
|
LSBwLength = Usb_read_byte();
|
||||||
MSBwLength = Usb_read_byte();
|
MSBwLength = Usb_read_byte();
|
||||||
byteswereread=1;
|
byteswereread=1;
|
||||||
|
@ -567,6 +570,7 @@ U8 dummy;
|
||||||
|
|
||||||
dummy = Usb_read_byte(); //!< dummy read
|
dummy = Usb_read_byte(); //!< dummy read
|
||||||
dummy = Usb_read_byte(); //!< dummy read
|
dummy = Usb_read_byte(); //!< dummy read
|
||||||
|
if (dummy) {;}
|
||||||
wIndex = Usb_read_byte();
|
wIndex = Usb_read_byte();
|
||||||
|
|
||||||
switch(bmRequestType)
|
switch(bmRequestType)
|
||||||
|
@ -617,6 +621,7 @@ U8 dummy;
|
||||||
{
|
{
|
||||||
wValue = Usb_read_byte();
|
wValue = Usb_read_byte();
|
||||||
dummy = Usb_read_byte(); //!< dummy read
|
dummy = Usb_read_byte(); //!< dummy read
|
||||||
|
if (dummy) {;}
|
||||||
|
|
||||||
if (wValue == FEATURE_ENDPOINT_HALT)
|
if (wValue == FEATURE_ENDPOINT_HALT)
|
||||||
{
|
{
|
||||||
|
@ -673,6 +678,7 @@ U8 dummy;
|
||||||
{
|
{
|
||||||
wValue = Usb_read_byte();
|
wValue = Usb_read_byte();
|
||||||
dummy = Usb_read_byte(); //!< dummy read
|
dummy = Usb_read_byte(); //!< dummy read
|
||||||
|
if (dummy) {;}
|
||||||
|
|
||||||
if (wValue == FEATURE_ENDPOINT_HALT)
|
if (wValue == FEATURE_ENDPOINT_HALT)
|
||||||
{
|
{
|
||||||
|
@ -730,6 +736,7 @@ void usb_set_interface (void)
|
||||||
|
|
||||||
alt_setting = Usb_read_byte();
|
alt_setting = Usb_read_byte();
|
||||||
dummy = Usb_read_byte();
|
dummy = Usb_read_byte();
|
||||||
|
if (dummy) {;}
|
||||||
interface = Usb_read_byte();
|
interface = Usb_read_byte();
|
||||||
|
|
||||||
if(usb_user_set_alt_interface(interface, alt_setting)) {
|
if(usb_user_set_alt_interface(interface, alt_setting)) {
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
* \author Adam Dunkels <adam@sics.se>
|
* \author Adam Dunkels <adam@sics.se>
|
||||||
* \author Simon Barner <barner@in.tum.de>
|
* \author Simon Barner <barner@in.tum.de>
|
||||||
*
|
*
|
||||||
* @(#)$Id: mtarch.c,v 1.1 2006/12/22 16:55:53 barner Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
|
@ -214,6 +213,12 @@ void
|
||||||
mtarch_pstart(void)
|
mtarch_pstart(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
|
mtarch_stop(struct mtarch_thread *t)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
int
|
int
|
||||||
|
|
|
@ -81,6 +81,7 @@
|
||||||
#define SR_CCA_REQUEST 0x08, 0x80, 7
|
#define SR_CCA_REQUEST 0x08, 0x80, 7
|
||||||
#define SR_CCA_DONE 0x01, 0x80, 7
|
#define SR_CCA_DONE 0x01, 0x80, 7
|
||||||
#define SR_CCA_STATUS 0x01, 0x40, 6
|
#define SR_CCA_STATUS 0x01, 0x40, 6
|
||||||
|
#define SR_AACK_SET_PD 0x2e, 0x20, 5
|
||||||
|
|
||||||
|
|
||||||
/* RF230 register assignments, for reference */
|
/* RF230 register assignments, for reference */
|
||||||
|
|
|
@ -855,9 +855,6 @@ rf230_transmit(unsigned short payload_len)
|
||||||
/* This automatically does the PLL calibrations */
|
/* This automatically does the PLL calibrations */
|
||||||
if (hal_get_slptr()) {
|
if (hal_get_slptr()) {
|
||||||
#if defined(__AVR_ATmega128RFA1__)
|
#if defined(__AVR_ATmega128RFA1__)
|
||||||
if (radiowason) DEBUGFLOW('e');
|
|
||||||
radiowason=0;
|
|
||||||
// DEBUGFLOW('j');
|
|
||||||
ENERGEST_ON(ENERGEST_TYPE_LED_RED);
|
ENERGEST_ON(ENERGEST_TYPE_LED_RED);
|
||||||
#if RF230BB_CONF_LEDONPORTE1
|
#if RF230BB_CONF_LEDONPORTE1
|
||||||
PORTE|=(1<<PE1); //ledon
|
PORTE|=(1<<PE1); //ledon
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue