Skip to content

Global library features development #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions DeviceBuilder.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#ifndef _DEVICE_BUILDER_H_
#define _DEVICE_BUILDER_H_

//#define _PROTOCOL_ONLY_DEFINITIONS_
#include "UbiDevice.h"


//TODO: refactor such that there is no need to define "getDeviceInstance" method for each device
// The only possible way to avoid having to define "getDeviceInstance" method for each device
// is to use c++20 Concepts which allow to define a template based upon structural typing
// however it is not yet supported by Arduino IDE compiler natively


#if defined(MKR_1400_GSM)
#include "Devices/UbiArduino_MKR_GSM.h"
UbiDevice *device = UbiArduino_MKR_GSM::getDeviceInstance();
#elif defined(ESP32_CAM)
#include "Devices/UbiESP32.h"
UbiDevice *device = UbiESP32::getDeviceInstance();
#elif defined(_UBI_ESP8266_)
#include "Devices/UbiESP8266.h"
UbiDevice* device = UbiESP8266::getDeviceInstance();
#else

#define _ONLY_DECLARATIONS_


//ifdefined endif
#endif



//Guard header endif
#endif
Loading