Skip to content

Commit

Permalink
Move saul_coap_init declaration in saul_coap.h
Browse files Browse the repository at this point in the history
  • Loading branch information
rosetree committed Dec 16, 2019
1 parent f3193b7 commit 1da5fd2
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
3 changes: 1 addition & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
#include "msg.h"
#include "shell.h"
#include "saul_cord_ep.h"
#include "saul_coap.h"

#define MAIN_QUEUE_SIZE (4)
#define CORD_EP_ADDRESS "[fdaa:bb:cc:dd::1]:5683"

static msg_t _main_msg_queue[MAIN_QUEUE_SIZE];

extern void saul_coap_init(void);

/* we will use custom event handler for dumping cord_ep events */
static void _on_ep_event(saul_cord_ep_event_t event)
{
Expand Down
2 changes: 2 additions & 0 deletions saul_coap.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "net/gcoap.h"
#include "cbor.h"

#include "saul_coap.h"

static ssize_t _saul_cnt_handler(coap_pkt_t* pdu, uint8_t *buf, size_t len, void *ctx);
static ssize_t _saul_dev_handler(coap_pkt_t* pdu, uint8_t *buf, size_t len, void *ctx);
static ssize_t _saul_sensortype_handler(coap_pkt_t* pdu, uint8_t *buf, size_t len, void *ctx);
Expand Down
37 changes: 37 additions & 0 deletions saul_coap.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2019 HAW Hamburg
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*
* @ingroup pkg
* @{
*
* @file
* @brief Adapt SAUL registry for CoAP.
*
* @author Micha Rosenbaum <[email protected]>
*
* @}
*/
#ifndef SAUL_COAP_H
#define SAUL_COAP_H

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Initialize and register the saul-coap resources.
*
* @warning This function must only be called once (typically during system
* initialization)
*/
void saul_coap_init(void);

#ifdef __cplusplus
}
#endif

#endif /* SAUL_COAP_H */

0 comments on commit 1da5fd2

Please sign in to comment.