mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
ba3088c4bd
into separate patch files
142 lines
4.4 KiB
Diff
142 lines
4.4 KiB
Diff
*** stock_iot-lab_M3/openwsn/07-App/rt/rt.c Thu Apr 24 11:01:37 2014
|
|
--- riot-openwsn-wip/openwsn/07-App/rt/rt.c Thu Apr 24 16:55:54 2014
|
|
***************
|
|
*** 27,38 ****
|
|
|
|
//=========================== prototypes ======================================
|
|
|
|
! error_t rt_receive(OpenQueueEntry_t* msg,
|
|
coap_header_iht* coap_header,
|
|
coap_option_iht* coap_options);
|
|
void rt_timer();
|
|
void rt_sendDone(OpenQueueEntry_t* msg,
|
|
! error_t error);
|
|
|
|
//=========================== public ==========================================
|
|
|
|
--- 27,38 ----
|
|
|
|
//=========================== prototypes ======================================
|
|
|
|
! owerror_t rt_receive(OpenQueueEntry_t* msg,
|
|
coap_header_iht* coap_header,
|
|
coap_option_iht* coap_options);
|
|
void rt_timer();
|
|
void rt_sendDone(OpenQueueEntry_t* msg,
|
|
! owerror_t error);
|
|
|
|
//=========================== public ==========================================
|
|
|
|
***************
|
|
*** 58,67 ****
|
|
|
|
//=========================== private =========================================
|
|
|
|
! error_t rt_receive(OpenQueueEntry_t* msg,
|
|
coap_header_iht* coap_header,
|
|
coap_option_iht* coap_options) {
|
|
! error_t outcome;
|
|
uint8_t rawdata[SENSITIVE_ACCEL_TEMPERATURE_DATALEN];
|
|
|
|
if (coap_header->Code==COAP_CODE_REQ_POST) {
|
|
--- 58,67 ----
|
|
|
|
//=========================== private =========================================
|
|
|
|
! owerror_t rt_receive(OpenQueueEntry_t* msg,
|
|
coap_header_iht* coap_header,
|
|
coap_option_iht* coap_options) {
|
|
! owerror_t outcome;
|
|
uint8_t rawdata[SENSITIVE_ACCEL_TEMPERATURE_DATALEN];
|
|
|
|
if (coap_header->Code==COAP_CODE_REQ_POST) {
|
|
***************
|
|
*** 78,84 ****
|
|
msg->length = 0;
|
|
|
|
// CoAP header
|
|
- coap_header->OC = 0;
|
|
coap_header->Code = COAP_CODE_RESP_VALID;
|
|
|
|
outcome = E_SUCCESS;
|
|
--- 78,83 ----
|
|
***************
|
|
*** 97,104 ****
|
|
msg->payload[1] = rawdata[9];
|
|
|
|
// set the CoAP header
|
|
! coap_header->OC = 0;
|
|
! coap_header->Code = COAP_CODE_RESP_CONTENT;
|
|
|
|
outcome = E_SUCCESS;
|
|
|
|
--- 96,102 ----
|
|
msg->payload[1] = rawdata[9];
|
|
|
|
// set the CoAP header
|
|
! coap_header->Code = COAP_CODE_RESP_CONTENT;
|
|
|
|
outcome = E_SUCCESS;
|
|
|
|
***************
|
|
*** 112,118 ****
|
|
|
|
void rt_timer() {
|
|
OpenQueueEntry_t* pkt;
|
|
! error_t outcome;
|
|
uint8_t numOptions;
|
|
uint8_t rawdata[SENSITIVE_ACCEL_TEMPERATURE_DATALEN];
|
|
|
|
--- 110,116 ----
|
|
|
|
void rt_timer() {
|
|
OpenQueueEntry_t* pkt;
|
|
! owerror_t outcome;
|
|
uint8_t numOptions;
|
|
uint8_t rawdata[SENSITIVE_ACCEL_TEMPERATURE_DATALEN];
|
|
|
|
***************
|
|
*** 139,150 ****
|
|
packetfunctions_reserveHeaderSize(pkt,sizeof(rt_path0)-1);
|
|
memcpy(&pkt->payload[0],&rt_path0,sizeof(rt_path0)-1);
|
|
packetfunctions_reserveHeaderSize(pkt,1);
|
|
! pkt->payload[0] = (COAP_OPTION_LOCATIONPATH-COAP_OPTION_CONTENTTYPE) << 4 |
|
|
sizeof(rt_path0)-1;
|
|
numOptions++;
|
|
// content-type option
|
|
packetfunctions_reserveHeaderSize(pkt,2);
|
|
! pkt->payload[0] = COAP_OPTION_CONTENTTYPE << 4 |
|
|
1;
|
|
pkt->payload[1] = COAP_MEDTYPE_APPOCTETSTREAM;
|
|
numOptions++;
|
|
--- 137,148 ----
|
|
packetfunctions_reserveHeaderSize(pkt,sizeof(rt_path0)-1);
|
|
memcpy(&pkt->payload[0],&rt_path0,sizeof(rt_path0)-1);
|
|
packetfunctions_reserveHeaderSize(pkt,1);
|
|
! pkt->payload[0] = (COAP_OPTION_NUM_URIPATH) << 4 |
|
|
sizeof(rt_path0)-1;
|
|
numOptions++;
|
|
// content-type option
|
|
packetfunctions_reserveHeaderSize(pkt,2);
|
|
! pkt->payload[0] = COAP_OPTION_NUM_CONTENTFORMAT << 4 |
|
|
1;
|
|
pkt->payload[1] = COAP_MEDTYPE_APPOCTETSTREAM;
|
|
numOptions++;
|
|
***************
|
|
*** 166,171 ****
|
|
return;
|
|
}
|
|
|
|
! void rt_sendDone(OpenQueueEntry_t* msg, error_t error) {
|
|
openqueue_freePacketBuffer(msg);
|
|
}
|
|
\ No newline at end of file
|
|
--- 164,169 ----
|
|
return;
|
|
}
|
|
|
|
! void rt_sendDone(OpenQueueEntry_t* msg, owerror_t error) {
|
|
openqueue_freePacketBuffer(msg);
|
|
}
|
|
\ No newline at end of file
|