Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki

This commit is contained in:
Nicolas Tsiftes 2011-12-08 15:57:30 +01:00
commit c6fb738f98
91 changed files with 946 additions and 7101 deletions

View file

@ -76,7 +76,7 @@ db_get_result_message(db_result_t code)
case DB_NAME_ERROR:
return "Invalid name";
case DB_RELATIONAL_ERROR:
return "Relational algebra error";
return "Semantic error";
case DB_TYPE_ERROR:
return "Type error";
case DB_IMPLEMENTATION_ERROR:

View file

@ -98,7 +98,7 @@ aql_execute(db_handle_t *handle, aql_adt_t *adt)
switch(optype) {
case AQL_TYPE_CREATE_ATTRIBUTE:
attr = &adt->attributes[0];
if(relation_attribute_add(rel, DB_MEMORY, attr->name, attr->domain,
if(relation_attribute_add(rel, DB_STORAGE, attr->name, attr->domain,
attr->element_size) != NULL) {
result = DB_OK;
}

View file

@ -123,9 +123,9 @@ int
uint32_2_bytes(uint8_t *bytes, uint32_t var)
{
int i = 0;
if (0xFF000000 & var) bytes[i++] = var>>24;
if (0xFF0000 & var) bytes[i++] = var>>16;
if (0xFF00 & var) bytes[i++] = var>>8;
if (0xFF000000 & var) bytes[i++] = (0xFF & var>>24);
if (0xFFFF0000 & var) bytes[i++] = (0xFF & var>>16);
if (0xFFFFFF00 & var) bytes[i++] = (0xFF & var>>8);
bytes[i++] = 0xFF & var;
return i;

View file

@ -136,10 +136,10 @@ serialize_int_option(int number, int current_number, uint8_t *buffer, uint32_t v
uint8_t *option = &buffer[i];
if (0xFF000000 & value) buffer[++i] = (uint8_t) (value>>24);
if (0x00FF0000 & value) buffer[++i] = (uint8_t) (value>>16);
if (0x0000FF00 & value) buffer[++i] = (uint8_t) (value>>8);
if (0x000000FF & value) buffer[++i] = (uint8_t) value;
if (0xFF000000 & value) buffer[++i] = (uint8_t) (0xFF & value>>24);
if (0xFFFF0000 & value) buffer[++i] = (uint8_t) (0xFF & value>>16);
if (0xFFFFFF00 & value) buffer[++i] = (uint8_t) (0xFF & value>>8);
if ( value) buffer[++i] = (uint8_t) (0xFF & value);
i += set_option_header(number - current_number, i-start_i, option);

View file

@ -148,6 +148,7 @@ handle_incoming_data(void)
}
else
{
block_size = REST_MAX_CHUNK_SIZE;
new_offset = 0;
}
@ -304,7 +305,7 @@ coap_set_rest_status(void *packet, unsigned int code)
/*- Server part ---------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
/* The discover resource is automatically included for CoAP. */
RESOURCE(well_known_core, METHOD_GET, ".well-known/core", "");
RESOURCE(well_known_core, METHOD_GET, ".well-known/core", "ct=40");
void
well_known_core_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
{

View file

@ -137,10 +137,10 @@ serialize_int_option(int number, int current_number, uint8_t *buffer, uint32_t v
uint8_t *option = &buffer[i];
if (0xFF000000 & value) buffer[++i] = (uint8_t) (value>>24);
if (0x00FF0000 & value) buffer[++i] = (uint8_t) (value>>16);
if (0x0000FF00 & value) buffer[++i] = (uint8_t) (value>>8);
if (0x000000FF & value) buffer[++i] = (uint8_t) value;
if (0xFF000000 & value) buffer[++i] = (uint8_t) (0xFF & value>>24);
if (0xFFFF0000 & value) buffer[++i] = (uint8_t) (0xFF & value>>16);
if (0xFFFFFF00 & value) buffer[++i] = (uint8_t) (0xFF & value>>8);
if (0xFFFFFFFF & value) buffer[++i] = (uint8_t) (0xFF & value);
i += set_option_header(number - current_number, i-start_i, option);
@ -680,7 +680,7 @@ coap_parse_message(void *packet, uint8_t *data, uint16_t data_len)
((coap_packet_t *)packet)->block2_num = parse_int_option(current_option, option_len);
((coap_packet_t *)packet)->block2_more = (((coap_packet_t *)packet)->block2_num & 0x08)>>3;
((coap_packet_t *)packet)->block2_size = 16 << (((coap_packet_t *)packet)->block2_num & 0x07);
((coap_packet_t *)packet)->block2_offset = (((coap_packet_t *)packet)->block2_num & ~0x0F)<<(((coap_packet_t *)packet)->block2_num & 0x07);
((coap_packet_t *)packet)->block2_offset = (((coap_packet_t *)packet)->block2_num & ~0x0000000F)<<(((coap_packet_t *)packet)->block2_num & 0x07);
((coap_packet_t *)packet)->block2_num >>= 4;
PRINTF("Block2 [%lu%s (%u B/blk)]\n", ((coap_packet_t *)packet)->block2_num, ((coap_packet_t *)packet)->block2_more ? "+" : "", ((coap_packet_t *)packet)->block2_size);
break;
@ -1035,7 +1035,7 @@ coap_set_header_block2(void *packet, uint32_t num, uint8_t more, uint16_t size)
if (num>0x0FFFFF) return 0;
((coap_packet_t *)packet)->block2_num = num;
((coap_packet_t *)packet)->block2_more = more;
((coap_packet_t *)packet)->block2_more = more ? 1 : 0;
((coap_packet_t *)packet)->block2_size = size;
SET_OPTION((coap_packet_t *)packet, COAP_OPTION_BLOCK2);