cloud/coap_demo/common.h

/*******************************************************************************
* # License
* Copyright 2019 Silicon Laboratories Inc. www.silabs.com
*******************************************************************************
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
* software is governed by the terms of Silicon Labs Master Software License
* Agreement (MSLA) available at
* www.silabs.com/about-us/legal/master-software-license-agreement. This
* software is distributed to you in Source Code format and is governed by the
* sections of the MSLA applicable to Source Code.
*
******************************************************************************/
#pragma once
#include "coap.h"
//#define COAP_HOST "californium.eclipse.org"
#define COAP_HOST "coap.me"
#define COAP_PORT 5683
#define COAP_PATH "/hello"
#define SETTINGS_MAGIC_NUMBER 0xAB28BA35UL
#define MAX_HOST_STRING_SIZE 80
#define MAX_PATH_LENGTH 64
#define MAX_PAYLOAD_LENGTH 100
extern char custom_path[MAX_PATH_LENGTH];
extern char payload[MAX_PAYLOAD_LENGTH];
extern bool observing;
typedef struct
{
uint32_t magic;
char host[ MAX_HOST_STRING_SIZE ];
uint16_t port;
char path[ MAX_PATH_LENGTH ];
} coap_settings_t;
extern coap_uri_t coap_uri;
void commands_init( void );
void commands_deinit( void );
void coap_app_get ( void* arg );
void coap_app_discover( void* arg );
void coap_app_put ( void* arg );
void coap_app_post ( void* arg );
void coap_app_delete ( void* arg );
void coap_app_observe ( void* arg );
void coap_app_cancel ( void* arg );