Skip to content
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
11 changes: 11 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ See [SKILL.md](./SKILL.md) for guidance when using this SDK with AI tools.

- Linux (Ubuntu 18.04+, Raspberry Pi 4+, Jetson)
- Windows (Windows 10+)
- macOS 12+ (Apple Silicon; face-auth path only — preview/libuvc unsupported)
- Android 8-16

## Bindings
Expand Down Expand Up @@ -148,6 +149,16 @@ In order to be able to capture metadata for RAW format, open a `PowerShell` term
.\scripts\realsenseid_metadata_win10-f500.ps1
```

### macOS Notes

The face-auth path (FaceAuthenticator, DeviceController, FwUpdater) builds and runs on macOS using the existing POSIX `LinuxSerial` implementation. Build with `-DRSID_PREVIEW=OFF`; the preview pipeline (libuvc) is not yet supported on macOS.

`discover_devices()` walks `/sys/bus/usb/` (Linux-only) and returns an empty list on macOS. Pass the F455's serial port directly to `FaceAuthenticator(<port>)`. Locate it with:

```bash
ls /dev/cu.usbmodem*
```

## Sample Code

This snippet shows the basic usage of our library.
Expand Down
3 changes: 3 additions & 0 deletions cmake/OS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
message(STATUS "Linux platform")
add_definitions(-DLINUX)

elseif(APPLE)
message(STATUS "macOS platform")

elseif(ANDROID)
message(STATUS "Android platform")
add_definitions(-DANDROID_STL=c++_shared)
Expand Down
4 changes: 2 additions & 2 deletions src/DeviceController/DeviceControllerImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "PacketManager/WindowsSerial.h"
#elif defined(__ANDROID__)
#include "PacketManager/AndroidSerial.h"
#elif defined(__linux__)
#elif defined(__linux__) || defined(__APPLE__)
#include "PacketManager/LinuxSerial.h"
#else
#error "Platform not supported"
Expand Down Expand Up @@ -60,7 +60,7 @@ Status DeviceControllerImpl::Connect(const SerialConfig& config)
serial_config.readEndpoint = config.readEndpoint;
serial_config.writeEndpoint = config.writeEndpoint;
_serial = std::make_unique<PacketManager::AndroidSerial>(serial_config);
#elif defined(__linux__)
#elif defined(__linux__) || defined(__APPLE__)
_serial = std::make_unique<PacketManager::LinuxSerial>(PacketManager::SerialConfig({config.port}));
#else
LOG_ERROR(LOG_TAG, "Serial connection method not supported for OS");
Expand Down
4 changes: 2 additions & 2 deletions src/FaceAuthenticator/Impl/FaceAuthenticatorCommon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "PacketManager/WindowsSerial.h"
#elif defined(__ANDROID__)
#include "PacketManager/AndroidSerial.h"
#elif defined(__linux__)
#elif defined(__linux__) || defined(__APPLE__)
#include "PacketManager/LinuxSerial.h"
#else
#error "Platform not supported"
Expand Down Expand Up @@ -227,7 +227,7 @@ Status FaceAuthenticatorCommon::Connect(const SerialConfig& config)
serial_config.readEndpoint = config.readEndpoint;
serial_config.writeEndpoint = config.writeEndpoint;
_serial = std::make_unique<PacketManager::AndroidSerial>(serial_config);
#elif defined(__linux__)
#elif defined(__linux__) || defined(__APPLE__)
_serial = std::make_unique<PacketManager::LinuxSerial>(PacketManager::SerialConfig({config.port}));
#else
LOG_ERROR(LOG_TAG, "Serial connection method not supported for OS");
Expand Down
4 changes: 2 additions & 2 deletions src/FwUpdate/F45x/FwUpdaterCommF45x.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "PacketManager/WindowsSerial.h"
#elif defined(__ANDROID__)
#include "PacketManager/AndroidSerial.h"
#elif defined(__linux__)
#elif defined(__linux__) || defined(__APPLE__)
#include "PacketManager/LinuxSerial.h"
#else
#error "Platform not supported"
Expand All @@ -42,7 +42,7 @@ FwUpdaterCommF45x::FwUpdaterCommF45x(const SerialConfig& config)
serial_config.readEndpoint = config.readEndpoint;
serial_config.writeEndpoint = config.writeEndpoint;
_serial = std::make_unique<PacketManager::AndroidSerial>(serial_config);
#elif defined(__linux__)
#elif defined(__linux__) || defined(__APPLE__)
_serial = std::make_unique<PacketManager::LinuxSerial>(PacketManager::SerialConfig({config.port}));
#else
throw std::runtime_error("FwUpdaterComm not supported for this OS yet");
Expand Down
4 changes: 2 additions & 2 deletions src/FwUpdate/F50x/FwUpdaterCommF50x.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "PacketManager/WindowsSerial.h"
#elif defined(__ANDROID__)
#include "PacketManager/AndroidSerial.h"
#elif defined(__linux__)
#elif defined(__linux__) || defined(__APPLE__)
#include "PacketManager/LinuxSerial.h"
#else
#error "Platform not supported"
Expand All @@ -41,7 +41,7 @@ FwUpdaterCommF50x::FwUpdaterCommF50x(const SerialConfig& config)
serial_config.readEndpoint = config.readEndpoint;
serial_config.writeEndpoint = config.writeEndpoint;
_serial = std::make_unique<PacketManager::AndroidSerial>(serial_config);
#elif defined(__linux__)
#elif defined(__linux__) || defined(__APPLE__)
_serial = std::make_unique<PacketManager::LinuxSerial>(PacketManager::SerialConfig({config.port}));
#else
throw std::runtime_error("FwUpdaterComm not supported for this OS yet");
Expand Down
5 changes: 4 additions & 1 deletion src/PacketManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ set(HEADERS "${SRC_DIR}/Randomizer.h" "${SRC_DIR}/PacketSender.h" "${SRC_DIR}/Se

set(SOURCES "${SRC_DIR}/Randomizer.cc" "${SRC_DIR}/PacketSender.cc" "${SRC_DIR}/SerialPacket.cc" "${SRC_DIR}/Timer.cc" ${SRC_DIR}/Crc16.cc )

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR APPLE)
# LinuxSerial uses only POSIX serial APIs (termios.h / unistd.h /
# fcntl.h) — no Linux-specific syscalls or headers — so the same
# implementation builds and runs on macOS unchanged.
list(APPEND HEADERS "${SRC_DIR}/LinuxSerial.h")
list(APPEND SOURCES "${SRC_DIR}/LinuxSerial.cc")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Expand Down