-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from CloudlyIO/release/1.1.0
release 1.1.0 -- modular libhalmplane
- Loading branch information
Showing
40 changed files
with
2,060 additions
and
39 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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
find_library(TINYXML2 tinyxml2) | ||
find_library(DL dl) | ||
|
||
target_link_libraries(halmplane | ||
${DL} | ||
${TINYXML2} | ||
) | ||
|
||
string(CONCAT SRC | ||
|
||
"src/HalMplane.cpp;" | ||
"src/ModuleLoader.cpp;" | ||
"src/MplaneAlarms.cpp;" | ||
"src/MplaneAld.cpp;" | ||
"src/MplaneAntennaCalibration.cpp;" | ||
"src/MplaneBeamforming.cpp;" | ||
"src/MplaneDelayMgmt.cpp;" | ||
"src/MplaneEcpri.cpp;" | ||
"src/MplaneExternalio.cpp;" | ||
"src/MplaneFan.cpp;" | ||
"src/MplaneHardware.cpp;" | ||
"src/MplaneInterfaces.cpp;" | ||
"src/MplaneModuleCapability.cpp;" | ||
##### "src/MplanePerformanceMgmt.cpp;" | ||
"src/MplaneProcessingElements.cpp;" | ||
"src/MplaneSupervision.cpp;" | ||
"src/MplaneSync.cpp;" | ||
"src/MplaneTransceiver.cpp;" | ||
"src/MplaneUplaneConf.cpp;" | ||
|
||
) | ||
include_directories("modular/inc") | ||
|
||
list(TRANSFORM SRC PREPEND "modular/") | ||
target_sources(halmplane PRIVATE ${SRC}) | ||
|
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,45 @@ | ||
# *libhalmplane* `modular` Board | ||
|
||
This board will allow selecting the halmplane driver for any other compatible | ||
board by specifying the filename of its shared library in the server configuration. | ||
|
||
## Building | ||
`mplane_server` must be build with BUILD_BOARD=modular | ||
|
||
``` | ||
BUILD_BOARD=modular BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE BUILD_BOARD" bitbake mplane-image-x86 | ||
``` | ||
|
||
To rebuild with a different builtin board type it may be necessary to rebuild that explicitly | ||
to invalidate the build hash even though the source files have not changed. | ||
``` | ||
BUILD_BOARD=example BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE BUILD_BOARD" bitbake -C configure halmplane | ||
``` | ||
|
||
To select a module in config file, edit `/usr/share/mplane-server/YangConfig.xml` | ||
in the `<halmplane-board-modular>` element. | ||
|
||
To build a specific module | ||
``` | ||
BUILD_BOARD=example BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE BUILD_BOARD" bitbake -C configure halmplanemodule | ||
``` | ||
|
||
Each module has by default a filename of the form `libhalmplane-mod-<BUILD_BOARD>.so` with symlinks | ||
generated that reflect the version. This will allow parallel installation of multiple modules without | ||
packaging conflicts. | ||
|
||
The current bitbake recipes do not support automatically installing the resulting module into the | ||
project `rootfs`, so a command similar to | ||
``` | ||
cp ./tmp/work/core2-64-poky-linux/halmplanemodule/1.1-r0/image/usr/lib/libhalmplane-mod-example.so.1.1.0 ./tmp/work/mplanex86-poky-linux/mplane-image-x86/1.0-r0/rootfs/usr/lib/ | ||
``` | ||
can achieve the desired outcome manually. | ||
|
||
|
||
## Enabling a board for use as a module | ||
To operate as a module, the only thing needed is to provide a function with prototype | ||
``` | ||
void *function_map(); | ||
``` | ||
that is also `extern "C"`. Sample code can be found in `example/src/HalMplane.cpp` | ||
and a complete list of supported API endpoints can be found in `modular/src/HalMplane.cpp`. |
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,34 @@ | ||
/* | ||
* Copyright (c) Linux Foundation and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#ifndef __MODULE_LOADER_H__ | ||
#define __MODULE_LOADER_H__ | ||
|
||
#include <cstddef> | ||
#include <map> | ||
#include <string> | ||
#include <dlfcn.h> | ||
|
||
|
||
class ModuleLoader | ||
{ | ||
private: | ||
const char* libname; | ||
void* dlhandle; | ||
std::map<std::string, void*> *registered_functions; | ||
|
||
public: | ||
ModuleLoader(); | ||
void open(const char* libname); | ||
void* get(const char* ftag); | ||
}; | ||
|
||
|
||
ModuleLoader* _loader(); | ||
|
||
|
||
#endif |
Oops, something went wrong.