1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/openwsn/patches/07-App_rrube_rrube.c.patch
2014-05-14 15:06:50 +02:00

150 lines
4.6 KiB
Diff

*** stock_iot-lab_M3/openwsn/07-App/rrube/rrube.c Thu Apr 24 11:01:37 2014
--- riot-openwsn-wip/openwsn/07-App/rrube/rrube.c Thu Apr 24 16:55:54 2014
***************
*** 8,14 ****
#include "idmanager.h"
#include "board.h"
#include "heli.h"
! #include "leds.h"
//=========================== defines =========================================
--- 8,14 ----
#include "idmanager.h"
#include "board.h"
#include "heli.h"
! #include "leds_ow.h"
//=========================== defines =========================================
***************
*** 37,48 ****
//=========================== prototypes ======================================
! error_t rrube_receive(OpenQueueEntry_t* msg,
coap_header_iht* coap_header,
coap_option_iht* coap_options);
void rrube_timer();
void rrube_sendDone(OpenQueueEntry_t* msg,
! error_t error);
uint8_t hexToAscii(uint8_t hex);
//=========================== public ==========================================
--- 37,48 ----
//=========================== prototypes ======================================
! owerror_t rrube_receive(OpenQueueEntry_t* msg,
coap_header_iht* coap_header,
coap_option_iht* coap_options);
void rrube_timer();
void rrube_sendDone(OpenQueueEntry_t* msg,
! owerror_t error);
uint8_t hexToAscii(uint8_t hex);
//=========================== public ==========================================
***************
*** 70,80 ****
//=========================== private =========================================
! error_t rrube_receive(OpenQueueEntry_t* msg,
coap_header_iht* coap_header,
coap_option_iht* coap_options) {
! error_t outcome;
if (rrube_vars.rrube_state==RRUBE_ST_IDLE &&
coap_header->Code==COAP_CODE_REQ_POST) {
--- 70,80 ----
//=========================== private =========================================
! owerror_t rrube_receive(OpenQueueEntry_t* msg,
coap_header_iht* coap_header,
coap_option_iht* coap_options) {
! owerror_t outcome;
if (rrube_vars.rrube_state==RRUBE_ST_IDLE &&
coap_header->Code==COAP_CODE_REQ_POST) {
***************
*** 90,96 ****
msg->length = 0;
// set the CoAP header
- coap_header->OC = 0;
coap_header->Code = COAP_CODE_RESP_VALID;
// advance state machine
--- 90,95 ----
***************
*** 136,142 ****
void rrube_timer() {
OpenQueueEntry_t* pkt;
uint8_t numOptions;
! error_t outcome;
// turn off heli
heli_off();
--- 135,141 ----
void rrube_timer() {
OpenQueueEntry_t* pkt;
uint8_t numOptions;
! owerror_t outcome;
// turn off heli
heli_off();
***************
*** 161,167 ****
packetfunctions_reserveHeaderSize(pkt,sizeof(rrube_path0)-1);
memcpy(&pkt->payload[0],&rrube_path0,sizeof(rrube_path0)-1);
packetfunctions_reserveHeaderSize(pkt,1);
! pkt->payload[0] = (COAP_OPTION_URIPATH) << 4 |
sizeof(rrube_path0)-1;
numOptions++;
// metadata
--- 160,166 ----
packetfunctions_reserveHeaderSize(pkt,sizeof(rrube_path0)-1);
memcpy(&pkt->payload[0],&rrube_path0,sizeof(rrube_path0)-1);
packetfunctions_reserveHeaderSize(pkt,1);
! pkt->payload[0] = (COAP_OPTION_NUM_URIPATH) << 4 |
sizeof(rrube_path0)-1;
numOptions++;
// metadata
***************
*** 205,211 ****
packetfunctions_reserveHeaderSize(pkt,sizeof(rrube_path0)-1);
memcpy(&pkt->payload[0],&rrube_path0,sizeof(rrube_path0)-1);
packetfunctions_reserveHeaderSize(pkt,1);
! pkt->payload[0] = (COAP_OPTION_URIPATH) << 4 |
sizeof(rrube_path0)-1;
numOptions++;
// metadata
--- 204,210 ----
packetfunctions_reserveHeaderSize(pkt,sizeof(rrube_path0)-1);
memcpy(&pkt->payload[0],&rrube_path0,sizeof(rrube_path0)-1);
packetfunctions_reserveHeaderSize(pkt,1);
! pkt->payload[0] = (COAP_OPTION_NUM_URIPATH) << 4 |
sizeof(rrube_path0)-1;
numOptions++;
// metadata
***************
*** 238,243 ****
return;
}
! void rrube_sendDone(OpenQueueEntry_t* msg, error_t error) {
openqueue_freePacketBuffer(msg);
}
\ No newline at end of file
--- 237,242 ----
return;
}
! void rrube_sendDone(OpenQueueEntry_t* msg, owerror_t error) {
openqueue_freePacketBuffer(msg);
}
\ No newline at end of file