Mistake on this page?
Report an issue in GitHub or email us
ThreadInterface.h
1 /*
2  * Copyright (c) 2015 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 THREADINTERFACE_H
18 #define THREADINTERFACE_H
19 
20 #include "MeshInterfaceNanostack.h"
21 
22 /** Thread mesh network interface class
23  *
24  * Configure Nanostack to use Thread protocol.
25  */
27 public:
28 
29  /** Create an uninitialized ThreadInterface
30  *
31  * Must initialize to initialize the mesh on a phy.
32  */
34 
35  /** Create an initialized ThreadInterface
36  *
37  */
39 
40  /**
41  * \brief Sets the eui64 for the device configuration.
42  * By default this value is read from the radio driver.
43  * The value must be set before calling the connect function.
44  * */
45  void device_eui64_set(const uint8_t *eui64);
46 
47  /**
48  * \brief Reads the eui64 from the device configuration.
49  * By default this value is read from the radio driver, but it may have
50  * been set by device_eui64_set().
51  * */
52  void device_eui64_get(uint8_t *eui64);
53 
54  /**
55  * \brief sets the PSKd for the device configuration.
56  * The default value is overwritten, which is defined in the mbed_lib.json file in the mesh-api
57  * The value must be set before calling the connect function.
58  * \return MESH_ERROR_NONE on success.
59  * \return MESH_ERROR_PARAM in case of illegal parameters.
60  * \return MESH_ERROR_MEMORY in case of memory error.
61  * */
62 
63  mesh_error_t device_pskd_set(const char *pskd);
64 
65 protected:
66  Nanostack::ThreadInterface *get_interface() const;
67  virtual nsapi_error_t do_initialize();
68 };
69 
70 #endif // THREADINTERFACE_H
Radio PHY driver class for Nanostack.
void device_eui64_get(uint8_t *eui64)
Reads the eui64 from the device configuration.
signed int nsapi_error_t
Type used to represent error codes.
Definition: nsapi_types.h:95
Thread mesh network interface class.
void device_eui64_set(const uint8_t *eui64)
Sets the eui64 for the device configuration.
mesh_error_t device_pskd_set(const char *pskd)
sets the PSKd for the device configuration.
ThreadInterface(NanostackRfPhy *phy)
Create an initialized ThreadInterface.
ThreadInterface()
Create an uninitialized ThreadInterface.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.