Converted u8_t to uint8_t and u16_t to uint16_t in the apps directory.
This commit is contained in:
parent
1cda3da17e
commit
efab964451
|
@ -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) {
|
||||||
|
|
|
@ -273,7 +273,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);
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,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
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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 */
|
||||||
};
|
};
|
||||||
|
|
|
@ -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 */
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue