Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
LoRaWANInterface.cpp
00001 /** 00002 * @file 00003 * 00004 * @brief Implementation of LoRaWANBase 00005 * 00006 * Copyright (c) 2017, Arm Limited and affiliates. 00007 * SPDX-License-Identifier: Apache-2.0 00008 * 00009 * Licensed under the Apache License, Version 2.0 (the "License"); 00010 * you may not use this file except in compliance with the License. 00011 * You may obtain a copy of the License at 00012 * 00013 * http://www.apache.org/licenses/LICENSE-2.0 00014 * 00015 * Unless required by applicable law or agreed to in writing, software 00016 * distributed under the License is distributed on an "AS IS" BASIS, 00017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00018 * See the License for the specific language governing permissions and 00019 * limitations under the License. 00020 */ 00021 00022 #include "lorawan/LoRaWANInterface.h" 00023 00024 using namespace events; 00025 00026 inline LoRaWANStack& stk_obj() 00027 { 00028 return LoRaWANStack::get_lorawan_stack(); 00029 } 00030 00031 LoRaWANInterface::LoRaWANInterface(LoRaRadio& radio) 00032 { 00033 stk_obj().bind_radio_driver(radio); 00034 } 00035 00036 LoRaWANInterface::~LoRaWANInterface() 00037 { 00038 } 00039 00040 lorawan_status_t LoRaWANInterface::initialize(EventQueue *queue) 00041 { 00042 return stk_obj().initialize_mac_layer(queue); 00043 } 00044 00045 lorawan_status_t LoRaWANInterface::connect() 00046 { 00047 return stk_obj().connect(); 00048 } 00049 00050 lorawan_status_t LoRaWANInterface::connect(const lorawan_connect_t &connect) 00051 { 00052 return stk_obj().connect(connect); 00053 } 00054 00055 lorawan_status_t LoRaWANInterface::disconnect() 00056 { 00057 return stk_obj().shutdown(); 00058 } 00059 00060 lorawan_status_t LoRaWANInterface::add_link_check_request() 00061 { 00062 return stk_obj().set_link_check_request(); 00063 } 00064 00065 void LoRaWANInterface::remove_link_check_request() 00066 { 00067 stk_obj().remove_link_check_request(); 00068 } 00069 00070 lorawan_status_t LoRaWANInterface::set_datarate(uint8_t data_rate) 00071 { 00072 return stk_obj().set_channel_data_rate(data_rate); 00073 } 00074 00075 lorawan_status_t LoRaWANInterface::set_confirmed_msg_retries(uint8_t count) 00076 { 00077 return stk_obj().set_confirmed_msg_retry(count); 00078 } 00079 00080 lorawan_status_t LoRaWANInterface::enable_adaptive_datarate() 00081 { 00082 return stk_obj().enable_adaptive_datarate(true); 00083 } 00084 00085 lorawan_status_t LoRaWANInterface::disable_adaptive_datarate() 00086 { 00087 return stk_obj().enable_adaptive_datarate(false); 00088 } 00089 00090 lorawan_status_t LoRaWANInterface::set_channel_plan(const lorawan_channelplan_t &channel_plan) 00091 { 00092 return stk_obj().add_channels(channel_plan); 00093 } 00094 00095 lorawan_status_t LoRaWANInterface::get_channel_plan(lorawan_channelplan_t &channel_plan) 00096 { 00097 return stk_obj().get_enabled_channels(channel_plan); 00098 } 00099 00100 lorawan_status_t LoRaWANInterface::remove_channel(uint8_t id) 00101 { 00102 return stk_obj().remove_a_channel(id); 00103 } 00104 00105 lorawan_status_t LoRaWANInterface::remove_channel_plan() 00106 { 00107 return stk_obj().drop_channel_list(); 00108 } 00109 00110 int16_t LoRaWANInterface::send(uint8_t port, const uint8_t* data, 00111 uint16_t length, int flags) 00112 { 00113 return stk_obj().handle_tx(port, data, length, flags); 00114 00115 } 00116 00117 int16_t LoRaWANInterface::receive(uint8_t port, uint8_t* data, uint16_t length, 00118 int flags) 00119 { 00120 return stk_obj().handle_rx(port, data, length, flags); 00121 } 00122 00123 lorawan_status_t LoRaWANInterface::add_app_callbacks(lorawan_app_callbacks_t *callbacks) 00124 { 00125 return stk_obj().set_lora_callbacks(callbacks); 00126 } 00127 00128 lorawan_status_t LoRaWANInterface::set_device_class(const device_class_t device_class) 00129 { 00130 return stk_obj().set_device_class(device_class); 00131 }
Generated on Tue Jul 12 2022 12:11:25 by
