Move declaration for 'uri' into own header

This is more C like and leads to a better modularized project.
This commit is contained in:
Lukas Woodtli 2024-08-12 15:54:10 +02:00 committed by Lukas Woodtli
parent befa878121
commit 17c9238628
2 changed files with 35 additions and 13 deletions

View File

@ -70,6 +70,7 @@
#include "observe.h"
#include "registration.h"
#include "reporting.h"
#include "uri.h"
#include "utils.h"
#if LWM2M_LOG_LEVEL != LWM2M_LOG_DISABLED
@ -377,15 +378,6 @@ typedef struct
} bs_data_t;
#endif
typedef enum {
LWM2M_REQUEST_TYPE_UNKNOWN,
LWM2M_REQUEST_TYPE_DM,
LWM2M_REQUEST_TYPE_REGISTRATION,
LWM2M_REQUEST_TYPE_BOOTSTRAP,
LWM2M_REQUEST_TYPE_DELETE_ALL,
LWM2M_REQUEST_TYPE_SEND,
} lwm2m_request_type_t;
#ifdef LWM2M_SUPPORT_SENML_CBOR
typedef enum {
CBOR_TYPE_UNKNOWN,
@ -412,10 +404,6 @@ typedef struct {
typedef bool (*senml_convertValue)(const senml_record_t *recordP, lwm2m_data_t *targetP);
#endif
// defined in uri.c
lwm2m_request_type_t uri_decode(char * altPath, multi_option_t *uriPath, uint8_t code, lwm2m_uri_t *uriP);
int uri_getNumber(uint8_t * uriString, size_t uriLength);
// defined in transaction.c
lwm2m_transaction_t * transaction_new(void * sessionH, coap_method_t method, char * altPath, lwm2m_uri_t * uriP, uint16_t mID, uint8_t token_len, uint8_t* token);
int transaction_send(lwm2m_context_t * contextP, lwm2m_transaction_t * transacP);

34
core/uri.h Normal file
View File

@ -0,0 +1,34 @@
/*******************************************************************************
*
* Copyright (c) 2024 GARDENA GmbH
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v20.html
* The Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Lukas Woodtli, GARDENA GmbH - Please refer to git log
*
*******************************************************************************/
#ifndef WAKAAMA_URI_H
#define WAKAAMA_URI_H
#include "internals.h"
typedef enum {
LWM2M_REQUEST_TYPE_UNKNOWN,
LWM2M_REQUEST_TYPE_DM,
LWM2M_REQUEST_TYPE_REGISTRATION,
LWM2M_REQUEST_TYPE_BOOTSTRAP,
LWM2M_REQUEST_TYPE_DELETE_ALL,
LWM2M_REQUEST_TYPE_SEND,
} lwm2m_request_type_t;
lwm2m_request_type_t uri_decode(char *altPath, multi_option_t *uriPath, uint8_t code, lwm2m_uri_t *uriP);
int uri_getNumber(uint8_t *uriString, size_t uriLength);
#endif /* WAKAAMA_URI_H */