forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented optimal packet size test api (ARMmbed#2292)
- Loading branch information
Jarkko Paso
authored
Feb 4, 2020
1 parent
87ee16a
commit 4f27500
Showing
6 changed files
with
94 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2020, Arm Limited and affiliates. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* \file fhss_test_api.h | ||
* \brief | ||
*/ | ||
|
||
#ifndef FHSS_TEST_API_H | ||
#define FHSS_TEST_API_H | ||
|
||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* \brief Set optimal packet length | ||
* | ||
* \param fhss_api FHSS instance. | ||
* \param packet_length Optimal packet length | ||
* | ||
* \return 0 Success | ||
* \return -1 Failure | ||
*/ | ||
int8_t fhss_set_optimal_packet_length(const fhss_api_t *fhss_api, uint16_t packet_length); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // FHSS_TEST_API_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2020, Arm Limited and affiliates. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#include "nsconfig.h" | ||
#include "ns_types.h" | ||
#include "ns_trace.h" | ||
#include "fhss_api.h" | ||
#include "fhss_config.h" | ||
#include "fhss.h" | ||
#include "fhss_common.h" | ||
#include "fhss_ws.h" | ||
#include "fhss_statistics.h" | ||
#include "fhss_channel.h" | ||
#include "channel_list.h" | ||
#include <string.h> | ||
|
||
#define TRACE_GROUP "fhta" | ||
|
||
int8_t fhss_set_optimal_packet_length(const fhss_api_t *fhss_api, uint16_t packet_length) | ||
{ | ||
fhss_structure_t *fhss_structure = fhss_get_object_with_api(fhss_api); | ||
if (!fhss_structure) { | ||
return -1; | ||
} | ||
fhss_structure->optimal_packet_length = packet_length; | ||
fhss_set_txrx_slot_length(fhss_structure); | ||
tr_debug("Setting FHSS optimal packet length to: %u", fhss_structure->optimal_packet_length); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters