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

107 lines
3.3 KiB
Diff

*** stock_iot-lab_M3/openwsn/07-App/rinfo/rinfo.c Thu Apr 24 11:01:37 2014
--- riot-openwsn-wip/openwsn/07-App/rinfo/rinfo.c Thu Apr 24 16:55:54 2014
***************
*** 6,11 ****
--- 6,12 ----
#include "openserial.h"
#include "openrandom.h"
#include "board.h"
+ #include "idmanager.h"
//=========================== defines =========================================
***************
*** 21,35 ****
//=========================== prototypes ======================================
! error_t rinfo_receive(OpenQueueEntry_t* msg,
coap_header_iht* coap_header,
coap_option_iht* coap_options);
void rinfo_sendDone(OpenQueueEntry_t* msg,
! error_t error);
//=========================== public ==========================================
! void rinfo_init() {
// prepare the resource descriptor for the /temp path
rinfo_vars.desc.path0len = sizeof(rinfo_path0)-1;
rinfo_vars.desc.path0val = (uint8_t*)(&rinfo_path0);
--- 22,39 ----
//=========================== prototypes ======================================
! owerror_t rinfo_receive(OpenQueueEntry_t* msg,
coap_header_iht* coap_header,
coap_option_iht* coap_options);
void rinfo_sendDone(OpenQueueEntry_t* msg,
! owerror_t error);
//=========================== public ==========================================
! void rinfo_init(void) {
!
!
! if(idmanager_getIsDAGroot()==TRUE) return;
// prepare the resource descriptor for the /temp path
rinfo_vars.desc.path0len = sizeof(rinfo_path0)-1;
rinfo_vars.desc.path0val = (uint8_t*)(&rinfo_path0);
***************
*** 44,53 ****
//=========================== private =========================================
! error_t rinfo_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) {
--- 48,57 ----
//=========================== private =========================================
! owerror_t rinfo_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) {
***************
*** 81,88 ****
msg->payload[sizeof(infoStackName)-1+5-1] = '0'+OPENWSN_VERSION_PATCH;
// set the CoAP header
! coap_header->OC = 0;
! coap_header->Code = COAP_CODE_RESP_CONTENT;
outcome = E_SUCCESS;
--- 85,91 ----
msg->payload[sizeof(infoStackName)-1+5-1] = '0'+OPENWSN_VERSION_PATCH;
// set the CoAP header
! coap_header->Code = COAP_CODE_RESP_CONTENT;
outcome = E_SUCCESS;
***************
*** 94,99 ****
return outcome;
}
! void rinfo_sendDone(OpenQueueEntry_t* msg, error_t error) {
openqueue_freePacketBuffer(msg);
}
\ No newline at end of file
--- 97,102 ----
return outcome;
}
! void rinfo_sendDone(OpenQueueEntry_t* msg, owerror_t error) {
openqueue_freePacketBuffer(msg);
}
\ No newline at end of file