Mbed OS Reference
Loading...
Searching...
No Matches
mesh_system.h
1/*
2 * Copyright (c) 2015-2019 ARM Limited. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 * Licensed under the Apache License, Version 2.0 (the License); you may
5 * not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef __INCLUDE_MESH_SYSTEM__
18#define __INCLUDE_MESH_SYSTEM__
19#include "ns_types.h"
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/*
26 * Event type for connecting
27 */
28enum {
29 APPL_EVENT_CONNECT = 0x01,
30 APPL_BACKHAUL_INTERFACE_PHY_DOWN,
31 APPL_BACKHAUL_LINK_DOWN,
32 APPL_BACKHAUL_LINK_UP
33};
34
35
36typedef uint64_t ns_time_read_cb(void);
37typedef void ns_time_write_cb(uint64_t);
38
39
40/*
41 * \brief Send application connect event to receiver tasklet to
42 * ensure that connection is made in right tasklet.
43 */
44void mesh_system_send_connect_event(uint8_t receiver);
45
46int mesh_system_set_file_system_root_path(const char *root_path);
47
48void mesh_system_time_callback_set(ns_time_read_cb, ns_time_write_cb);
49
50/*
51 * \brief Initialize mesh system.
52 * Memory pool, timers, traces and support are initialized.
53 */
54void mesh_system_init(void);
55
56#ifdef __cplusplus
57}
58#endif
59
60#include "nanostack-event-loop/eventOS_scheduler.h"
61
62#define nanostack_lock() eventOS_scheduler_mutex_wait()
63#define nanostack_unlock() eventOS_scheduler_mutex_release()
64#define nanostack_assert_locked() //MBED_ASSERT(eventOS_scheduler_mutex_is_owner())
65
66#endif /* __INCLUDE_MESH_SYSTEM__ */