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_rleds_rleds.c.patch
2014-05-14 15:06:50 +02:00

115 lines
3.6 KiB
Diff

*** stock_iot-lab_M3/openwsn/07-App/rleds/rleds.c Thu Apr 24 11:01:37 2014
--- riot-openwsn-wip/openwsn/07-App/rleds/rleds.c Thu Apr 24 16:55:54 2014
***************
*** 1,8 ****
#include "openwsn.h"
! #include "rleds.h"
#include "opencoap.h"
#include "packetfunctions.h"
! #include "leds.h"
#include "openqueue.h"
//=========================== variables =======================================
--- 1,8 ----
#include "openwsn.h"
! #include "rleds_ow.h"
#include "opencoap.h"
#include "packetfunctions.h"
! #include "leds_ow.h"
#include "openqueue.h"
//=========================== variables =======================================
***************
*** 17,31 ****
//=========================== prototypes ======================================
! error_t rleds_receive(OpenQueueEntry_t* msg,
coap_header_iht* coap_header,
coap_option_iht* coap_options);
void rleds_sendDone(OpenQueueEntry_t* msg,
! error_t error);
//=========================== public ==========================================
! void rleds_init() {
// prepare the resource descriptor for the /.well-known/core path
rleds_vars.desc.path0len = sizeof(rleds_path0)-1;
rleds_vars.desc.path0val = (uint8_t*)(&rleds_path0);
--- 17,31 ----
//=========================== prototypes ======================================
! owerror_t rleds_receive(OpenQueueEntry_t* msg,
coap_header_iht* coap_header,
coap_option_iht* coap_options);
void rleds_sendDone(OpenQueueEntry_t* msg,
! owerror_t error);
//=========================== public ==========================================
! void rleds__init() {
// prepare the resource descriptor for the /.well-known/core path
rleds_vars.desc.path0len = sizeof(rleds_path0)-1;
rleds_vars.desc.path0val = (uint8_t*)(&rleds_path0);
***************
*** 40,49 ****
//=========================== private =========================================
! error_t rleds_receive(OpenQueueEntry_t* msg,
coap_header_iht* coap_header,
coap_option_iht* coap_options) {
! error_t outcome;
if (coap_header->Code==COAP_CODE_REQ_GET) {
// reset packet payload
--- 40,49 ----
//=========================== private =========================================
! owerror_t rleds_receive(OpenQueueEntry_t* msg,
coap_header_iht* coap_header,
coap_option_iht* coap_options) {
! owerror_t outcome;
if (coap_header->Code==COAP_CODE_REQ_GET) {
// reset packet payload
***************
*** 59,65 ****
}
// set the CoAP header
- coap_header->OC = 0;
coap_header->Code = COAP_CODE_RESP_CONTENT;
outcome = E_SUCCESS;
--- 59,64 ----
***************
*** 79,85 ****
msg->length = 0;
// set the CoAP header
- coap_header->OC = 0;
coap_header->Code = COAP_CODE_RESP_CHANGED;
outcome = E_SUCCESS;
--- 78,83 ----
***************
*** 89,94 ****
return outcome;
}
! void rleds_sendDone(OpenQueueEntry_t* msg, error_t error) {
openqueue_freePacketBuffer(msg);
}
\ No newline at end of file
--- 87,92 ----
return outcome;
}
! void rleds_sendDone(OpenQueueEntry_t* msg, owerror_t error) {
openqueue_freePacketBuffer(msg);
}
\ No newline at end of file